Command Line Magic (climagic)
-
paste <(cal 2013) <(cal 2014) # Look at the full year calendar for 2013 and 2014 side by side.
-
On that last one I should have clarified, it counts number of lines with URLs, not total URLs if there are more than one per line.
-
for f in * ; do l=$( grep http:// "$f" | wc -l ) ; echo "$l $f" ; done > urls-in-files-count.txt # Count number of URLs in each file.
-
o="";while [[ -z $o ]];do o=$(curl -s example\.com|grep 'Some text you are expecting eventually' );sleep 5m;done # Check website for text.
-
Unix Bands: The Whois, Ctrl-Z top, AC/DC++, Iron RAIDen, /bin/joevi, Dev Leopard, Run-BSD, The Piping Heads, YES (of course) #geekbandnames
-
mplayer -vo null pianoconcert.mp4 # Play just the audio track of a video by setting the video output to null.
-
ip addr show # And so can you! (Only if you're a Linux user though)
-
http://bit.ly/16kf7tU # @runmoore sent in his command line cheat sheet. Nice penguin. Share yours too and I'll forward good ones.
-
awk '/listinfo/{print $1}' mailman-access_log |egrep -v "(yourdomain\.com|^1.2.3.4)$"|sort|uniq # Who besides you has been visiting mailman
-
time cat # A simple stopwatch that works more universally. Use Ctrl-D to stop. Check elapsed or real time in output.
-
for d in /proc/[0-9]*; do echo $(< $d/oom_score) $(tr '\0' ' ' < $d/cmdline);done |sort -rn|head # Top Linux OOM score cmds. Thx @brimston3
-
http://bit.ly/x0j9Uz # A reminder since its still a problem. Don't use libvte based terms (gnome-terminal, Terminator and others) until read
-
OIFS=$IFS;IFS=$'\n';vim $( grep -l '$fill' *.pl );IFS=$OIFS # Edit the set of files that contain the variable $somevar.
-
rpm -qa --queryformat "%{BUILDHOST} %{NAME}\n"|awk '$1!~/(redhat\.com|fedoraproject\.org)$/' # List RPMs from unofficial repos. #redhat
-
wget mirror\.server/centos5.9/disc{2,4}of9.iso # Get disc 2 and 4 using brace expansion. Because they couldn't fit "basic stuff" on disc1.
-
zcat dump.sql.gz | sed -n '5000,7500p' > newdump.sql # Put lines 5000 through 7500 from a large compressed SQL file into a new file.
-
ps aux |grep vm1 |cut -c 1-$COLUMNS # ps sends full line when output is a pipe so you can grep past the line and then cut it to term width.
-
Don't you love it when you're watching some new documentary and all the scientists are using the command line for their work.
-
Eventually the developers will add every option for every purpose to every program and I'll be out of a job and Unix will be no fun.
-
df -Pl -t ext3 -t ext4 | tail -n+2 | awk '{ sum+=$3 } END { print sum/2**20 }' # Print disk space used on all ext3 or 4 FS in GiB.