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

change up n directories
Change n directories up, without parameters change one up

Manipulate the metadata and edit the create time (This will change date to 1986:11:05 12:00 - Date: 1986 5th November, Time: 12.00) and then it will set modify date to the same as alldate.

Rename files in batch

Run a command when a file is changed

Getting ESP and EIP addresses from running processes
'ps' let you specify the format that you want to see on the output.

Turn shell tracing and verbosity (set -xv) on/off with 1 command!
Turn shell tracing and verbosity (set -xv) on/off in any Bourne-type shell If either -x or -v is set, the function turns them both off. If neither is on, both are turned on.

Watch the progress of 'dd'
The 'dd' command doesn't provide a progress when writing data. So, sending the "USR1" signal to the process will spit out its progress as it writes data. This command is superior to others on the site, as it doesn't require you to previously know the PID of the dd command.

Quick notepad
Quick write some notes to a file with cat. Ctrl+C when you have finish.

Calculates the number of physical cores considering HyperThreading in AWK
Check whether hyperthreading is enabled or not. a better solution as nproc should work on all OS with awk

Running scripts after a reboot for non-root users .
Sometimes we may want to run a script when a system reboots . We can simply do this by just scheduling the script using vixie cron with the @reboot option . e.g @reboot I use it to send me an alert message on our prod hosts to send an alert message when the system reboots . @reboot zaman uptime | echo `uptime` | mail -s "`uname -n` got rebooted" me@myhost.com


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: