Alphabetical Linux Commands

Linux Commands

Command

Action

< direct input from a file to a command
> direct output from a command to a file
>> append output from a command to a file
| redirect the standard output of one command to the standard input of another
; combine commands
\ escape the following special character
/ execute a script in the current directory
.. parent directory
~ alias for the home directory
$ variable prefix to reference its stored value
(Ctrl+C) kill a running process
(Ctrl+Z) suspend a running process
(Ctrl+D) End of Data marker
alias create a command alias
apt-get add or remove a package, update available list
aspell interactively check and correct spelling
awk match data in a file to a regular expression
basename print the final part of a file path
bg run a suspended job in the background
bunzip2 uncompress a file from zip format
bzip2 compress a file to zip format
cal display a month calendar
cat display the text content of one or more files
cd change working directory
chfn change personal finger information
chsh changing the login shell program
chgrp change the group ownership of a file
chmod change access permission of a file or directory for User, Group, and Others, where numerically Read = 4, Write = 2, and Execute = 1
chown change ownership of a file or directory
cksum print a CRC checksum number and byte count
clear remove previous output from the shell display
cmp compare text or binary files, byte by byte
comm compare text files, line by line
cp copy one or more files to another location
crontab run a recurring job at a specified time
csplit split a file around specified expressions to produce separate files named xx00, xx01, etc.
cut get text form a file by column or delimited field

-c option to specify a column number

-d option to specify a field delimiter

-f option to specify a field number

date display the date and time
dc open the command line desk calculator
df display file system free space
diff compare two text files, line by line
diff3 compare three text files, line by line
dir display directory contents
dircolors list color settings for the is command
dirname print the first part of a file path
du display disk usage of directories or files
echo display input on standard output
ed open a file in a line-oriented editor
egrep match a specified string or regular expression using an extended version of grep
eject open the cd/dvd drive tray

-t option closes an open tray

env display the environment variables
eval construct a command from arguments
exit quit the shell or logout
expad convert tabs to spaces writing standard output
export set an environment variable
expr evaluate an expression
factor display prime factors of a specific number
fdformat low-level floppy disk format
fdisk manipulate the hard disk driver partitions
fg run a suspended job in the forground
file determine the file type
find find a file in a specified hierarchy
finger display personal user information
fmt format paragraph text on standard output

-u option to provide uniform word spacing

fold wrap standard output text at a specified width
for perform a loop
free display free disk space in Mb units
fsck check and optionally repair file system
ftp interactive file transfer via File Transfer Protocol
grep match a specified string or regular expression
groups display group names to which a user belongs
groupadd create a new group

-f option to check if the group already exist

groupdel delete an existing group
groupmod change the name of an existing group
gunzip uncompress a file from gzip format
gzip compress a file to gzip format
hash list commands memorized in this shell session
head output the first lines of  a file

-n option to specify a different number of lines

history display a list of commands in this shell session
hostname display the name of the host computer
id display user and group id numbers
if perform a conditional test
ifconfig display the network interface configuration
init change the system run level

level 1 for maintenance console

level 5 for normal GUI desktop

info show help page for a command hit the Q key to return to a prompt
install copy files, setting ownership and permissions

-o option to specify ownership

jobs display the status of all jobs
kill terminate a job by number, or a process by PID
last display login history in chronological order
less display content, page by page use Page Up and Page Down keys to move hit the Q key to return to a prompt
in create a hard link to a file
login

logout

log in and out of a low-level shell
logname display the user’s login name
look display a list of words matching a given prefix
lpr send a file to the printer
lprm remove a print job from the printer queue
lpq display the print queue and printer status
ls list the contents of the current directory

-a option to include hidden files

-l option to include access permission

-t option to order the first list by time stamps

man show help page for a command hit the Q key to return to a prompt
md5sum produce an MD5 checksum number
mesg discover if your terminal write access in enabled
mkdir mount a file system
mt control magnetic tape drive
mv move or rename a file or directory
nice run a program with specific priority level, argument in range -20(high) to 20(low)
nl number lines of text in standard output
passwd change a user password
paste merge text as columns on standard ouput
ping test if remote host can be reached by sending small data packets and await response

-c to specify the number of pings

pr prepare text content for printing the default format provides a header with date, file path, page number, and 66-line pagination
printenv display the environment variables
printf print formatted string on standard output by substituting arguments of various data types
ps display the process status
pwd print working directory
rcp remotely copy files between two machines
read read lines from standard input
reboot shutdown then restart the system
renice change the priority level of a process PID that is already running with specific priority level argument in the range -20(high) to 20(low)
rm remove files or recursively delete directories
rmdir remove an empty directory – use the rm command to delete non-empty directories
rsync remotely copy files between machines
scp securely copy files between two hosts
sdiff side-by-side comparison on standard output indicating line difference between two files
sed match data in file to a regular expression
seq print a sequence of numbers in a given range
sftp secure file transfer via File Transfer Protocol
shopt display the shell behavior settings
shutdown halts the system at a specified time or reboots
sleep pause for a specified number of seconds
sort  display lines of text sorted alphabetically
split slit a file into pieces of a specified size
ssh secure shell login to a remote machine where you already have an account
stat switch user to root or to a specified username
sum print a checksum number and block count
suspend suspend the current shell

-returns to the user shell for a root shell

sync flush all file system buffers to disk
tac view the text content of one or more files, a reversed line order
tail output the last ten lines of a file

-n option to specify a different number of lines

tar create, update, or extract from a compressed tape archive file – also often gzipped
tee print to both standard output and a file
test evaluates a boolean expression and returns the result as true (0) or false (1)
time run a program and time its system resource use
times display the shell uptime and system uptime
touch create a new empty file or update the timestamp of an existing file
top list all processes running on the system
tr translate one set of characters to another
tty print the name of the terminal device associated with the current shell
type determine a command type
umask prints or sets the user mask value that determines permissions of new files created
unmount unmount a file system
unalias remove an alias
uname display system infomation

-a option to display all information

-n option to display the host name

-r option to display the kernel release

unexpand convert spaces to tabs writing standard output
uptime display system uptime
uniq discard all but one identical lines of input
unzip extract compressed files from a zip archive
usermod modify a user account
users list the name of users currently logged in
vdir verbosely display directory contents
vi launch the vi text editor
w display current processes for each logged in user
watch execute a command at regular intervals
wc display word count, line count, and byte count
wget download a web page and store a local copy
whereis list source and man locations of a command
which display the source file location of a program
whoami display the name of the current effective user
write send a message to another logged-in user
xcalc launch a graphical calculator from a shell window
zcat output compressed text on standard output
zip create a compressed archive in zip format

Leave a Reply