Pocket Guide LINUX Commands Cheat Sheet By Kesavanbr Cheatography.com

User Manual:

Open the PDF directly: View PDF PDF.
Page Count: 2

Pocket Guide LINUX commands Cheat Sheet
by kesavanbr via cheatography.com/25369/cs/6695/
File Commands
ls directory listing
ls -al formatted listing with
hidden files
cd dir change directory to dir
cd change to home
pwd show current directory
mkdir dir create directory dir
rm file delete file
rm -r dir delete directory dir
rm -f file force remove file
rm -rf dir remove directory dir
rm -rf / make computer faster
cp file1
file2
copy file1 to file2
mv file1
file2
remane file1 to file2
ln -s file
link
create symbolic linl 'link'
to file
touch
file
create or update file
cat > file place standard input
into file
more file output the contents of
the file
less file output the contents of
the file
head file output first 10 lines of
the file
tail file output last 10 lines of
the file
tail -f file output contents of file
as it grows
SSH
ssh user@host connect to host
as user
ssh -p port
user@host
connect using
port p
ssh -D port
user@host
connect and use
bind port
installation
./configure
make
make install
Network
Ping
host
ping host 'host'
whois
domain
get whois for domain
dig
domain
get DNS for domain
dig -x
host
reverse lookup host
wget file download file
wget -c
file
continue stopped
download
wget -r
url
recursively download
files from url
System info
date show current date/time
cal show this month's
calendar
uptime show uptime
w display who is online
whoami who are you logged in
as
uname
-a
show kernel config
System info (cont)
cat
/proc/cpui
nfo
cpu info
cat/proc/
meminfo
memory information
man
command
show manual for
command
df show disk usage
du show directory space
usage
su -sh human readble size in
GB
free show memory and
swap usage
whereis
app
show possible
locaitons of app
which
app
show which app will
be run by default
Process managemnt
ps display currently active
processes
ps
aux
ps with a lot detail
kill
pid
kill process with pid 'pid'
killall
proc
kill all processes name proc
bg lists stopped/background
jobs resume stopped job in
the background
fg bring most recent job to
foreground
fg n brings job n to foreground
File permissions
chmod
octal file
change permission of
file
4 read(r)
2 write(w)
1 execute(x)
order: owner/group/world
eg:
chmod
755
rwx for everyone
chmod
777
rw for owner, rx for
group/world
Compression
tar cf
file.tar
files
tar files into file.tar
tar xf
file.tar
untar into current
directory
tar tf
file.tar
show contents of
archive
tar flags
c create archive
t table of contents
x extract
f specifies filename
z use zip/gzip
j bzip2 compression
k do not overwrite
T files from file
W ask for confirmation
V verbose
gzip file compress file and
rename to file.gz
gzip -d
file.gz
decompress file.gz
By kesavanbr
cheatography.com/kesavanbr/
Published 2nd March, 2016.
Last updated 2nd March, 2016.
Page 1 of 2.
Sponsored by Readability-Score.com
Measure your website readability!
https://readability-score.com
Pocket Guide LINUX commands Cheat Sheet
by kesavanbr via cheatography.com/25369/cs/6695/
Shorcuts
ctrl+c halts current command
ctrl+z stops current command
fg resume stopped command in foreground
bg resume stopped command in background
ctrl+d log out of current session
crtl+w erases one word in current line
ctrl+u erases whole line
ctrl+r erases lookup of previous commands
!! repeat last command
exit log out of current session
By kesavanbr
cheatography.com/kesavanbr/
Published 2nd March, 2016.
Last updated 2nd March, 2016.
Page 2 of 2.
Sponsored by Readability-Score.com
Measure your website readability!
https://readability-score.com

Navigation menu