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

print line and execute it in BASH
If script.sh contains only these two lines: $ uname -a $ whoami

Rename file to same name plus datestamp of last modification.
FILENAME=nohup.out mv -iv $FILENAME{,.$(stat -c %Y $FILENAME)} does it help ?

Display PHP files that directly instantiate a given class
This greps all PHP files for a given classname and displays both the file and the usage.

Collect a lot of icons from /usr/share/icons (may overwrite some, and complain a bit)
In other way of xargs, only with find -exec

full path listing in /directory/path/* of javascript files.
file listing in /directory/path/* of specific files such as javascript(js) .

shell function to make gnu info act like man.
For those who hate navigating info pages, a shell function which will dump the contents to stdout, then page it through less, thus acting like 'man'.

Show git branches by date - useful for showing active branches
Print out list of all branches with last commit date to the branch, including relative time since commit and color coding.

Find the package that installed a command

scan multiple log subdirectories for the latest log files and tail them

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)


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: