Skip to content

Instantly share code, notes, and snippets.

@Saajan
Last active April 23, 2021 19:08
Show Gist options
  • Select an option

  • Save Saajan/f1b753955c19d0681a0048be8a8d55c6 to your computer and use it in GitHub Desktop.

Select an option

Save Saajan/f1b753955c19d0681a0048be8a8d55c6 to your computer and use it in GitHub Desktop.

ZIP

zip -r directory.zip directory

ZIP WITHOUT ROOT FOLDER cd directory;zip -r ../directory.zip .

disk space in partition

df -h du -sh * ls -lrt lsblk

find

find / -name filename find / -type d -name folder

grep

grep term file grep term *

Compare 2 file diff file1 file2 sdiff file1 file2

Ram CPu

top free (-m) (-g) (-h) sar 1 3 cat /proc/cpuinfo cat /proc/meminfo

Connected User

lsof (-i) (-u)

network

ifconfig -a ip a dme tcpdump -i any -s0 ping (-c number) (host) ip link ip address traceroute dig (host) netstat (-l) (-antlpu)

SSH Login

sestatus iptable -l cd / var/log/audit ssh -vvv

Kill Process

ps aux ps -ef | grep name kill -9 psid

linux info

uname -a

help

man (-k)

packages

rpm (-qa) (-ql) repoquery (-l)

logs

journalctl (-xb) (-ef) (-p text) (-o verbose) (-u name) dmesg tail f /var/log/secure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment