File Commands |
Purpose |
ls directory/filenames |
list file and directory names (specified
files in the specified directory, or all in the current directory if you omit
directory and filenames) |
ls -l filenames |
display file details (file type, read,
write and execute permissions; owner and group; file
size in bytes; date of last modification; and filenames) |
cat filenames |
concatenate (displays contents of text files to the screen, or combines them together) |
more filename |
display text file to the screen, one screen at a time |
cp filename1 filename2 |
copy a file named filename1 to a new file named filename2 |
mv name1 name2 |
move or rename a file or directory from name1 to name2
(if name2 is a directory, name1 will be moved) |
rm filenames |
remove (delete) specified files |
wc filenames |
word count (counts characters, words and lines in text files) |
sort files > sortedfile |
sort lines in text files (alphabetically) and save results into
sortedfile |
spell filename |
display misspelled words in a text file |
grep pattern filenames |
search files for a pattern (e.g. a text string) and list any matching lines |
find directoryname
-name filename -print |
find files (full paths of files named filename in
directoryname or any subdirectory) |
pico filename |
create or open a text file using the pico editor (other editors you can
try include kedit, nedit, emacs and vim) |
gzip files filename.gz |
compress and combine files to produce an archive file named filename.gz
(does not delete the original files) |
gunzip filename.gz |
uncompress files in filename.gz (does not delete the archive) |