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:
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.
Needs xxdiff installed, which looks a bit clunky but is an extremely powerful graphical diff.
There is no need to use the shell or construct. Screen offers varius ways of detaching and reattaching. man screen and look for -[rRdD].
to create a named session: sdr moo
resume: sdr moo
Sometimes I want to use the mouse to move/copy/delete files.
(I also sometimes feel like a nut, sometimes I don't.)
This is for Windows 2000 and later, probably.
Tested on Windows XP, cmd.exe.
You can convert a FAT or FAT32 volume to an NTFS volume without formatting the drive, though it is still a good idea to back up your data before you convert.
Tested on CentOS, Ubuntu, and MacOS.
This is useful for displaying a portion of a FILE that contains an error at line NUMBER
This will look through file and print the data in between the pattern matches. It's great for restoring tables from a mysqldump backup. You can then import it back into your database with:
mysql -u <user> -h <host> <database> < restored_table.sql
You should really use keys. Really. I'm serious.
But if you have to add your key, change password etc. for a long list of servers, this might help.
Change "santa+monica,ca" to your city name and state, or city name and country. In the USA, you can also use your zip code. In other countries, try using your postal code and country code.
dd for windows is available from http://www.chrysocome.net/dd
Tested with CD-ROMs like Linux install discs
I don't know about DVD-ROMs.
Same as 7272 but that one was too dangerous
so i added -P to prompt users to continue or cancel
Note the double space: "...^ii␣␣linux-image-2..."
Like 5813, but fixes two bugs: This leaves the meta-packages 'linux-headers-generic' and 'linux-image-generic' alone so that automatic upgrades work correctly in the future. Kernels newer than the currently running one are left alone (this can happen if you didn't reboot after installing a new kernel).
Perhaps a bit of a niche, but if you've even been frustrated by Oracles sqlplus command line tool for not supporting readline - have no fear. Socat is here to help you.
Shows a list of all installed cows saying a fortune. Also lists the cows names. Pic your favorite cow!
Needs cowsay, fortune and ruby installed. The path only applies to OS X with cowsay installed using homebrew. On Linux it might be /usr/share/cowsay/cows/ or similar. Uses ruby just because.
Replace 'sleep 10' with the command to wait for
to test android app
It's not better than the former, just another possible way.
Credits to whansard
The command finds all .mp3 files in all subfolders from where it's ran, catches its "relative path" and creates inside /new/path/ with the same "relative path".
PS: /new/path/ must exists
Use case: folder with flac files with tree structure ../artist/album/number-title.flac
1) convert flac->mp3 in the same folder: http://www.commandlinefu.com/commands/view/6341/convert-all-.flac-from-a-folder-subtree-in-192kb-mp3
2) search for mp3 files and recreate tree structure to another path: this command
3) move all mp3 files to that new folder: http://www.commandlinefu.com/commands/view/8854/move-mp3-files-to-another-path-with-existing-subtree-structure
As cp is often an alias to cp -i you can use \cp (or cp full path /bin/cp) to use the real cp command instead of its alias
Then, you can assign new accels to GTK menu actions pressing the keys while the option is active.
This command will remove only files, not directories: if you wish to remove both directories and files, just remove '-type f' from command above