This page is a collection of Unix commands that can be very useful, but are not neceally worth giving a whole page to, or putting on the main Unix page.
Code |
Output |
tab (key on keyboard)
By pressing tab when typing out a file name Unix will automatically complete the file name if it recognizes what you are typing. Although this is not full proof, this helps to save time
when you need to type out long file names many times. The user may also double tap tab after typing the beginning of a file name. This will bring up a list of all files that begin with those sets of
letters.
|

 |
up or down arrow (key on keyboard)
By pressing the up arrow the user is able to cycle through previous commands that were entered into the terminal. By pressing the down arrow the user can go forward in time of the
commands that were entered into the terminal. This is helpful if the desired command is passed by, by mistake.
|

 |
CTRL-C (keyboard)
This stops the current process, very useful when a mistake is made.
|

 |
CTRL-Z (keyboard)
Suspends the current foreground task. This is usually used as a last resort when Unix is stuck in a bad script and/or command.
|
 |
~ (keyboard)
This symbol is usually located above the tab key on the keyboard and the user usually has to press shift in order to use it. This symbol represents the user's home directory, in other
words it is a short cut to all your files.
|
 |
".", ".." and /
. represents the current directory, .. represents the directory directly above the one the user is currently in and / represents the root
directory.
|
 |
<
This tells the command line to take input from a file rather than the terminal. It is set up as such: COMMAND < FILE NOTE: The file will be created if the file does not already exist.
|
 |
>
Tells the command prompt to place the output of a command to a file. This WILL overwrite the file with the new data if there is already information in it. It is set up
as such: COMMAND > FILE. NOTE: The file will be created if the file does not already exist.
|
 |
>>
This appends the ouput of a command to a file. This means that if there was already information in the file, the output will be added to the end of the file after the
last line. It is set up as such: COMMAND >> FILE NOTE: The file will be created if the file does not already exist.
|
 |
2>
This places any errors produced by a command into a file. This WILL overwrite any information that was in the file. NOTE: The file will be created if the file does
not already exist.
|
 |
2>>
This appends the error messages produced by a command to the end of a file, in other words the errors will be added to the file without deleting the information that was already in the
file. It is set up as such: COMMAND 2>> FILE NOTE: The file will be created if the file does not already exist.
|
 |
COMMAND > FILE1 2> FILE2
This puts the output from a command into one file and the errors into another file. NOTE: The file will be created if the file does not already exist.
|
 |
>&
This allows the user to put both the output and the errors of a command into a file. It is set up as such: COMMAND >& FILE. NOTE: The file will be created if the file does not
already exist.
|
 |
|(pipe)
This allows you to take the output from one command and use it as input for another command. It is set up as such: COMMAND | COMMAND
|
 |
--help
This gives the user access to basic help and information about a Unix command. To access the help menu the user needs to enter COMMAND --help
|
 |
gzip, zip, or compress
Allows the user to compress a file. Any three of the commands can be set up as such: zip FILE
|
 |
tar command
This command will archive a directory into a file, or if the the file has already been tared (really just another form of compression) will expand the file. The command is set up as such: tar
FILE or DIRECTORY
|
No Example |
targz and untargz
targz packs, "packs" a directory, specified by the user, into an archive file with the extension .tgz. untargz will "unpack" a "packed" file that has
the .tgz extension and archive it into a directory. The command is set up as such: targz DIRECTORY and untargz ARCHIVEDFILE.tgz
|
No Example |
pico, nano, kwrite, gedit, kate, emacs, vim, and vi file editors
All text editors that allow the user to edit files. I personally like nano, but it is all user preference. It is noteworthy that emacs and vim are two of the most powerful editors in
unix.
|
No Example |
aspell -c and ispell (spell checks)
Both of these commands will check spelling inside of a text file.
|
No Example |
cc -g -Wall -o FILE FILE.c and gcc -g -Wall -o FILE FILE.c
Both of these commands will compile c coding and place it into an executable file.
|
No Example |
c++ -g -Wall -o FILE FILE.cxx and g++ -g -Wall -o FILE FILE.cxx
Both of these commands will compile C++ code and place it into an executable file.
|
No Example |
javac CLASSNAME.java
Compiles Java code in Unix.
|
No Example |
java CLASSNAME
Runs a Java program in Unix.
|
No Example |
ps
Lists the processes of the system.
|
No Example |
kill PROCESS
Stops a process as specified by the user, but some processes are able to resist this, thus will not be stoped.
|
No Example |
kill -9 PROCESS and kill. PROCESS
Both will kill the process that the user specfies, and these commands will kill the process no matter what.
|
No Example |
COMMAND&
This will run a command as specfied by the user in the background.
|
No Example |