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:
i've been writing a bash script where i needed to query the installed version number of the nvidia driver when it's not loaded. Unfortunately i have not found a easy way of doing this.
If i'm a stupid person, please enlighten me of a better way ;)
There's been a similar Futurama thing around for a while, which grabs a quote from the /. headers [curl -Ism3 slashdot.org | egrep "^X-(F|B|L)" | cut -d \- -f 2- | fmt -w $(tput cols)]. Same deal, but more likely to stop working when someone forgets to pay the bill on the domain. Until then: Cave Johnson!
cut -f1 -d\<TAB>
Removes all png files whose geometry is not 280x190 pixels
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.
you can also use cut instead of awk. less powerful but probably faster. ;)
Let's supose some moron used some m$ shit to commit to a later svnsynced repo. On a svn sync all his message logs cause a svnsync: Error setting property 'log': this commands finds all its contributions and fix all his commit logs
Just a simple way without the need of additional tools. Of course, replace eth0 with your IF.
Check disk quota for all user
substitute "example" with desired string;
tl = target language (en, fr, de, hu, ...);
you can leave sl parameter as-is (autodetection works fine)
Renames files eliminating suffix, in this case everything after "-" is cutted. Just change "-" with the character you need.
Nothing special about hashing here, only the use of cut, I think, could result at fewer keystrokes.
Newer versions of the flashplayer browser plugin delete the tmp flash video immediately after opening a filehandle to prevent the user from "exporting" the video by simply copying the /tmp/FlashXYZ file. This command searches such deleted flash videos and creates symbolic links to the opened filehandle with the same name as the deleted file.
This allows you to play your flash-videos (from e.g. youtube) with e.g. mplayer or copy the buffered video if you want to keep it.
This is a simple command which makes electricsheep render directly to your background
I can't put the last ^2 with seq, so I reverse it to delete the last +N. So for doing sum(N^2) you have to do sum((N+1)^2). Must be a better way.
Locate config files of the program. May not be used for interactive programs like vim.
less ressources (processes) needed
i use this after ripping internet radio streams to number the files as they originally played (even though streamripper can do this with -q).
to number other types of files, or all files, just change the *mp3. to rename directories only you could use
... ls -lt | grep ^d | cut -d ":" -f2 | cut -d " " -f2- | while read ...