networking commands:

python3 -m http.server port
ip a
ping
  • ping google.com - sends data packets to see if it responds or not. can also add -c packetnumber to specify how many packets to send
  • gping is a solid alternate to ping as well btw
  • dig
    • dig +short google.com
      • the short switch gives a short answer as the name suggests, just giving the ip addresses
  • netstat
    • tons of switches
    • -t shows TCP connections
    • -u shows UDP connections
    • -n skips DNS lookups so it just shows the ip addresses instead of the hostnames
  • tcpdump
    • tcpdump -i (interface such as eth0) -n
  • ifconfig and iwconfig (self explanatory)
  • traceroute to see route
  • nslookup to see dns lookup info
  • route to see routing table
  • cd shortcuts:
    • can do just / for root
    • can also do username to jump to home
  • ls
    • ls -lah
      • lists all files with linux file perms and stuff listed out including hidden files
      • the -h switch shows human readable sizes instead of bytes
    • ls -i
  • mkdir
    • mkdir -p path
      • -p makes parents directories as well if they dont exist
    • mkdir -p /dirname{1..9}
  • cp
    • cp -r /source /destination
      • -r lets you copy subdirectories and stuff as well
  • find
    • find /path -name "filename"
    • theres other switches as well. like -type as well
    • -iname ignores case sensitivity
  • find
    • finds shit from a db of saved paths
    • needs the database to be updated to find new stuff
      • do updatedb to update the database
  • grep
    • grep -r "text" /path
      • -r searches through subdirectories
      • -E lets you specify other notations in the query string
  • cat and less
    • use less for longer files
    • cat file1 file2 > combined.txt
      • can do this as well to combine files :D
    • cat /etc/update-motd.d/00-header

file stuff and STROPS (STRing OPerationS):

file stuff:

  • touch to create files
    • touch filename{1..20} creates 20 files with indexes
  • nano or vim or mousepad or code to use as an editor
  • echo
    • can be used with > or >> or other stuff with pipes n shit to do more advanced stuff. can do the same with cat as well
  • > to insert and >> to append
  • ln -s filename newfilename
  • head -5 filename
  • tail -5 filename
  • split -l 10
  • exiftool filename
    • to see metadata :D
  • strings filename
    • to see human readable stuff

STROPS

  • tr
    • cat grep.txt | tr -d '[a-zA-Z]' - delete stuff in the specified set
    • cat grep.txt | tr -s '[a-z]' '[A-Z]' - replace stuff. source set then replace set
  • awk - scripting lang for manipulating data and generating reports. no need to compile shit
    • awk '{print}' filename - cat alt
    • awk '/searchTerm/' filename - grep alt
    • awk '{print $1,$2}' filename - default field seperator is space. not doing a comma concatinates the feilds. field seperator can be specified with -F like below. include the NR variable with $0 to get row count
    • awk -F: '{print $1}' /etc/passwd
    • awk 'BEGIN{OFS=":"} {print $1,$2,$3} END{print "Total Rows= " NR}' filename
  • sed (stream editor)
    • sed -i 's/(the text you wanna replace)/(the text you wanna replace it with)/g' filename
      • -i edits the file in place
      • s stands for substitute
        • can specify the line number before s to specify which line number to apply the substitution to
      • g is global. basically applies the change to all occurrences
    • sed 'nd' filename
      • n specify the line you wanna delete like 2 if you wanna delete the 2nd line
      • d specifies that you wanna delete it
    • sed '/^$/d' file
      • removes empty lines
  • sort
    • sort filename -o filename
      • saves the sorted file into itself
    • can do -u to get unique lines as well
  • uniq
  • paste
    • paste -d: unames cpasses > newcreds
    • ls | paste - - - -

