Linux Command Line Cheatsheet Page 2

ADVERTISEMENT

Process Management
tar -czf archive.tar.gz foo bar - Create archive.tar.gz from files
foo and bar, with Gzip compression
ps - Show snapshot of processes
tar -xzf archive.tar.gz - Extract a tar using Gzip
top - Show real time processes
kill pid - Kill process with id pid
tar -cjf archive.tar.bz2 foo bar - Create archive.tar.bz2 from
files foo and bar, using Bzip2 compression.
pkill name - Kill process with name name
tar -xjf archive.tar.bz2 – Extract a tar using Bzip2
killall name - Kill all processes with names beginning name
gzip file1 – Compress file1 and rename it to file1.gz
gzip -d file1.gz – Decompress file1.gz
Keyboard Shortcuts
Ctrl + Shift + c - Copy a highlighted text
SSH
Ctrl + Shift + v – Paste a copied text
ssh $USER@$HOST – Connect to $Host as $USER
Ctrl + z - Sleep program
Ctrl + c – Stop current command
ssh $USER@$HOST command - Run command on $HOST as
$USER
Ctrl + r – Start a search
Ctrl + u – Cut from start of line
ssh $USER@$HOST -p 1234 – Connect to $HOST as $USER
on port 1234
Ctrl + k – Cut to end of line
Ctrl + a – Go to start of line
scp file1 $USER@$HOST:file1 – Secure copy file1 from local
machine to file1 at remote $HOST
Ctrl + e – Go to end of line
scp $USER@$HOST:file1 file1– Secure copy file1 from remote
$HOST to file1 at local machine
Disk Space
df -h - Show free space on mounted filesystems
scp -r foo $USER@$HOST:/bar – Secure copy the folder foo
from local machine to the folder bar at remote $HOST
df -i - Show free inodes on mounted filesystems
du -h folder – Show file usage of each folder in folder
du -sh folder – Show the total file size of folder
Package Installation
dpkg -i package.deb - Install a deb package
fdisk -l - Show disks partitions sizes and types (run as root)
rpm -Uvh package.rpm – Install a rpm package
free – Show memory and swap usage
Do you like this cheat sheet?
Visit
for more useful tech tutorials, tips and tricks

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2