Basic Shell Commands
For detailed information on UNIX commands type “man command” where “command” is the command name you are looking for more info on.
Command | Description |
---|---|
apropos | Searches the man pages for a keyword you specify. The name of the man page is in the first column.
systemname.domain.pdx.edu> apropos floppy |
cat | This command will display the contents of a file.
|
cd | Use cd to Change Directories. NOTE: If directoryname is not in the current directory you must include the path.
|
chgrp | CHanges the GRouP a file belongs to.
|
chmod | This command allows either the owner of the file or the owner of the directory to CHange MODes (file permissions).
Modes:
|
clear | This command clears the screen.
|
cp | Use cp to CoPy files.
|
diff | This command can be used to look for DIFFerences between two files.
|
exit | If you initialize a new shell with a command like csh you can use the built-in shell function exit to quit the new shell.
|
find | This command will recursively descend the directory you specify to locate files.
|
grep | Use this command to search a file or standard out for a pattern (string) you specify.
|
groups | Use this command to show the groups a user belongs to.
|
gunzip | Use this command to uncompress a zipped file (zipped files have a .gz suffix).
|
gzip | Use this command to compress (zip) a file (when a file is zipped the .gz suffix is added automatically).
|
kill | Use this command to terminate runaway processes that you own (type the command ps to find your active processes and their PIDs – process identity numbers).
|
ln | Use this command to create a LiNk, which allows a file to be accessed by a different name. Links may be removed with the rm command.
|
logout | Use this built-in shell function to logout of your current login shell.
|
lpq | Shows the print queue of the printer you specify.
|
lpr | Use this command to print a file.
|
lprm | This command is used to remove a job from the print queue (use lpq to find the job number).
|
ls | This command ListS the contents of the directory. Add the -l option to view the “Long format,” which shows the mode (permissions), number of links, owner, group, size in bytes, time of last modification, and file or directory name.
|
man | Use the man command to view the complete MANual page or “man page” that you select by name.
|
mkdir | Use this command to MaKe a DIRectory.
|
more | Displays the contents of a file or standard out one page at a time. Press ‹Space› to go to the next page.
|
mv | Use this command to rename or MoVe a file to another directory.
|
ps | Shows information about processes. You can use the command shown below to see the full listing of every processes you have running, or just type ps to see the short listing of your active processes.
|
pwd | This command shows the full path of your Present Working Directory.
|
rm | ReMove files from a directory. You will not be able to recover a file that has been deleted!
|
rmdir | ReMove an empty DIRectory. You will not be able to recover a directory that has been deleted!
|
source | Reads commands from a file. For example, if you make changes to your .bashrc file and you don’t want to logout and then log back in for the changes to take effect, just source the file:
|
ssh | This program is a Secure SHell client. Use ssh to login to remote computers.
|
tar | Use this command to archive files or directories. This example will archive the directory directory_to_tar and all of it’s files and subdirectories to an archive called new_archive.tar :
This example will extract all of the files (and directories) from the archive named tarfile.tar into the directory called target_directory :
|
touch | Use this command to set the access and modification times of a file, or if the file named doesn’t exist, touch will create an new, empty file.
|
which | This built-in shell function shows you where a command or binary (executable), is located (i.e. “WHICH one” you are using).
|