Saturday, 12 May 2012

Unix Commands

Quick Reference to Frequently Used Commands

1. alias - To create an alias (nickname) for a command or show which aliases already exist.
2. at - To schedule a command to run at a particular time. Great for running time-consuming commands later, such as in the middle of the night.
3. apt - A package management tool used by the Debian Linux distribution.
4. banner - To display text in huge, ugle letters.
5. bash - To run the BASH shell, optionally running a script
6. bc - A handy-dandy desk calculator
7. bg - To background a process or job.
8. cal - To print a calender for a month or a year
9. cat - To display a file on-screen
10. cd - To change to another directory, that is, to change the current working directory to the directory you indicate
11. chgrp - To change the group that has access to a file or directory
12. chmod - To chane the permissions for a file
13. chown - To change the ownership of a file
14. cmp - To compare two files and tell you the line numbers where they differ.
15. comm - To compare two text files, each of which is sorted in alphabetical order. Ther program shows you lines that are in both files versus lines that are in just one of them.
16. compress - To shrink a file into a compressed file so that it takes up less space on your disk
17. cp - to copy one or more files
18. cron - This will run scheduled jobs, its similar to the 'at' command above do 'man crontab' or Man Pages for all of its capabilities.
19. csh - To run the C shell, optionally running a script of stored commands
20. date - To tell you the current date and time, taking into account your time zone and, if appropriate, daylight savings time.
21. df - To display how much space is free on your disk
22. diff - To compare two files and print the lines in which the files differ.
23. dpkg - A package management tool used by the Debian Linux distribution.
24. dselect - A package management tool used by the Debian Linux distribution.
25. echo - To echo back whatever you type on the command line after echo, expanding any wildcards using *, ?, or [ ]
26. ed - To run one of the world's ugliest line-oriented text editors
27. elm - To read and send e-mail
28. emacs - To run a powerful, screen-oriented text editor.
29. exit - To logout. When used in a terminal window, closes the window. If exit doesn't work try typing logout. Pressing Ctrl-D can also log you out.
30. fg - To continue a job that you have running in the background.
31. file - To tell you whether something is a file, a direcotry, or something else entirely. If the thing is a file, the file command tries to guess what type of information it contains.
32. find - To find one or more files, assuming that you know their approximate filenames, and do something to them. Use this command when you can't figure out the directory where you put one or more files, but you know the filename(s). When you use the find command, you tell it where to start looking, usually either . (which means "right here") or / (which means "search the entire disk"). Then give the name of the file (type -name, a space and the filename, possibly using wilcard characters), and then you tell find what to do when it finds the files, usually -print (to mean "display the full filenames, including the names of the directories that they are in")
33. ftp - To transfer files from one computer to another over a network
34. getty - sets terminal mode, speed, and line discipline
35. grep - To find lines in one or more files that contain a particular word or phrase. There are two similar commands, egrep and fgrep, that you will probably never use.
36. gs - To print PostScript files, even if you don't have a PostScript printer.
37. gunzip - To unzip gzipped files. Replaces a .gz file with the orginal file.
38. gzip - To compress a file, replaces the orginal file with a GNU ZIP file with a name ending in .gz
39. head - To display just the first few lines of a file (usually the first ten).
40. history - To list the last 20 or so commands you typed. Works only with the BASH, Korn and C shells.
41. id - To tell you your numeric user and group ID, and on BSD, what groups you are in.
42. ifconfig - By typing ifconfig you will see your lo (local), eth0(ethernet), and ppp0(dialup) ip addresses and configurations. do "man ifconfig" or Man Pages for more information.
43. inittab - format of the inittab file used by the sysv-com-patible init process
44. kibitz - A way for two users to share a shell. This is good for teaching purpose's so one user can watch and learn as the other user does things on the system. Both users can send text to the shell screen.
45. kill - To cancel a job that you don't want to continue
46. ksh - To run the Korn shell
47. ln - To create a link to a file so that the file has more than one name or lives in more than one directory. If you use a file all the time and are tired of moving to the directory where it lives, link the file to your home direcotry or to another convenient place. When you use ln, you tell it the current pathname of the file and the new filename you want in the current working directory.
48. logout - To tell unix you are done using it
49. lpr - To print a file
50. lpq - To list the status of al the available printers
51. ls - To list the files in a direcotry. If you don't tell it otherwise, the ls command lists all the files in the working directory. You can tell it the name of antoher directory to list, and you can specify the files you want listed by using a filename(which can include wildcards) Go back to Section One for some other good uses for ls.
52. mail - To read and send e-mail. We suggest using elm or pine instead, if they are available, or any of the GUI e-mail programs found in X.
53. man - To display reference manual page about Unix/Linux commands
54. minicom - friendly serial communication program
55. mkdir - To create a new directory
56. more - To display information a screen at a time, so you have time to read it. When the screen is full, more pauses. To tell it to show you more, press the spacebar. To make more stop, press q.
57. mv - To rename a file or move it from one directory to another.
58. nice - To run a command with lower priority so that it doesn't hog the computer
59. netconfig - To configure your local network settings
60. nslookup - query Internet name servers interactively
61. pack - To shrink a file into one "packed" file so that it takes up less space on you disk. The command is obsolete; compress and gzip shrink alot better
62. passwd - To change your password
63. pcat - To display the contents of a packed file. Packes files have names that end in .z (That's a small z)
64. pico - To run a simple, screen-oriented text editor.
65. pine - To run a nicely designed e-mail program
66. pkgtool - To install and uninstall packages in Slackware
67. pr - To format a text file with page numbers, line numbers, or other options so that it looks nice when you print it.
68. ps - To display information about your process table (jobs) There are several switches you can use with this command do 'man ps' or Man Pages to see them all.
69. pwd - To display the name of the current working directory
70. rcp - To copy files to or from another computer.
71. rlogin - To log in to another UNIX computer on a network. See also telnet.
72. rm - To delete (remove) a file permanently. If there are other links to the file, the file continues to exist, just not under the name you removed. The rm command delete just one name (link) to the file. Be very careful with this command as there is no recycle bin in Unix/Linux and you can not easily get the file back.
73. rmdir - To delete (remove) a directory. Before you delete a directory, delete the files and subdirectories that it contains. The -r option does this for you, but make sure that this is what you really want to do.
74. RPM - RPM is the RedHat Package Manager. It is used to maintain a database of installed packages and the files beloging to each package to allow easy installation, upgrades and removal of packages. The RPM home is Many packages are at To install or upgrade an rpm use rpm -U package.rpm (for upgrade and install) and to remove use rpm -e package (for erase).
75. rsh - To run a command on another UNIX computer. NOTE: called remsh on some systems.
76. set - To set a shell variable to the value you specify, or to display the value of the shell variable. In any shell, typing set by itself lists the variables that are defined, and their values.
77. sh - To run the Bourne shell
78. shutdown - To stop Unix/Linux and prepare a workstation to be turned off. Do 'man shutdown' or Man Pages for required switches
79. sleep - To wait a little while.
80. sort - To sort the lines in a text file.
81. spell - To look through a text file for words not int he UNIX dictionary
82. stty - To set the options for your terminal
83. tail - To display the last few lines of a file
84. talk - To talk to another computer user by typing messages to each other on-screen
85. tar - To copy a file to or from an archieve file or backup tape or diskette. This command has several usages do 'man tar' or Man Pages too see all of them.
86. tee - To copy text from a pipe into a file. tee is most useful for making a log of the output of a slow or long-running program while still seeing its output on-scree. It's also good for debugging scripts so that you can see what's coming out of one program and going into another.
87. telnet - To log in to a remote computer, even one that doesn't run unix.
88. troff - To format text files for output on a high-quality printer or typsetter unsing a complex formatting language.
89. updatedb - This command will update the internal database of the filesystem.
90. unpack - To restore a packed files to irs orginal size A .z at the end of the filename confirms that this is a packed tile. If a filename ends with .Z (uppercase) instead it is compressed and you must use the uncompress command.
91. uucp - To copy a file to another computer
92. uudecode - To convert a uuencoded file back into its orginal form
93. uuencode - To disguise a program as a text file so that you can send it through electronic mail
94. vi - To run a powerful, but yucky, screen-oriented text editor.
95. vim - Is vi improved and is a much better and more powerful screen-oriented text editor than vi
96. wall - To display a message on-screnn to every single user on your entire computer. Use with care.
97. who - To tell you who else is using this computer.
98. whoami - Tells you the user you are currently using
99. write - To display a message on the screen of another user.
100. zcat - To uncompress a compressed file and send the results to standard output (usually the screen). Compressed files have names ending in .Z (uppercase)

No comments:

Post a Comment