system commands

  • env to view all env variables
  • xdg-open filename
    • opens the file with the default application. quite handy if you ask me :D
  • service start/stop/restart
    • apache2 for webservers
  • jobs to see suspended jobs
  • fg %ID to foreground suspended jobs
  • bg %ID to background job
  • nohup to give a running process immortality hqhqhqhq
  • proc cpuinfo
  • du --time -d 1 . -h (ls alt)
  • stat
  • ps -ef
    • gives a snapshot of all processes in a detailed format
  • hostnamectl
  • lsb_release -a (can also check /etc/os-release)
  • run-parts /etc/update-motd.d/
    • tests what MOTD looks like without logging out
  • top, htop, bpytop :D
  • openssl passwd -6 --salt salt "PASSWORD"

other stuff:

  • passwd
    • changes the pass for the specified user
    • sudo passwd root
  • xfwm4
    • to troubleshoot UI tweaking
  • rm variants:
    • rm -r dirname
  • ill document tool installation with apt and pip later. i already have everything setup in my kali machine so im feeling kinda lazy. and ill look into pimpmykali later as well.
  • 192.168.10.0/30

fun stuff to try out:

(make sure to add /usr/games to PATH for commands to work)
cmatrix
  • wont be installed by default. install it with apt
rev filename
  • wont be installed by default either
  • basically revereses all the strings it can find in a file and outputs it xD or you can type in what you wanna reverse and enter to get the reversed string as well
cowsay string
  • ASCII cow says stuff
  • just like the other stuff, wont be installed by default
oneko
  • cute neko chasing the cursor (*^-^*)
sl
  • ls typo funi hqhqhq
rig
  • generates random identities
yes string
  • repeats a string infinitely or repeats y infinitely. can be piped into other commands to automate annoying confirmation dialogues and stuff
xeyes
  • eyes that follow the cursor :D
hollywood
  • emulates hollywood hacking scenes lol. install it with apt as well
cool-retro-term
  • self explanatory tbh :v
aafire -extended
  • installation: apt install libaa-bin
fortune
  • fortunes :D (pipe into cowsay if you want :3)
figlet string
`showfigfonts` to see figlet fonts
toilet string
  • ASCII banners of strings :3 (tip: pipe through lolcat to make rgb banners :D)
nyancat
  • :3
pipes -p 20 -r 0 -R
  • installation: apt install pipes-sh
espeak -a 200 skibidi -p 20 -s 20
  • goofy ahh terminal talking hqhqhq
asciiquarium
factor number
  • outputs the factors of the given number
for i in {1..12}; do for j in $(seq 1 $i); do echo -ne $iÃ$j=$((i*j))\\t;done; echo;done
  • multiplication table :D
:(){ :|: & };:
  • fork bomb :D
bb
  • bb
echo "awughwauhgoahoiwhi;thaoi;hfgoai;ghioaghfkajfkajwbfauwkbgaoiwgbaoiwgbaiowgbao'wbgiaowbgoaibgoiawbgo;awbgioabgoa;wgbao" | pv -qL 50
  • text typewriting effect
aview image.jpg
  • image to ASCII art :D
mplayer -vo aa movie.avi
  • watch a movie in ASCII :D
    • mplayer -vo caca $filename.mp4
pacman4console
  • exactly what it sounds like
curl parrot.live
  • parrot partyyyyyyyyyyyyyyyyyyyyyy
curl -L http://bit.ly/10hA8iC | bash
  • xD
telnet mapscii.me
  • ascii map :D
LC_ALL=C tr -c "[:digit:]" " " < /dev/urandom | dd cbs=$COLUMNS conv=unblock | GREP_COLOR="1;32" grep --color "[^ ]"
  • random numbers all over the terminal
echo -e "1"; while $t; do for i in `seq 1 30`;do r="$[($RANDOM % 2)]";h="$[($RANDOM % 4)]";if [ $h -eq 1 ]; then v="0 $r";else v="1 $r";fi;v2="$v2 $v";done;echo -e $v2;v2="";done;
  • binary spam from 2013. similar to modern day cmatrix but way more primitive
while (true) do echo -n "balls"; done