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

Open Port Check
also could specify port number: lsof -ni TCP:80

Show (only) list of files changed by commit
Lists ONLY the files changed by the given HASH/HEAD/list of hashes, etc. The message, commit ID, author, etc. is not included

Remove all zero size files from current directory (not recursive)

autorun program when logon Windows XP

Ultra fast public IP address lookup using Cloudflare's 1.1.1.1

Limit the cpu usage of a process
Similar to `cpulimit`, although `prlimit` can be found shipped with recent util-linux. Example: limit CPU consumption to 10% for a math problem which ordinarily takes up 100% CPU: Before: $ bc -l

Indicates the position of my monitor buttons
I often need to change the brightness of my monitor. The symbols of the sensor buttons are not illuminated and on a black background .... invisible! Now i use osd_cat instead of a torch ;-)

see the TIME_WAIT and ESTABLISHED nums of the network
see the TIME_WAIT and ESTABLISHED nums of the network

Search $PATH for a command or something similar
Searches your $PATH for whatever you substitute for bash, though not sure if this will work if you substitute a different shell for bash!

PRINT LINE the width of screen or specified using any char including Colors, Escapes and metachars
One of the first functions programmers learn is how to print a line. This is my 100% bash builtin function to do it, which makes it as optimal as a function can be. The COLUMNS environment variable is also set by bash (including bash resetting its value when you resize your term) so its very efficient. I like pretty-output in my shells and have experimented with several ways to output a line the width of the screen using a minimal amount of code. This is like version 9,000 lol. This function is what I use, though when using colors or other terminal features I create separate functions that call this one, since this is the lowest level type of function. It might be better named printl(), but since I use it so much it's more optimal to have the name contain less chars (both for my programming and for the internal workings). If you do use terminal escapes this will reset to default. $ tput sgr0 For implementation ideas, check my http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html


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: