-l long format -a list all files, including invisible files (files whose names begin with a period (.)) -t sort the file list by time last modified (most recent first).
-l count lines -w count words -c count characters
form: mv oldfilename newfilenameNote: Using the -i option with cp or mv will cause the system to query you, if the newfilename already exists.
form: rm filenames examples: rm x.[1-4] rm trees marbles
form: cmp filel file2
form: diff file1 file2Following are metacharacters (wild cards) for specifying filenames for many commands.
* match any zero or more characters ? match any single character [set] match any single character in the set, as [a-z] match any lower case character [0-9] match any numeric character [CcDd] match capital C or D or lower case c or dNote: The Shell's expansion of filenames before passing them to the command is called "globbing".
who Who is currently logged in?
whoami Who am I?
finger alster Who is user alster?
ls
Display the names of the files in your directory.
ls -al
Display all the file names in the long format.
ls -At
Display most files sorted by date.
cat filename Display the contents of file filename.
wc filename
Count the number of lines, words, and
characters in file filename.
wc -l filename
Count the number of lines in file filename.
more filename
Display the contents of filename one screen
at a time
head filename Display the first 10 lines of file filename.
tail filename Display the last 10 lines of file filename.
cp colors colors.new Make a copy of file colors.
mv colors.new my.colors Rename colors.new to my.colors.
rm colors Remove (delete) the file colors.
cat memo.l
Display contents of files memo.l, memo.2, memo.3.
cat memo.2
cat memo.3
cmp memo.l memo.3 Compare the
two files, displaying the location
of the first difference.
diff memo.l memo.3 Compare files memo.l
and memo.3, displaying
all differences.
cmp memo.l memo.2 Compare files memo.l and memo.2.
ls m*
List the names of all files beginning with
the character m .
ls *[0-9]
List the names of all files having a numeric
character as the last character.