Commands tagged ip address (118)

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

Quick way to sum every numbers in a file written line by line
If you have a file full of numbers written line by line, you can sum every line to get the total. With a file like this: 3443535 9878977 67554 987798 232324 you will got: 14610188

Speed up builds and scripts, remove duplicate entries in $PATH. Users scripts are oftern bad: PATH=/apath:$PATH type of thing cause diplicate.

Exit shell faster
Use ^D instead of exit. Also ^D ends input stream when you use terminal for typing into standard input.

Serve current directory tree at http://$HOSTNAME:8000/

Match a URL
For the record: I didn't build this. Just shared what I found that worked. Apologies to the original author! I decided I should fix the case where http://example.com is not matched for the next time I need this. So I read rfc1035 and formalized the host name regex. If anyone finds any more holes, please comment.

direct a single stream of input (ls) to multiple readers (grep & wc) without using temporary files

Strace all signals processes based on a name ( The processes already started... ) with bash built-in
Especially for sysadmins when they don't want to waste time to add -p flag on the N processes of a processname. In the old school, you did ; $ pgrep processname and typing strace -f -p 456 -p 678 -p 974... You can add -f argument to the function. That way, the function will deal with pgrep to match the command-line. Example : $ processname -f jrockit

quickly backup or copy a file with bash

Limit bandwidth usage by any program
Trickle is a voluntary, cooperative bandwidth shaper. it works entirely in userland and is very easy to use. The most simple application is to limit the bandwidth usage of programs.

function to verify an IP address - can be used at the shell prompt or in a shell script
When processing IP addresses in the shell (or shell script) it is useful to be able to verify that the value of data is an IP address (an not some random string or non-sensible IP address).


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: