Sort last 1000 shell commands by popularity
history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
DZone Snippets > sikelianos > shell
12388 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
history 1000 | awk '{a[$2]++}END{for(i in a){print a[i] " " i}}' | sort -rn | head
echo -n '<Image width="16" height="16">data:image/xicon,' ; perl -ne 's/(.)/"%".unpack("H2",$1)/egs; print' ~/Desktop/favicon.ico ; echo '</Image>'
def subdirectories_of(path, options = {}) depth = options[:at_depth_of] || 1 Dir[File.join(path, * ["*"] * depth + [""])] end >> subdirectories_of("/var") => ["/var/agentx/", "/var/amavis/", "/var/at/", "/var/audit/", "/var/backups/", "/var/db/", "/var/empty/", "/var/folders/", ...] >> subdirectories_of("/var", :at_depth_of => 2) => ["/var/amavis/db/", "/var/amavis/tmp/", "/var/at/jobs/", "/var/at/spool/", "/var/at/tabs/", "/var/at/tmp/",
mysqldump -v --quick --single-transaction --all-databases -uroot > file.sql
# Snagged from http://softiesonrails.com/2007/7/11/upgrading-your-views-to-rails-2-0 for old in `find app/views -name *.rhtml`; do svn mv $old `dirname $old`/`basename $old .rhtml`.html.erb; done
defaults write com.apple.dock no-glass -boolean YES killall Dock
find . -type f ! -name "*xyz*"
find . -name '*.txt' -print0 |xargs -0 perl -pi -e 's/find/replace/g'
ls -a | wc -l You can also try ls -A (same as --almost-all) to list all dotfiles but . and ..
find . -name "xyz*" -exec bash -c "mv {} ./xyz-dir/" \;