Removing Grep or Awk from search results (example with PS)
Scenario we are looking for some support process and grep keeps showing up in the results, we want to get rid of that So here is the original way: ps auxwww |Read More…
Scenario we are looking for some support process and grep keeps showing up in the results, we want to get rid of that So here is the original way: ps auxwww |Read More…
Lets say you want to do some math like 3/5 or 1/2, etc (any float point math). You can do something like this echo 3 5 | awk '{print $1/$2}' The problemRead More…
watch_execve – FreeBSD – see processes being created In Linux you can use the following 2 articles/methods to monitor commands as they happen on any shell on your server (good for studyingRead More…
You can mount ntfs a couple of different ways in linux. Here is how you do it with ufsd or ntfs-3g. ufsd needs a kernel module installed. ntfs-3g can just be installedRead More…
Wait you thought Samba and SMB and CIFs are all the same thing? Well kind of. The are all part of the same protocol that allows file sharing, and gives you theRead More…
Login to Mysql (notice username and password touch the -u and -p argument) # mysql -uusername -ppassword mysql> SHOW databases; +——————–+ | Database | +——————–+ | information_schema | | mysql | |Read More…
Lets see what files are missing from packages that are partially installed. Note this will not work on packages that are not at least part way installed (they need to be listedRead More…
If you have binary programs or scripts generating files in /tmp and you want to grab them before they disappear, then use this script. You can copy them. If you copy themRead More…
Final: (PKG="linux"; dpkg -l | grep $PKG | awk '{print $2}' | xargs -I %% /bin/bash -c 'echo "—%%—-"; dpkg -L "%%" | xargs -I @@ /bin/bash -c "[[ -f '@@' ]]Read More…
Check for line endings with od (also you can use other hex tools with -c option – which is the Printable Characters format) od -c file DOS: \r \n (carriage return andRead More…