Tuesday, August 7, 2012

Basic UNIX Commands

Basic UNIX Commands

Here is a short list of basic UNIX commands. Remember that help via the man command is
available for each of these commands. Simply type man command at a UNIX shell prompt.

General Commands

cd Changes current working directory
cp Copies a file
history Lists previous commands
ln Creates a link
ls Lists contents of directory
mkdir Creates a new directory
mv Moves or renames files
pwd Prints current working directory name
rm Removes files and links
rmdir Removes a directory

Archiving

compress Reduces the size of a files/directories
tar Archives files and directories
uncompress Restores compressed files to their original form

Communications

finger Displays information about a user or users
sftp Securely transfers files
scp Securely copies files
mail Sends and receives electronic mail from local mailbox
rlogin Logs a user into a remote machine
ssh Securely connects a user to a remote machine
talk/ytalk Initiates a conversation with another user
who Lists users who are logged into the machine
whoami Prints current effective login ID

File Manipulation

apropos Locates commands by keyword
awk Scans and processes patterns
cat Concatenates files
cmp Compares two files
diff Displays differences between pairs of text files
find Finds files
grep, egrep, fgrep Searches a file for a pattern
head Gives first few lines of file
man Finds and displays information on UNIX commands and utilities
more, page, less Display text files page-by-page
sed Edits text from an input stream
tail Displays the last part of a file
troff Formats and typsets text

Process Control

bg Places a stopped process in the background
fg Places a stopped process in the foreground
jobs Gives a list of current processes created from this shell
kill Sends a signal to the specified process
ps Gives process status

Miscellaneous

cal Displays a simple text calendar
chmod Changes file permissions
clear Clears terminal screen
csh Invokes a shell (command interpreter) with C-like syntax
date Displays the date and time
du Summarizes disk usage
from Displays a list of messages in the account’s local mailbox
hostname Displays name of the current host system
script Makes a transcript of a terminal sessions
sh Invokes the Bourne shell
stty Sets and displays terminal options
tset Initializes a terminal
tty Gets terminal name
umask Sets/gets the default file permission mask
whatis Describes what a command is
whereis Locates a binary and/or manual page for program
which Locates a program file, including aliases and paths
tokens Shows the user’s AFS tokens
unlog Removes the user’s AFS tokens, disabling authenticated access to AFS files

0 comments:

Powered by Blogger.