Navigating and manipulating files/directories
If you don't know these commands already, now would be a good
time to learn.
- Show the current directory: pwd
- Change the current directory: cd dirname
- Create a directory: mkdir dirname
- Remove a directory: rmdir dirname
- Remove a file/link: rm filename
- Remove an entire subdirectory tree (dangerous!): rm
-rf dirname
- Make a hard link to a file: ln filename
linkname
- Make a symbolic link to a file: ln -s filename
linkname
- Rename ("move") a file: mv oldname
newname (conceptually equivalent to ln
oldname newname; rm oldname, including maybe not working
across filesystem boundaries)
- Copy a file (duplicates contents, instead of making a link
alias): cp filename newname
- Change permissions on a file/directory: chmod perm
filename
- perm can be an octal code (755) or a symbolic
representation (+x, ug-w, etc.)
- Change ownership of a file: chown username
filename
- Change group owner of a file: chgrp groupname
filename
- Both at once: chown username:groupname
filename
The man command can be used to get detailed
documentation on any of these, for example, man chmod.
Steve VanDevender
Last modified: Thu Jun 26 14:48:35 PDT 2003