Find your default gateway and print it directly output http://www.bilgisayarmatematik.com/ kerim@bayner.com Show Sample Output
I use this command, within a cron job, to kill XMMS after a certain amount of time. This command returns the PID used by XMMS, and gets passed to the kill command. Another alternative would be ps aux | grep xmms | grep -v grep | awk '{ print $2 }' | xargs kill
I used this to mass install a lot of perl stuff. Threw it together because I was feeling *especially* lazy. The 'perl' and the 'module' can be replaced with whatever you like.
This command is useful when you want to check your nic's mac address, if you're interested in your wireless interface, use its ID instead "eth". This command was tested under Ubuntu and Slackware GNU/Linux. Show Sample Output
BASH: Print shell variable into AWK
Linux specific, requires iproute2 (but most distros have that by default now)
I have some problems with gnome panel which does not load completely leaving me without the actual GUI. This commands helps to kill the gnome-panel process then it should be relaunch automatically.
Probably more trouble than its worth, but worked for the obscure need.
I make an extensive use of sudo, so I had to exclude the sudo part of the command history
kded --version return this Qt: 3.3.8b KDE: 3.5.10 KDE Daemon: $Id: kded.cpp 711061 2007-09-11 09:42:51Z tpatzig $ awk -F: ................. Awk Field separator NR == 2 ................. Register Number, second line {print $2} ............... second field sed 's/\s\+//g' .......... remove one space or more \s\+ changing by nothing Show Sample Output
This is a little trickier than finding the last Sunday, because you know the last Sunday is in the first position of the last line. The trick is to use the NF less than or equal to 7 so it picks up all the lines then grep out any empty lines. Show Sample Output
executed on SLES 11.2
Like i said, i havent test it yet, all becouse my internet its soo slow, if you try and works please share, also be nice to do it using the direct url link. Show Sample Output
This solution is similar to [1] except that it does not have any dependency on GNU Parallel. Also, it tries to minimize the impact on the running system (using ionice and nice). [1] http://www.commandlinefu.com/commands/view/7009/recompress-all-.gz-files-in-current-directory-using-bzip2-running-1-job-per-cpu-core-in-parallel
gets network ports only ones for the sshd service only logged in a specific user (changed for public posting) only in a specific localhost:port range not IPv6 Only the part of the response after the ":" character Only the part of the response before the 1st space Output is just the rssh port
-F, use , as field separator gsub() deletes all spaces for(){} loops over all input fields and print their index and value exit exit after first line Show Sample Output
Should run anywhere that Bash works.. Your mileage may vary. 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: