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:
Note that this will not work with files with spaces or characters that need to be escaped. Feel free to leave any comments to improve upon this command, and I'll add it in.
Thanks!
Suppose that you had change in a directory like /home/user/mycode/code, and now you need to list it, instead of type entire path again, use ls !$ to recall path and list. Useful with many commands, this is only an example. (In this case, same result can be achivied with ls .)
Remove blank lines from files, even if some of the lines have whitespace (spaces, tabs, etc.). Also creates a .bak copy of the original file. Works on Mac also.
Thanks to those all those who left comments.
That will open vi with the four README files in different viewports.
Specially handy when you find there is only one file matching your pattern and you don't want to specify the full path.
Add this to .bashrc, then you can quickly create backups from files on current directory, but it only backups files on current directory.
useful when changing config files, coding something or just trying something stupid.
Adds the stdout (standard output) to the beginning of logfile.txt. Change "command" to whatever command you like, such as 'ls' or 'date', etc. It does this by adding the output to a temporary file, then adding the previous contents of logfile.txt to the temp file, then copying the new contents back to the logfile.txt and removing the temp file.
It will return a ranked list of your most commonly-entered commands using your command history
Remove all hidden files in a directory excluding current dir . and parent dir .. with .??* that means files with at least two characters.
If you don't want to commit files to subversion, and don't want those file to show up when doing an "svn stat", this command is what you need
Replace "en1" with your network interface (on OS X, usually en0, en1, eth0, etc..)
This will merge all of the changes from {rev_num} to head on the branch to the current working directory
After seeing the command you wish to repeat, just invoke it using the ! syntax.
ncal -e shows the date of Easter this year. ncal -e YYYY shows the date of Easter in a given year. ncal -o works the same way, but for Orthodox dates.