You are on page 1of 1

Linux Command Cheat Sheet Share This Cheat Sheet

Basic commands File management File Utilities Memory & Processes


| Pipe (redirect) output nd search for a le tr -d translate or delete character free -m display free and used system
memory
sudo [command] run < command> in superuser ls -a -C -h list content of directory uniq -c -u report or omit repeated lines
mode killall stop all process by name
rm -r -f remove les and directory split -l split le into pieces
nohup [command] run < command> immune to sensors CPU temperature
hangup signal locate -i nd le, using updatedb(8) wc -w print newline, word, and byte
database counts for each le top display current processes, real
man [command] display help pages of time monitoring
< command> cp -a -R -i copy les or directory head -n output the rst part of les
kill -1 -9 send signal to process
[command] & run < command> and send task du -s disk usage cut -s remove section from le
to background service manage or run sysV init script
le -b -i identify the le type di -q le compare, line by line [start|stop|restart]
>> [leA] append to leA, preserving
existing contents mv -f -i move les or directory join -i join lines of two les on a ps aux display current processes,
common eld snapshot
> [leA] output to leA, overwriting grep, egrep, fgrep -i -v print lines matching pattern
contents more, less view le content, one page at a dmesg -k display system messages
time
echo -n display a line of text
sort -n sort lines in text le
xargs build command line from File compression
previous output comm -3 compare two sorted les, line Disk Utilities
tar xvfz create or extract .tar or .tgz by line
1>2& Redirect stdout to stderr les df -h, -i File system usage
cat -s concatenate les to the
fg %N go to task N gzip, gunzip, zcat create, extract or view .gz les standard output
mkfs -t -V create le system
jobs list task uuencode, uudecode create or extract .Z les tail -f output last part of the le
resize2fs update a lesystem, after
lvextend*
ctrl-z suspend current task zip, unzip -v create or extract .ZIP les
fsck -A -N le system check & repair
rpm create or extract .rpm les
Scripting pvcreate create physical volume
bzip2, bunzip2 create or extract .bz2 les
File permission awk, gawk pattern scanning mount -a -t mount a lesystem
rar create or extract .rar les
chmod -c -R chmod le read, write and tsh tiny shell fdisk -l edit disk partition
executable permission
"" anything within double quotes lvcreate create a logical volume
is unchanged except \ and $
touch -a -t modify (or create) le timestamp File Editor umount -f -v umount a lesystem
chown -c -R change le ownership '' anything within single quote is
ex basic editor unchanged
chgrp -c -R change le group permission
vi visual editor python "object-oriented programming
touch -a -t modify (or create) le language" Misc Commands
timestamp nano pico clone
bash GNU bourne-again SHell
view view le only pwd -P print current working directory
ksh korn shell
emacs extensible, customizable editor bc high precision calculator
php general-purpose scripting
Network sublime yet another text editor language expr evaluate expression

netstat -r -v print network information, sed stream editor csh, tcsh C shell cal print calender
routing and connections
pico simple editor perl Practical Extraction and Report export assign or remove environment
telnet user interface to the TELNET Language variable
protocol
source [le] load any functions le into the ` [command] backquote, execute command
tcpdump dump network trac Directory Utilities current shell, requires the le
to be executable date -d print formatted date
ssh -i openSSH client
mkdir create a directory $[variable] if set, access the variable
ping -c print routing packet trace to
host network rmdir remove a directory

Read the Blog Post


Compiled by Alvin Khoo bit.ly/Linux-Commands

You might also like