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.
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:
You can actually do the same thing with a combination of head and tail. For example, in a file of four lines, if you just want the middle two lines:
head -n3 sample.txt | tail -n2
Line 1 --\
Line 2 } These three lines are selected by head -n3,
Line 3 --/ this feeds the following filtered list to tail:
Line 4
Line 1
Line 2 \___ These two lines are filtered by tail -n2,
Line 3 / This results in:
Line 2
Line 3
being printed to screen (or wherever you redirect it).
Uses history to get the last n+1 commands (since this command will appear as the most recent), then strips out the line number and this command using sed, and appends the commands to a file.
Just increase the 1 at the end if you want to generate more than one.
(Alternative to "| head -n N" you could use the -b flag of od: -b $[6*N]
this command will beep like an alarm for one minute from 18:57. you can change "1857" to your desired time.
you should have alsa-oss package installed, and you should also be root or part of "audio" group.
Work only with bash and apt-file installed.
When it found an unknow command, it will search for a file named "scribus" (in my example), in a folder named bin and then install the corresponding package.
After installation, it will run the command.
Usefull juste after reinstalling linux and missing lot of package.
Pros: the format is very simple, there is no need to show every columns, and full command with args
the first column is memory consumption %
the second column is pid
the third is just the command (without full arguments, most application's arguments are too long)
You can decide which application to kill then.
Prepending
env LC_CTYPE=C
fixes a problem with bad bytes in /dev/urandom on Mac OS X
This is a simple command which makes electricsheep render directly to your background
Will work with filenames with spaces inside. Will not break in case of someone making directory that matches *.pm. And sorts from largest. Where largest is file size, not line count.
Changed wget to curl and it doesn't create a file anymore.
Substitute that 724349691704 with an UPC of a CD you have at hand, and (hopefully) this oneliner should return the $Artist - $Title, querying discogs.com.
Yes, I know, all that head/tail/grep crap can be improved with a single sed command, feel free to send "patches" :D
Enjoy!
finger - gets logged in users
grep $(whoami) - greps only the current user (if there are more logged in)
head -n1 - just one line
awk '{print $2 " " $3}' - second and third word, seperated with a space (the users name)
OT: My first commandlinefu-command :)
* to get the English dictionary: wget http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt