Di bawah ini kelanjutan dari command line cheatsheet Part. 1.
System Commands
Command | Description |
---|---|
uname -a | Show system and kernel |
head -n1 /etc/issue | Show distribution |
date | Show system date |
uptime | Show system uptime |
whoami | Show your username |
w | Display who is online |
man command | Show manual for command |
mount | Show mounted filesystems |
mount -o loop cdrom.iso /mnt/dir | mount cdrom.iso at /mnt/dir |
cat /proc/partitions | Show all partitions registered on the system |
grep MemTotal /proc/meminfo | Show RAM total seen by the system |
grep "model name" /proc/cpuinfo | Show CPU(s) info lspci -tv - Show PCI info |
lsusb -tv | Show USB info |
!! | Repeat the last command |
exit | Log out of current session |
Process Management
Command | Description |
---|---|
ps | Show snapshot of processes |
top | Show real time processes |
kill pid | Kill process with id pid |
pkill name | Kill process with name name |
killall name | Kill all processes with names beginning name |
Keyboard Shortcuts
Command | Description |
---|---|
Ctrl + Shift + c | Copy a highlighted text |
Ctrl + c | Stop current command |
Ctrl + Shift + v | Paste a copied text |
Ctrl + r | Start a search |
Ctrl + u | Cut from start of line |
Ctrl + z | Sleep program |
Ctrl + k | Cut to end of line |
Ctrl + a | Go to start of line |
Ctrl + e | Go to end of line |
SSH
Command | Description |
---|---|
ssh $USER@$HOST | Connect to $Host as $USER |
ssh $USER@$HOST command | Run command on $HOST as $USER |
ssh $USER@$HOST -p 1234 | Connect to $HOST as $USER on port 1234 |
scp file1 $USER@$HOST:file1 | Secure copy file1 from local machine to file1 at remote $HOST |
scp $USER@$HOST:file1 file1 | Secure copy file1 from remote $HOST to file1 at local machine |
scp -r foo $USER@$HOST:/bar | Secure copy the folder foo from local machine to the folder bar at remote $HOST |
Package Installation
Command | Description |
---|---|
dpkg -i package.deb | Install a deb package |
rpm -Uvh package.rpm | Install a rpm package |
Disk Space
Command | Description |
---|---|
df -h | Show free space on mounted filesystems |
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 |
fdisk -l | Show disks partitions sizes and types (run as root) |
free | Show memory and swap usage |
Post A Reply