makeuseof.com
Unix/Linux Command Reference
File commands
is Directoy isting
kal Farmattac isting with hidden fles
cdi Change directory to cir
cd Change to home
pwd Show current directory
mea ar Create o arectory ar
mile Delete fle
m-rdr Delete directory dr
rm fle Force remove fre
mtr For temove drectory dr
pile! fie2_ Copy fie! to fie2
cp-fdirl di2— Copy dir! to di: create di tit doesn't ext
mtg! lez Rename or move fie! to the2. It ted 2s an
existing drectory, moves fle1 into directory file2
In-sfileink Create symbolic ink ink to fle
touch fle Croste or update fio,
cat> file Places standard input into fle
more file Output the contents of fle
eos fle Output the fest 10 ines of fle
tail fle Output the last 10 lines of fle
taille Output the contents of fle osit grows,
starting with the last 10 nes
Process Management
ps splay all curently active processes
Top display all running processes
al pa Kil process a pia
kill proc kil all processes named proc*
bo Ists stopped or background jobs: resume a
stopped jah in tha nackornine
fg Brings the most recent job to the foreground
fg0 brings job ato the foreground
File Permissions J]
chmod octal fie change the permissions of fle to octal,
which con be found separately for user,
‘group, and world by adcing:
*4=tead (1)
write (Ww)
+ | execute (x)
Examples:
‘chmod 777-read, write, execute for al
‘chmod 755 rx for owner, 1x Tor group and
‘world. For more options, see man chmod,
a
connect fo host as user
‘connect fo host on port port as user
‘add your key to host for user 10
enable a keyed or passwordless login
ssh user@host
ssh-p port user@host
ssh-copyd user@host
Searching J
Sten es search tor pattem in ties
Seco eateneh search recusivaly fr att nt
anion Search for pattem in te output of command
Eommand | grep pattem sre ingtancer of fle
System Info
dote show the current date and time
cal show this month's calender
uptime show curent uptime
w display who is online
whoami who you are logged in as
finger user ‘splay information about user
uname -o show kernel information
{cpu information
Cat fproc /cpuinto
‘memory information
Cat /proe /meminfo
man command show the manual for command
at show disk usage
ou. show directory space usage
free show memory and swap usage
Whereis app show possible locations of app
which app show which opp willbe run by default
Compression
tar ef fle.tar fles create c tar named fle.tar containing fles
tars fie.tor ‘extract the fies from fle.tor
faredffilefarge fies creote c tar with Gz compression
torvat fle.tor.ge extract a fer using Gzip
for ¢ffle-torb22 create c tar with Bzip2 compression
ex if fe tar.b2 extract a ter using Baip2
axip fle ‘compresses fle and reniamesit to fle.gz
gap -dfle.ge decompresses fle.gz back to fle
Network |
ping host ping host and output resus
‘whois domain {get whois information for domain
dig domain {get DNS information for domain
dig host reverse lookup host
wget fle download fe
wget le continue a stopped download
Installation }
Install from source:
[configure
make
‘make instal
dpkg -i pkg.deb install « package (Debian)
tpm -Uvh pkgspm _ install a package (RPM)
Shortcuts }
Circ halts the current command
Cinlt7 stops the current command, resume with fg in the
foreground or bg in the background
Cin+D og out of current session, similar to exit
CintW erases one word in the current line
CinitU erases the wnole line
Cine type to bring up a recent command
y repeats the last command
ex? logoul of current session
. use with extreme cautioniiakeuseof.com
Did you like this CheatSheet? Then why not visit MakeUseOf.com
for daily posts on cool websites, free software and internet tips.
lf you want more great CheatSheets and MakeUseOf
Guides join using the link below.
http://www.makeuseof.com/pages/
Over 50 free, Downlodable, PDF Guides
Download SO+ MakeUseOf Guides on a wide range of subjects.
More than a milion downloads so far. ll free. Enjoy and share!
Get printable cheat sheets and shortcuts for your favorite
programs and sites. These cheat sheets will make you more
productive!