List of commands you use most often

$ history | awk \'{a[$2]++}END{for(i in a){print a[i] \" \" i}}\' | sort -rn | head > /tmp/cmds | gnuplot -persist <(echo \'plot \"/tmp/cmds\" using 1:xticlabels(2) with boxes\') Plot your most used commands with gnuplot.

by David Winterbottom (codeinthehole.com)


URL: http://feedproxy.google.com/~r/Command-line-fu/~3/6MxHiSiINdo/list-of-commands-you-use-most-often

\"Enhanced

concatenate compressed and uncompressed logs

concatenate compressed and uncompressed logs

$ find /var/log/apache2 -name \'access.log*gz\' -exec zcat {} ; -or -name \'access.log*\' -exec cat {} ; This command allows you to stream your log files, including gziped files, into one stream which can be piped to awk or some other command for analysis.

Note: if your version of \’find\’ supports it, use:

find /var/log/apache2 -name \'access.log*gz\' -exec zcat {} + -or -name \'access.log*\' -exec cat {} +

by David Winterbottom (codeinthehole.com)


URL: http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs

\"Enhanced

Delete all files in a folder that don\’t match a certain file extension

$ rm !(*.foo|*.bar|*.baz)

Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like.

\"\"

by David Winterbottom (codeinthehole.com)

\"\"
\"\"

\"\"

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/TCRb2ku_V1Y/delete-all-files-in-a-folder-that-dont-match-a-certain-file-extension

\"Reblog