Unix Linux Command Reference PDF
Unix Linux Command Reference PDF
ls -al formatted listing with hidden files date show the current date and time
pwd show current directory name whoami display who you are logged in as
mkdir dirname create directory dirname finger user display information about user
rm filename delete file filename uname -a show operating system kernel information
cp filename1 filename2 copy file filename1 to file filename2 du show directory space usage
more filename output the contents of file filename secure copy (remote file copy program)
Examples:
Copying file to host:
head filename output the first 10 lines of file filename scp source host:target
scp sourcefile user@host:directory/targetfile
scp host:target source
Copying file from host:
tail filename output the last 10 lines of file filename scp user@host:directory/sourcefile targetfile
scp -r user@host:directory/sourcefolder targetfolder
tail -f filename output the contents of file filename as it grows, starting with the last 10 lines
! 1 ! 2
! UNIX/LINUX QUICK COMMAND REFERENCE GUIDE ! UNIX/LINUX QUICK COMMAND REFERENCE GUIDE
File Permissions Compression/Installation
change the permissions of file to octal, which can be set separately for user, group, and tar cf file.tar files create a tar file named file.tar containing files
world by adding:
4 read (r) tar xf file.tar extract the files from file.tar
2 write (w)
chmod octal file
1 execute (x)
Examples: tar czf file.tar.gz files create a tar file with gzip compression
chmod 777 read, write, execute for all (owner, group and world)
chmod 755 rwx for owner, rx for group and world tar xzf file.tar.gz extract a tar using gzip
gedit file use text editor gedit to edit file file (GUI)
! 3 ! 4