All commands (14,187)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

List all symbolic links in current directory that matches regexp
Perl alternative to list symlinks with a clumsy regexp filter: place the regex instead of he example 'libxml' and end it with a wildchar to see the results (previous cd on dir). Is it possible change the '-l' test for '-d' and it will search for directories. [Same applies for -x and -X. See $(perldoc -f -x) for more tests]. I use it quite often when dealing with shared libraries...

rsync over ssh via non-default ssh port
tested on cygwin and Fedora 9 . good to remember for those jobs where you cannot set a site-specific connect option in your ~/.ssh/config file.

tar exclude files or directories
If you want to exclude only one file or directory you should use as --exclude=file_or_directory

List all installed PERL modules by CPAN
This command will give you the detailed information about the installed perl modules i.e. installed path, Link type, version, files etc.

copy/mkdir and automatically create parent directories
The --parents option will cause cp or mkdir to automatically create the parent directory structure. $mkdir --parents /one/two/three/dir will create /one, /one/two, and /one/two/three as needed before creating dir. cp will copy files with their full directory structure into the target directory with this option. Thanks to Peter Leung at: http://linuxcommando.blogspot.com/2007/11/use-of-parents-flag-in-mkdir-and-c.html which has good examples of usage.

notify brightness level [custom]
Brightness indicator to be used in scripts that adjust brightness [especially sys that doesn't support automatically]

Get your commandlinefu points (upvotes - downvotes)
This version prints current votes and commands for a user. Pass the user as an argument. While this technically "fits" as a one liner, it really is easier to look at as a shell script with extra whitespace. :)

Remove all but one specific file

backup all your commandlinefu.com favourites to a plaintext file
Usage: clfavs username password num_favourite_commands file_in_which_to_backup

Recursively grep thorugh directory for string in file.
-R, -r, --recursive Read all files under each directory, recursively; this is equivalent to the -d recurse option.


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: