touch
# touch FILE
mkdir
# mkdir DIR
rmdir
# rmdir DIR
rm -r
# rm -r DIR
diff
# diff FILE_1 FILE_2
cmp
# cmp FILE_1 FILE_2
comm
# comm FILE_1 FILE_2
gzip
gunzip
# gzip FILE
bzip2
# bzip2 FILE
file <file>
# file temp.txt
uniq
ulimit -a
cat
# cat FILE_1 FILE_2
paste
# paste FILE_1 FILE_2
umask
# override to FILE
cmd > FILE
# append to FILE
cmd >> FILE
cmd >& FILE
cmd &> FILE
redirect stdout and stderr to FILE
cmd < FILE
cmd <<< "string"
CMD_1 | CMD_2
CMD_1 ; CMD_2 ; CMD_3
CMD &
CMD_1 && CMD_2
CMD_1 || CMD_2
# show all signals
kill -L
kill -SIGKILL <PID>
kill -9 <PID>
pstree
kill
crontab
nice
write
mesg
telnet
ssh
ftp
!! # last command
ls # with a trailing space -> not in history
disown -a && exit # leave terminal but don't kill running processes
command &
fg # change to foreground
# pause with CTRL+Z
bg # sent it to background
# create
# -c create -v verbose -z gzip -f archivename
tar -cvzf archive.tar.gz directory
# extract
# -x extract -v verbose -f archivename -C directory
tar -xvf archive.tar.gz -C extracted
# create
zip -r archivename.zip directory
# extract
unzip archivename.zip -d extracted
grep -rni "pandoc" *
grep -rni "pandoc" ./**/Makefile # in specific file
# or use ripgrep https://github.com/BurntSushi/ripgrep
SERVICE=service_name.service
systemctl start $SERVICE
journalctl -u $SERVICE -f
df
df -h
# also know type of partition
df -Th
-T
:--print-type
-h
:--human-readable
du
or dust
cargo install du-dust
dust
# or
du -d 1 -h | sort -h
# start new "infinite" shell - read the manual for more info
# CTRL + A then "D" to leave
screen
# list screens shell
screen -ls
# resume screen shell
screen -r <screen_id>
Alternatives:
Args
-c
: colored output-j
: json output-j -p
: json indented output-d
: more informationCommand net-tools |
Command iproute2 |
Description |
---|---|---|
ifconfig -a |
ip addr |
Show IP address |
arp -a |
ip neigh |
Show ARP table |
route |
ip route |
Show network interfaces |
netstat -g |
ip maddress |
multicast |