
Linux Unix Command
login Access computer; start interactive session Syntax: login [username]
logout Exits the current session Syntax: logout
shutdown Shuts down your Linux system in a way that prevents damage to the file system Syntax: shutdown [options] time [message] Options -f reboots quickly without checking the filesystem
su Creates a new shell session with a different user id and privileges Syntax: su [username]
tty Displays the number of terminal devices that are currently in use Syntax: tty
cal Displays a calendar of the current year Syntax: Cal [option][month][year] Options -j displays the calendar using Julian dates, with the days numbered from 1 sequentially to the end of the year -y Display a calendar for the entire year
date Displays the current date and time as traced by the system clock Syntax: date [option][date] Options -u displays the date and time in GMT format
hostname Displays the system’s network identification name (hostname) Syntax: hostname [option][hostname] Options -a displays the hostname alias
man Displays text only manual pages and is the quick way to get information of most of the utilities installed to the system. Syntax: man[options][section][title] Options -a list all the man pages that match the title
pwd This command shows the full path of the current directory Syntax: pwd
uname Provides the wealth of information about the system you are using i.e it returns the name of the OS Syntax: uname[option] Option -a all available information
uptime Displays the current time, The amount of time the system has been running in the current session users Displays the total number of users currently working in the current session who Displays the name of the users currently logged into the system. Syntax: Who[option] Options -h display column heading
whoami Displays the username of the user currently logged in to the terminal session bash Starts the bash shell. Syntax: Bash[option][filename] Options -c Read commands from the specified string
bg places the process in the background Syntax: bg[jobid]
env It displays or sets the specified variables. Syntax: env[option][variable=value][command] Options -u unset the specified variable
jobs Lists all running or suspended jobs Syntax: Jobs[option][jobid] Options -l list job Ids and Process ids
kill Terminates the specified process Syntax: kill[option][id] Options -l list the available signal names and numbers
killall kills all the processes Syntax: killall[option][name] Options -e Require an exact match of long names
ps Displays the list of running processes Syntax: Ps[option][sort key][output field] Options
suspend suspends a command Syntax: suspend
tee accepts output from the specified command and “splits” the output to the standard output Syntax: command|tee[option]filename Options -a Append to the file
cd Change the current directory Syntax: cd [directory|path name]
dir Lists the files in the current directory in case-sensitive,alphabetical order,using a columnar format. Syntax: dir [option][pattern] Options -1 list entries using one line for each filename
find This command searches the current directory for files with names that match the specified shell pattern. Syntax: find pattern
ls Lists the files in the current directory in case sensitive alphabetical order using a columnar format. Syntax: ls [option][pattern] Options -l Lists files in long listing format
chgrp Change the ownership of the specified file to the specified group. Syntax: chgrp [option] group file Options -c Display message only when changes are made
chmod changes the permission settings of the filename to the mode. Syntax: chmod [option] mode filename Options -c Display message only when changes are made
chown Change the ownership of the specified file to the specified user. Syntax: chown [option] user [.group] file Options -c Display message only when changes are made
cp copies one source file to the destination file Syntax: cp [option][source][destination] Options -a create archive copies of the files.
dd Copies the file and performs various conversations at the same time. Syntax: dd [option] Options bs specify the size of the input and output bit streams in bytes.
ln Creates a hard link to the specified target file. Syntax: ln [option] target [link name] Options -b make a backup copy
Mkdir Creates a specified directory. Syntax: mkdir [option] directory Options -m creates the directory with the specifie permissions.
mv renames or moves one source file to a destination file or moves multiple source file to a destination that must be an existing directory. Syntax: mv [option][source][destination] Options -b backup copy
Rm removes the specified file Syntax: rm [option] [file] Options -d unlink the directory even if it is non empty.
Rmdir removes the specified directory but only if it is empty. Syntax: rmdir[option] directory Options -p removes associated parent directory
Touch It changes the time of the last access or modification of the specified filename to the current time. Syntax: touch [option] filename Options -a changes the access time but no other times
Undelete restores files deleted earlier using safedelete command Syntax: undelete [option][filename] Options -i Displays information about the file
Wc Display line, word and character count for the specified filename. Syntax: wc [option][filename] Options -c Show the character count only
Df Displays the amount of disk space used and remaining on all mounted filesystems. Syntax: df [option] [filename] Options -a include all filesystems
Du Displays the amount of disk space used in the current directory. Syntax: du [option][filename] Options -a Show sizes of individual file
Fdisk Launches a menu driven program that partitions a hard disk Syntax: fdisk [option] device Options -l List the current partition table
Mount Attaches the device to the specified directory, which will serve as the filesystem’s mount point. Syntax: mount [option] device [directory] Options -a Mount all the filesystems listed in /etc/fstab, except those set to noauto
Cat Displays the specified filename on the standard output. Syntax: cat [option] [filename] Options -e Display control and non-printing characters
Cmp Compares the two specified files to determine whether any difference exist. Syntax: cmp [option] filename1 filename2 Options -l Print the Byte numbers of each difference and show the differing values
Cut Displays a range of characters from the specified filename. Syntax: cut [option][filename] Options -b output only the bytes specified by range
Grep Searches filename for lines that match a regular expression. Syntax: grep [option] regexp [filename] Options -a Display n lines of trailing context after matching lines
Sort Sorts the specified filename line by line in character order. Syntax: sort [option][filename] Options -b Ignore leading blanks
Uniq Removes duplicate lines from a sorted input file and writes to the output file. Syntax: Uniq [option][input file][output file] Options -c Prefix lines by the number of occurrences
PARAMETER EXPANSION A shell parameter is an entity that stores a value(which is null). Among the various types of shell parameters are variables. You can create your own variable. Besides this there are several Built in variables as well. How to create a variable? Name=value Create a variable called name and assign value to this variable. BUILT IN VARIABLES $BASH The location of bash
Standard Directory Structure Directory Purpose |
Click Here to download the above commands with detail |
C Examples |
Java Programs |




