Commands using kill (107)

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

a simple bash one-liner to create php file and call php function

One command line web server on port 80 using nc (netcat)
Very simple web server listening on port 80 will serve index.html file or whatever file you like pointing your browser at http://your-IP-address/index.html for example. If your web server is down for maintenance and you'd like to inform your visitors about it, quickly and easily, you just have to put into the index.html file the right HTML code and you are done! Of course you need to be root to run the command using port 80.

Instead of writing a multiline if/then/else/fi construct you can do that by one line
instead of writing: if [[ "$1" == "$2" ]]; then echo "$1 is equal $2" else echo "$1 differs from $2" fi do write: [[ "$1" == "$2" ]] && echo "$1 is equal $2" || echo "$1 differs from $2"

sort list of email addresses by domain.tld
email random list can be created here: https://www.randomlists.com/email-addresses

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"

Convert PDF to JPEG using Ghostscript
Converting your PDF file to JPEG images. You can set resolution by -r option (default: 72dpi).

Search command history on bash
Very handy and time-saving. Do a 'ctrl+ r' on command prompt. You will see a "(reverse-i-search)`':" mark. Just type any sub-string of the command you want to search(provided you have used it sometime in the same session). Keep on searching by repeatedly pressing ctrl+r. Press enter once you get the desired command string.

SHA256 signature sum check of file
get the SHA256 sum signatur for a file

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"

Upload images to omploader.org from the command line.
This function uploads images to http://omploader.org and then prints out the links to the file. Some coloring can also be added to the command with: $ompload() { curl -F file1=@"$1" http://omploader.org/upload|awk '/Info:|File:|Thumbnail:|BBCode:/{gsub(/


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: