Linux commandline tips 4: Difference between revisions

From www.ReeltoReel.nl Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 28: Line 28:


rpm -qa --queryformat "%{NAME} %{INSTALLTIME:date}\n" | grep "Nov 2015" # In RPM, determine which packages where installed in Nov 2015.
rpm -qa --queryformat "%{NAME} %{INSTALLTIME:date}\n" | grep "Nov 2015" # In RPM, determine which packages where installed in Nov 2015.
echo "wall \"hallo\"''| at 11:48 2016-02-27 # execute a command at a certain time and date

Revision as of 10:49, 26 February 2016

watch if a website changes:

while :;do curl -Ls "X\.com"|md5sum;sleep 5m;done|awk '{if(NR>1&&l!=$1){system("echo the site changed|mail -s NOTIFY you@isp\.net");};l=$1}'



ps ax -o state -o ppid | awk '$1=="Z"{print $2}' | xargs kill -9 # Kill all #zombies on the system.

ps aux |tail -n+2 |sort -nrk4 |head -$(($(tput lines)-1)) |cut -c 1-$(tput cols) # Display top RAM using processes.

ethtool -p eth0 # Blink eth0's LED so you can find it in the rat's next of server cables. Ctrl-C to stop.

find . -xdev -ls | sort -n -k 7 | tail -5 # Quickly find the largest 5 files in the CWD tree without crossing filesystem boundaries.

for f in *; do b=$(echo "$f" | tr '[A-Z]' '[a-z]'); mv "$f" "$b"; done # Lower case all files in a folder.

rpm -qf $( which lspci ) # Pass the output of which (showing path to lspci) into rpm's -qf, which tells you the pkg.

rename -v 's/^([0-9])_/0\1_/' *.flac # Rename all single leading digit flac files so that they have a padding 0 for easier sorting.

ps aux | awk '{if ($8=="Z") { print $2 }}'# On Linux, print out a list of the process IDs that are in the zombie state.

exiv2 -k -F rename *.jpg # Use the exiv2 EXIF program to rename your jpg files according to their exif date/time data.

curl http://wttr.in/castricum # see weatherforecast

finger amsterdam@graph.no

rpm -qa --queryformat "%{NAME} %{INSTALLTIME:date}\n" | grep "Nov 2015" # In RPM, determine which packages where installed in Nov 2015.

echo "wall \"hallo\"| at 11:48 2016-02-27 # execute a command at a certain time and date