Command Line Magic (climagic)
-
If the find command was like a web app, it would only have options for -mtime of 1 day, 1 week, 1 month and 1 year ago.
-
To clarify, the last one will return any aliases you have set as well. So command -v ls, might return the alias info you have for ls.
-
command -v cmd_name >/dev/null && echo "cmd_name is available on this system." # A way to check if a prog is available. Thx @mlafeldt
-
sup # New CLI e-mail client that is more like G-mail in that it uses tags, indexes all mail, has multiple buffers... http://bit.ly/wuuvGU
-
"A keystroke is worth a hundred mouse clicks, as any Unix user knows." -- sup FAQ
-
find . -name .htaccess | xargs egrep "(deny|allow) from.*\*" # Find .htaccess files where * is probably mistakenly used to wildcard domains.
-
zcat access_log.{12..1}.gz |cat - access_log|awk '$6~/POST/ {print $1}' |sort|uniq -c|sort -nr|head -10 # Show top 10 POSTers to website.
-
zcat access_log.{9..1}.gz |cat - access_log # Create a stream of logs starting with the oldest compressed to newest and combine with latest.
-
http://ur1.ca/86y16 # CLIMAGIC quick video: Using comments in the interactive shell.
-
freeram gigabytes # Example usage of previous function, it uses the units you give as the arg and return. Won't work for terabytes though.
-
freeram(){ U=${1:-m};U=${U:0:1};free -${U,,} |awk 'NR==3 {print $NF}' |tr -d $'\n' &&echo ${U^^}; } # "free" wrapper that can take unit args
-
http://bit.ly/atemyram # Reposting. In Linux, the last number on the buffers/cache line is the one you think of as free memory.
-
free -m | awk 'NR==3 {print $4}' # On Linux, show just the "free ram" (in megabytes) number that you care about. Thx @stradarius
-
Linux sex: date; unzip; strip; touch; mount; yes; etc.... Windows sex: start; explore; reboot; viruscheck; solitaire
-
awk {'print $3'} /var/log/httpd/access_log |sort |uniq -c |sort -rn |nl # Ranked list of HTTP AUTH users ordered by times logged in.
-
telnet "http://ur1.ca/02vxu" # Crowded at the movies tonight? Take your sweetheart to see Star Wars instead. Do it in IPv6.
-
for i in {1..12} $(grep ^ru <<<$LANG);do printf "\033[32m%10s{\033[31m@\n\033[0m"|tr " " =; done # ASCII bouquet, send today!
-
lsblk # List block devices (holders and slaves) ( requires util-linux >= 2.19) Thx @kbo
-
Do you really want to say everything to your computer out loud? Really? Or more importantly, do you want to hear others?
-
The function in the last post will make it so running cal with just one arg less than 13 will display that month in the current year.