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

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"

display typedefs, structs, unions and functions provided by a header file
will display typedefs, structs, unions and functions declared in 'stdio.h'(checkout _IO_FILE structure). It will be helpful if we want to know what a particular header file will offer to us. Command 'cpp' is GNU's C Preprocessor.

connect via ssh using mac address
Instead of looking for the right ip address, just pick whatever address you like and set a static ip mapping.

Watch your freebox flux, through a other internet connection (for French users)
You can watch channels of your freebox, everywhere. With " vlc http://your-ip:12345 " on the client and ncurses vlc interface on the host. et voila

check open ports without netstat or lsof

Run the built in PHP-server in current folder
You must have PHP 5.4.0 or later to be able to run the built in server. This web server is designed for developmental purposes only, and should not be used in production. URI requests are served from the current working directory where PHP was started, unless the -t option is used to specify an explicit document root. If a URI request does not specify a file, then either index.php or index.html in the given directory are returned. If neither file exists, then a 404 response code is returned. If a PHP file is given on the command line when the web server is started it is treated as a "router" script. The script is run at the start of each HTTP request. If this script returns FALSE, then the requested resource is returned as-is. Otherwise the script's output is returned to the browser. Standard MIME types are returned for files with extensions: .css, .gif, .htm, .html, .jpe, .jpeg, .jpg, .js, .png, .svg, and .txt. The .htm and .svg extensions are recognized from PHP 5.4.4 onwards. More information here: http://php.net/manual/en/features.commandline.webserver.php

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"

Delete all files by extension
This is a correction to https://www.commandlinefu.com/commands/view/22134 Use `-name` instead of `-iname`, because case-sensitivity is probably important when we're dealing with filenames. It's true that extensions are often capitalised (e.g., "something.JPG"), so choose whatever's appropriate. However, what is appropriate is the quoting of the name pattern, so the shell doesn't expand it incorrectly. Finally, `-delete` is clearer.

whois surfing my web ?

Instant mirror from your laptop + webcam
Flips the y-axis to emulate a real mirror, uses low resolution for speed, this will also hide blemishes and the like :)


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: