commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
Find out which RPMs were installed on a particular date.
These would (naturally) include update RPMs.
This example shows searching for "Thu 05 Mar" (with grep).
Alternatively, pipe it to less so you can search inside less (with less's neat text highlighting of the search term):
rpm -qa --queryformat '%{installtime} \"%{vendor}\" %{name}-%{version}-%{release} %{installtime:date}\n' | less # (this example) search term: Thu 05 Mar
"play" is part of "SoX"
SoX - Sound eXchange, the Swiss Army knife of audio manipulation.
For details, see: man sox
At the start of a vi session and *before* saving any changes use ":!cp % %-" to make a backup of the current file being edited.
example: vi /data/some/long/path/file
:!cp% %-
creates /data/some/long/path/file-
Using the "#" in shell is surprisingly useful.
Some of the uses I found:
a) As a visible copy buffer in shell history (caveat: do not use for passwords :-)
b) To build complex commands until ready then hit the HOME, DEL, ENTER keys to run it
c) Placing reference data into shell history (search for tags with CTRL-R TAGNAME)
d) Putting aside a "work in progress" command to focus on another task (HOME # ENTER)
Low on disk space? Check the largest installed RPMs for delete canditates.
This command converts filenames with embedded spaces in the current directory replacing spaces with the underscore ("_") character.
NB when you run this gcal command in your shell, holidays are highlighted
but this highlighting does not show in the sample output (above).
To find full details on gcal options: gcal --long-help | less
Example for United States, Pennsylvania:
gcal -K -q US_PA 2009 # display holidays in USA/Pennsylvania for 2009 (with week numbers)
Example for Hong Kong:
gcal -K -q HK 2009 # display holidays in Hong Kong for 2009 (with week numbers)