Command Line Magic (climagic)
-
mv -v www.example.com{,-oldsite} && mv -v {dev,www}.example.com # Swap out the old website and replace with the dev site in one move.
-
exec -a vim nethack # Now if your boss runs ps aux on your system, they will think you're working, not playing a game.
-
exec su - $USER # Restart your login again with same $SHLVL in place. Allows new group assignments to take effect.
-
!tar:p # Print out the last tar command used in your history. Then type !tar to run it again.
-
sshfs user@remotehost:/remotedir mydir # sshfs is a nice util that uses FUSE and SSH to mount a remote directory as a local one.
-
777 are great numbers in Vegas, but horrible numbers on your files and directories.
-
http://ur1.ca/dy9i0 # A site that performs static analysis of your shell code and shows warnings and errors inline. Thx @kultapanda
-
egrep -v "^#|^$" httpd.conf # display the httpd.conf file contents and exclude blank lines and lines that start with comment character.
-
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