Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* STORAGE / FILESYSTEM / MOUNTS / PERMISSIONS
- *********************************************/
- # Lists storage devices and mount points
- lsblk // aliased from 'lsblk -o NAME,SIZE,FSTYPE,LABEL,UUID,MOUNTPOINT'
- blkid // Useful to get partition UUID's
- # List files
- ls // aliased from ' ls++'; uses plugin
- lsl // aliased from '\ls --color=auto --group-directories-first -Ah'
- lsr // aliased from 'ls -ltr'; displays files by modification date
- # Lists mount points and used/available space
- df // aliased from 'df -h -P --total --exclude-type=devtmpfs 2>/dev/null'
- df -hPT // -T shows filesystem type
- # Disk usage and management
- ncdu
- # Lists all directories
- tree // aliased from 'tree -dA'
- tree -L 2 // as above but limits to 2 layers deep
- # Change ownership and permissions
- chmod
- sudo chmod -R 700 <foldername> // Require root to access folder
- chown
- chown -R <user>:<group> path/to/directory // Change owner of entire directory recursively
- # Display files and directories in current directory, from smallest to largest
- du // aliased from 'du -sm ./* | sort -n'
- # Kills process locking a file
- fuser -k <filename>
- /* SYSTEM MONITORING / STATISTICS
- ********************************/
- # Sysstat performance monitoring utilities
- sar // collects all system statistics
- sar 1 3 // prints stats every 1 second, does it 3 times
- iostat // CPU and IO stats
- mpstat // aliased from 'mpstat -P ALL'; CPU stats
- pidstat // Process ID stats
- pidstat -d <#> // Reports disk IO in intervals of '#' seconds
- # Displays system statistics in real time
- top
- htop
- # Displays uptime and users
- w
- # Displays tree of active processes
- pstree
- # Displays running processes
- ps
- ps aux | grep <processname> // Displays all running processes containing <processname>
- ps -u <username> // Show all processes by specific user
- cpuu // Process CPU Usage; from 'ps -eo pcpu,pid,user,args | sort -k 1 -r | head -10'
- /* BENCHMARKING
- **************/
- # Read 32GB's then toss it
- dd if=/dev/zero of=/dev/null bs=1M count=32768
- /* NETWORKING / SECURITY
- ***********************/
- # Display status of network interfaces
- ipa // all interfaces; aliased from 'ip address show scope global up'
- ip4 // ipv4 interfaces aliased from 'ip -4 address show scope global up'
- ip6 // ipv6 interfaces aliased from 'ip -6 address show scope global up'
- ipr // routing details aliased from 'ip -4 route show scope global'
- ip6r // ipv6 routing details aliased from 'ip -6 route show scope global'
- ifconfig // Also displays interface information
- ifconfig eth0 192.168.1.1 // Assigns an address to an interface
- ifconfig eth0:1 10.0.0.53 // Creates virtual interface linked to real interface
- ifconfig wlan1 up // Enables an interface ('eth0 down' disables eth0 interface)
- ip route get 8.8.8.8 // Easy way to find active interface quickly
- # Shows current active connections
- netconnections // aliased from 'netstat -tuapw --numeric-hosts --numeric-ports'
- # Gives current WAN IP address
- wanip // aliased from 'curl ipinfo.io/ip'
- # Test if local/network firewall blocks telnet; no output if network firewall block in place
- tcpdump host <ip of source>
- # Displays network statistics in real time
- iptraf-ng // Will require sudo/root
- # Displays firewall rules
- iptables -L
- # Network exploration tool and scanner
- nmap
- nmap -p80 192.168.1.0/24 // Scans range 192.168.1.0 - 192.168.1.255 for port 80
- nmap -sT -sU -T5 192.168.1.0/24 -p 1-1024 // Stealth TCP/UDP scan for first 1024 ports
- nmap -sP <LAN IP> // Shows all active IP addresses on LAN
- # Traceroute 2.0
- mtr
- # Calculates network assignments
- ipcalc
- # Shows program bandwidth use
- nethogs
- # Shows bandwidth use on an interface
- iftop
- # Lookup domains
- nslookup <www.address.com>
- nslookup <www.address.com> 8.8.8.8 // Does the domain lookup from google's public DNS
- # List network activity
- lsof -i // All activity
- lsof -i :80 // Only web processes using port 80
- lsof -P -i -n // Shows all applications using the internet
- # SSH through intermediary if host is unreachable from local network
- ssh -t <reachablehost> ssh <unreachablehost>
- /* SEARCHING / EDITING / REGULAR EXPRESSIONS
- *******************************************/
- # Outputs a column, where 'x' indicates the column number
- awk '{ print $x }'
- # Case insensitive recursive search through files from current directory for <string> and prints line number
- grep -iTrn <string> *
- # Escape aliases to run regular command
- \<command> // Yeah it's that easy.
- /* FUN
- *****/
- # Cow tells you something in pretty colors
- moo // aliased from 'fortune | cowsay | lolcat'
- # Does a matrix thing
- cmatrix
- # Prints system info with image
- neofetch
- # Makes a choo choo train
- sl
- # Terminal Calculator, can do conversions, too
- calc // aliased from 'qalc' because q is awkward to type
- # Accounting tool
- ledger
- # hackernews / y-combinator in the terminal
- haxor-news
- hn top // Shows top stories, other options available
- hn view <#> -c // Use this to view comments, replace '#' with the story number
- # Display weather forecast
- wttr.in
- # Prints your most commonly used commands
- history | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
- # Hexadecimal dump of /dev/urandom
- hexdump -C /dev/urandom | grep 13\ 37 // grep highlights characters in the dump
- # Prints an infinite loop installation screen that does nothing
- j=0;while true; do let j=$j+1; for i in $(seq 0 20 100); do echo $i;sleep 1; done | dialog --gauge "Install part $j
- : `sed $(perl -e "print int rand(99999)")"q;d" /usr/share/dict/words`" 6 40;done
- # Opens firefox in a sandbox, whitelists custom homepage, and disowns it from the terminal
- firejail --whitelist=~/public/Homepage firefox & disown
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement