Unix Commands: Command Example Description 1. Ls 2. CD

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

UNIX COMMANDS

Command Example Description

1. ls ls Lists files in current directory


ls -alF List in long format

2. cd cd tempdir Change directory to tempdir


cd .. Move back one directory
cd ~dhyatt/web-docs Move into dhyatt's web-docs directory

3. mkdir mkdir graphics Make a directory called graphics

4. rmdir rmdir emptydir Remove directory (must be empty)

5. cp cp file1 web-docs Copy file into directory


cp file1 file1.bak Make backup of file1

6. rm rm file1.bak Remove or delete file


rm *.tmp Remove all file

7. mv mv old.html Move or rename files


new.html

8. more more index.html Look at file, one page at a time

9. lpr lpr index.html Send file to printer

10. man man ls Online manual (help) about command

11. df df See how much free disk space

12. du du -b subdir Estimate disk usage of directory in


Bytes

13. alias alias lls="ls -alF" Create new command "lls" for long
format of ls

15. fold fold -s file1 | lpr Fold or break long lines at 60


characters and send to printer
14. xhost xhost + Permit window to display from x-
threat.tjhsst.edu window program from threat
xhost - Allow no x-window access from other
systems

16. tar tar -cf subdir.tar Create an archive called subdir.tar of a


subdir directory
tar -xvf subdir.tar Extract files from an archive file

17. ghostview gv filename.ps View a Postscript file


(gv)

18. ping ping threat.tjhsst.edu See if machine is alive


(traceroute) traceroute Print data path to a machine
www.yahoo.com

19. top top Print system usage and top resource


hogs

20. logout (exit) logout or exit How to quit a UNIX shell.

21. who who Lists who is logged on your machine

22. finger finger Lists who is on computers in the lab

23. ytalk ytalk Talk online with dhyatt who is on threat


<user@place> dhyatt@threat

24. history history Lists commands you've done recently

25. fortune fortune Print random humorous message

26. date date Print out current date

27. cal <mo> cal 9 2000 Print calendar for September 2000
<yr>

28. xeyes xeyes & Keep track of cursor (in "background")

29. xcalc xcalc & Calculator ("background" process)

30. mpage <opt> mpage -8 Print 8 pages on a single sheet and send to
<file> file1 | lpr printer (the font will be small!)

You might also like