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:
Just waste some resources in a philosophical way
I make an extensive use of sudo, so I had to exclude the sudo part of the command history
ok I'm sure it's not pretty
Change HH:MM with your target time.
This is for a Debian/Ubuntu GNU system. You need bash (package bash), date (package coreutils) and toilet (package toilet). Install with:
# apt-get install bash coreutils toilet toilet-fonts
For a python project, sometimes I need to clean all the compiled python files. I have an alias 'rmpyc' to this command. This really saves me a lot of typing and hunting throughout the folders to delete those files.
this command searches for a keyword or an expression in a path and avoids versionned files
Enable 'sleep' function in Windows environment where this does not exist, although not exact in time. (there is a delay for each ping) This is a simple way to separate commands with a time-period.
A simple command to find the total number of subdirectories in current directory starting with specific name.
A different approach to the problem - maintain a small sorted list, print the largest as we go, then the top 10 at the end. I often find that the find and sort take a long time, and the large file might appear near the start of the find. By printing as we go, I get better feedback. The sort used in this will be much slower on perls older than 5.8.
The nl command lists the contents of a file where is each line is prefixed by a line number. For more information about this command, check out its man page. I tested under Mac OS X and Xubuntu 9.04
Restores the keyboard so your partner who expects the keys to correspond to what they're labelled can type (in qwerty).
The description of how the one-liner works is here at my blog:
If you don't save the rule set it won't be applied during a reboot
Convert text from lowercase to uppercase
The better alternative to #9756.
I don't think I'd ever use the original command, but this one was so bad I had to post this. Sorry.
1. $(ls) is dumb, and will give errors if you have an alias like "ls -Fs"
2. clear is better and more portable than reset state.
3. if you're interested in differences, then use diff, not cat.
mounts a samba share on a remote machine using a credentials file that can be in a file tht is not accessable by other users the file will look like:
best option i belive
tar command options:
-z : Uncompress the resulting archive with gzip command.
-x : Extract to disk from the archive.
-v : Produce verbose output i.e. show progress and file names while extracting files.
-f backup.tgz : Read the archive from the specified file called backup.tgz.
-C /tmp/data : Unpack/extract files in /tmp/data instead of the default current directory.
This is the alias command that I discussed in my prior release which you can add to your ~/.bashrc.
This command asks for the station name and then connects to somafm, Great for those who have linux home entertainment boxes and ssh enabled on them, just for the CLI fiends out there ( I know I'm one of them ;)
You can find future releases of this and many more scripts at the teachings of master denzuko - denzuko.co.cc.