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.
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:
Useful for situations where you have word lists or dictionaries that range from hundreds of megabytes to several gigabytes in size. Replace file.lst with your wordlist, replace 50000 with however many lines you want the resulting list to be in total. The result will be redirected to output.txt in the current working directory. It may be helpful to run wc -l file.lst to find out how many lines the word list is first, then divide that in half to figure out what value to put for the head -n part of the command.
Not perfect but working (at least on the project i wrote it ;) )
Specify what you want search in var search, then it grep the folder and show one result at a time.
Press enter and then it will show the next result.
It can work bad on result in the firsts lines, and it can be improved to allow to come back.
But in my case (a large project, i was checking if a value wasn't used withouth is corresponding const and the value is "1000" so there was a lot of result ...) it was perfect ;)
This does the same thing that the command 'j_melis' submitted, but does it a lot quicker.
That command takes 43 seconds to complete on my system, while the command I submitted takes 6 seconds.
Replace the head -1 with head -n that is the n-th item you want to go to.
Replace the head with tail, go to the last dir you listed.
You also can change the parameters of ls.
Specify the size in bytes using the 'c' option for the -size flag. The + sign reads as "bigger than". Then execute du on the list; sort in reverse mode and show the first 10 occurrences.
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 2 \___ These two lines are filtered by tail -n2,
Line 3 / This results in:
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.
Uses UNIX time for sorting.
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.
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.