One-liners: Difference between revisions

adds "Delete old stuff" section; better intro to X.org
Adds perl pie example
Line 1: Line 1:
Sometimes one-liners are so cool, you just want to remember them.  And good one-liners can also teach you the intricacies and features of the [[Bash]] shell.  Although there are better sites on the Internet for [http://www.bashoneliners.com/ finding one-liners], [http://www.catonmat.net/series/bash-one-liners-explained understanding one-liners] or [http://uni.xkcd.com/ playing on the command line], we'd still like to illustrate a few here.
Sometimes one-liners are so cool, you just want to remember them.  And good one-liners can also teach you the intricacies and features of the [[Bash]] shell.  Although there are better sites on the Internet for [http://www.bashoneliners.com/ finding one-liners], [http://www.catonmat.net/series/bash-one-liners-explained understanding one-liners] or [http://uni.xkcd.com/ playing on the command line], we'd still like to illustrate a few here.
== Perl edit ==
Sometimes you want to make a bunch of changes (substitutions) of the same text across multiple files.  Like changing a product name across multiple pages of documentation.  With a one-line perl command, you can do just that.  Furthermore, the example below uses a <code>ls</code> command to select which files to operate on -- giving you even more powerful control over your one-line edit.
<source lang="perl">
perl -p -i -e "s/lemons/lemonade/" $(/bin/ls my/life*)
</source>


== Free Memory ==
== Free Memory ==