Linux commands

Command Description Example
cd change directory  
pwd Display current location  
touch create an empty file touch f.txt
df -h disk filesystem: get a full summary of available and used disk space usage  
–help provide information about command command –help
mkdir make a new directory  
ls list all files and directories  
ls -a display all contents of the directory, including hidden files  
ls -l display a long list with detailed information  
–color display in color ls -a –color
ls -r sort directories and files in the reverse order  
ls -s display sorted files by size, from largest to smallest  
cp copy cp folder1 folder2
cat read, display and concatenate text files  
clear clear screen  
reset go back to a state before clear command  
chmod modify permission access chmode 644 folder1
mv move file mv
rm remove file rm folder1
man view manual pages  
grep search text patterns grep coffee folder 1
less view the contents one screen at a time ls -al /etc | less
tail print the last 10 lines of a file tail
head print the first 10 lines of a file haed
locate find locations of files on a system locate finger

MS-DOS vs Linux commands

MS-DOS Linux
copy cp
move mv
dir ls
date date
del rm
edit pico
find grep
format a: mke2fs or mformat
command /? man
mkdir mkdir
more less
chdir pwd
cd cd
cd .. cd ..
time date
ren mv

File types by extension

Extension File type
z, gz, tar, tgz compressed file
txt text file
html, htm  
ps ready to print
au, wav audio
xpm, jpg, gif, png image
rpm installation files
conf configuration file
h header file
c, cpp C files
so shared object
o object files