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:
Converts red-cyan 3D anaglyphs to side-by-side format viewable by crossing your eyes. Useful for people who don't have 3D glasses or prefer not to use one.
Using PHP shell to URL decode a string.
Note that in the command N is, for instance, 37.
This will search for "string" in all files under the given path "." and provide a listing of the files with their relative locations.
Saves all the "cut" hacks
This will recursively add files/directories in SVN.
Notice: It might not work properly, and not all files could get added.
Since there is a limit on characters, I couldn't add failure/success notices.
If you want failure/success notices, download Terminal Enhancements (http://tenhancements.tk/ )
It is included on Base Features
'booklet' is the name they'll give it in fineprint windows alternative. It's a postscript file prepared to be printed dual side, one page per sheet, and, once finished you can place staples in the middle of the print, fold, and read it like a book.
All Linux Systems I try also have an empty line per cpu in /proc/cpuinfo... little shorter then...
This one line Perl script will display the smallest to the largest files sizes in all directories on a server.
Full output in one single git command, no pipes nor other process invocations.
Will also work under cmd on Windows, with MSysGit, and can be aliased, simply add
branch-rel = "for-each-ref --sort=-committerdate --format='%1B[32m%(committerdate:iso8601) %1B[34m%(committerdate:relative) %1B[0;m%(refname:short)' refs/heads/"
to your .gitconfig file.
Recursively list all files in the current directory & get their md5sum, even if the filename has bad characters.
Edit the YOURPROJECTHERE and YOURPACKAGEHERE and you're done.
This is pretty simple but every time I forget how to do it, so let's stick it here.
Requires ImageMagick to be installed; mogrify is the lesser-known sibling to convert -- it overwrites your original images, but allows you to work on batches of files without resorting to a loop.
I use this on Debian to rename files that exist in directories but do not have the year in the file name. The directory has the year but the files inside don't.
How I explain how this runs:
The dir variable grabs the name of the folder.
Using rename, substitute the name of the first file and remove the extension, then rename it to the directory name.
To test this before you run it, change -v to -vn.
The first version printed:
tr: empty string2
The second version printed:
sed: -i may not be used with stdin
Maybe I misunderstood the orginal problem.
This is the command to configure "cobbler reposync" to use a specific proxy setting to mirror locally the content of a specific remote repository.
This mapping function is called RANDOM bash and enter a number between 1 and 100
This is a different version from my original command: Console clock -- Beautiful (http://www.commandlinefu.com/commands/view/7902/console-clock-beautiful )
This one uses Boxes and Figlet.
To install the dependencies on Ubuntu, type in:
sudo apt-get install boxes figlet
To install the dependencies on Debian, type in:
aptitude install boxes figlet