Like the tiltle said, you can use an argument too ( the interface )
MyIps eth0
will show only the IP of this interface and the public IP
( tested with Linux )
You can add that function in ~/.bashrc, then
. ~/.bashrc
Now you are ready to call this function in all your terms...
Show Sample Output
If we have a csv like structure: 10,50,'something' And we wish to find all numbers that are bigger then 1 (or find a number that is bigger then 1 regardless of the structure), including numbers that start with 1 such as 10 and above. Show Sample Output
This command can be set as an alias in ~/.bashrc For example (in my case) I have : alias watchDl='while [ "$(ls $filePart)" != "" ]; do sleep 5; done; mpg123 /home/.../warning.mp3" ' Then I just need to - initialize filePart (e.g. filePart="*bigFile*rar.part") - launch watchDl
this command gives you the total number of memory usuage and open files by the perticuler PID. Show Sample Output
Requires display. Corrected version thanks to sputnick and eightmillion user.
need imagemagick package Show Sample Output
same thing as the other
If you are interested in interfaces other than eth0 you will need to change eth0 to your interface name. You could use this mammoth to nab the ip4 addresses of all your interfaces perl -e '@_=`ifconfig -a`; sort(@_); foreach(@_) { /(inet addr\:)(\d+.\d+.\d+.\d+ )/; $_=$2; @uniq=grep($_ ne $prev && (($prev) = $_), @_);} print join "\n",@uniq,"\n"; ' it seems silly to have all this code when the following will work fine ifconfig -a | grep "inet " | awk -F":" ' { print $2 } ' | cut -d " " -f1 Show Sample Output
Require ips and ipcalc Show Sample Output
Sniffing traffic on port 80 only the first 1500 bytes
ABBA would be more entertaining if they sang this.
Monitor with watch command and vmstat, memory usage Show Sample Output
grabs your local IP Address. Show Sample Output
Requires the date command. This also works with some other comics. Here's a bash script that displays daily Garfield, Id, and Andy Capp: http://putnamhill.net/cgi-bin/yahoo-comics.sh?ga,crwiz,crcap
You could subsitute javax.servlet for any namespace you need. Show Sample Output
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.
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
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: