SYS ADMIN STUFF I suppose you could say that putting commands up here reveals which kind of system you are running but if you can't figure that out from other means you probably can't get in anyway. Also these are things that any sysadmin might need on various systems. Hopefully they will be helpful to those who need them. Zombie Processes: look for zombie processes ps -xua | grep -w Z ps -wuax| grep defunct |grep -v grep kill zombie processes (might need reboot) Look in the third column after ps -xua find the parent process and restart it. To see what your firewall has been doing with ipfw (freebsd): ipfw -cat list ipfw list I don't know why anyone would want their server on some timezone other than UTC, but if you do the command is: tzsetup for freebsd Sed is a very useful tool. Probably the most used and easiest command is as follows: to replace text in a file globally sed -i -e 's/searchfor/replacewith/g' filename sed on BSD does not like to escape a new line replacement This works: sed -i .bak '1s/^/newfirstline'$'\n''/g' under sh the the $\n is replaced before sed executes sed in BSD does not escape control characters sed in BSD also requires the extension after the -i dd is great for making images and backups block sizes of greater than 32k don't seem to make too much of a speed difference. dd -if=/dev/sdx -of=[backupfilename] -bs=64K status=progress floating point calculations in shell sh and bash do not do floating point calculations. so you have to send your calculations to bc (basic calc) () [] (()) in shell script [] is a boolean expansion ((xxxxx)) is a mathematical expansion. $() dereferences the variable and returns the value SSH ssh-keygen -t ed25519 on your local machine ssh-copy-id login@address on your local machine. or scp the public key to the server into the .ssh directory. then cat the public key into the authorized keys file. cat ed25519.pub >> authorized_keys STRIP HTML from a file This is a very useful little sed script: However, if you have multiline html it misses it. each tag must exist on a single line (it is sed afterall) sed 's/<[^>]*>//g ; /^$/d' htmlpage.html > htmlpage.txt BATCH rename files ls | grep \.JPG$ | sed 'p;s/\.JPG/\.jpg/' | xargs -n2 mv How to convert HEIC files to jpg apt install libheif-examples find . -iname "*.heic" -exec heif-convert -q 100 {} {}.jpg \; for f in *.HEIC; do heif-convert -q 100 $f $f.jpg; done Bash and Echo when putting line feeds in a variable and sending them to echo: 1 you can't just put \n in the string "hello \n there" it must be "hello"$'\n'"there" 2 using a variable, i.e. myvar="hello"$'\n'"there";echo $myvar but ooops that does not work it removes the line feed when bash dereferences the variable before passing it to echo. so you must use double quotes ie echo "$myvar" to keep the line feed