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

Get all these commands in a text file with description.
I tried out on my Mac, jot to generate sequence ( 0,25,50,..), you can use 'seq' if it is linux to generate numbers, need curl installed on the machine, then it rocks. @Satya

Uptime in minute
Want to run scripts/programs in the system after starting X minute [ For letting the system to free ]? This will give uptime in minute.

Get all these commands in a text file with description.
I tried out on my Mac, jot to generate sequence ( 0,25,50,..), you can use 'seq' if it is linux to generate numbers, need curl installed on the machine, then it rocks. @Satya

Most used command

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Install a basic FreeBSD system
Install a basic FreeBSD system on a distant server. I use this to install FreeBSD on servers that can only boot a Linux rescue system. This sytem loads on ram when booted, so it is possible to install freely. You can even install on ZFS root !

decoding Active Directory date format
When Ldapsearch queries an Active directory server, all the dates are shown using a timestamp of 18 digits. This perl regexp decodes them in a more human friendly notation. 11644473600 corresponds to some microsoft epoch.

File rotation without rename command
Rotates log files with "gz"-extension in a directory for 7 days and enumerates the number in file name. i.e.: logfile.1.gz > logfile.2.gz I needed this line due to the limitations on AIX Unix systems which do not ship with the rename command.

date offset calculations
The date command does offset calculations nicely, handles concepts like "a month" as you'd expect, and is good for offsets of at least 100M years in either direction.

Create a tar archive with all files of a certain type found in present dir and subdirs
Note: the tar archive must not exist in order to create it. If exists it will only be updated and no already existent files in present search will still remain in the tar archive. The update option has to be used instead of create because the command tar may be executed more than once depending on the number of arguments that find throws. You can see maximum number of arguments with 'getconf ARG_MAX'


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: