Fun aliases

tcsh is shown. You can usually just throw in an = for bash and similar shells. Aliases need to be on one line in a .aliases file or as set on the command line.

The current phase of the moon

alias moon 'perl -MAstro::MoonPhase -le "printf qq{The Moon is %.1f%% full},100*(phase)[1]"'

Fri Sep 12 20:14:58 PDT 2008
The Moon is 94.3% full

Convert HTML entities to numeric entities

alias he 'perl -MHTML::Entities -le "print HTML::Entities::encode_entities_numeric(decode_entities(+shift))"'

jinx@jasper[5]~>he ' '
jinx@jasper[6]~>he '©'

Correct CRLF line endings to plain line feed

Warning! Edits plain text files in place. If you run this on a binary file like a Word doc or an image, you are going to corrupt your file.

alias rnfix "perl -pi -e 's/\r\n?/\n/'"

jinx@jasper[8]~>rnfix myfile.txt

Setup your Perl module for distribution

alias buildit "rm -f META.yml ; make clean; rm -f MANIFEST; rm -f META.yml; make manifest ; perl Makefile.PL && make && make test; make manifest; make dist"

Some miscellaneous sanity savers

alias sl 'ls -laF'
alias to mail
alias mx 'chmod 755'
alias rm "rm -i"
alias cp "cp -i"
alias mv "mv -i"
alias x 'clear; echo "exiting..."; sleep 3; exit'
alias zipit 'gnutar czvpf'
alias unzipit 'gnutar xpfvz'

digg stumbleupon reddit Fark Technorati Faves
Your information (required) Name*

* Indicates required fields; email is used for validation and is not displayed on the site.

Your comment
Commenting on Fun aliases

Body is limited to ≈1,000 words. Paragraphs—but not line breaks—are automatically inserted. Valid XHTML is required. These are the allowed tags–

<a href=""></a> <br/> <acronym title=""></acronym> <abbr title=""></abbr> <code></code> <pre></pre> <tt></tt> <ins></ins> <del></del> <hr/> <cite></cite> <b></b> <i></i> <sup></sup> <sub></sub> <strong></strong> <em></em> <h1></h1> <h2></h2> <h3></h3> <q></q> <blockquote></blockquote>