The following commands will help you work with directories.
|
ls |
List the contents of the current directory,
not including files whose names begin with a
period (the "hidden" files). |
|
ls -l |
Give a long-form listing, with lots of information
about each file and directory. |
|
ls -a |
Do a normal ls, but include all
files whose names begin with a period. |
|
ls -F |
Do a normal ls, but mark all executable
files with a * and all directories with a /. |
|
ls -laF |
Do all of the above. |
|
mv oldFile newFile |
Move (or, more precisely, rename) the file
oldFile to the file newFile. |
|
mv file directory |
Move a file into a directory. |
|
cp oldFile newFile |
Copy the file oldFile to the file newFile. |
|
cp file directory |
Copy a file into a directory. |
|
rm file |
Remove (that is, delete) a file. THERE IS
NO TRASH CAN, NO RECYCLE BIN, AND NO "UNDELETE"
COMMAND--SO BE CAREFUL WHEN YOU USE RM. |
|
cat file |
Print the file's entire contents to the screen,
all at once. For big files, you'll want to use
more file. The name "cat" comes from the
word "concatenate," which means to string two or more
things together, one after the other. You can use the
cat command to do just that by typing
cat file1 file2 file3 or similar commands. |
|
more file |
Print the file on the screen, one window's
worth at a time. While you're using more,
the spacebar will move you forward one screen,
b will move you back one screen, the return
key will move you forward one line, /something
will move you to the next line that contains
"something," and q will quit. |