This is a command that I find myself using all the time. It works like regular grep, but returns the paragraph containing the search pattern instead of just the line. It operates on files or standard input.
grepp <PATTERN> <FILE>
or
<SOMECOMMAND> | grepp <PATTERN>
Show Sample Output
Examples:
The following will take frames starting at 15.2 seconds for a total of 45.9 seconds:
mencoder -ss 15.2 -endpos 30.7 -oac copy -ovc copy mymovie.avi -o myeditedmovie.avi
Keep in mind -endpos is the total time, i.e. the output video in this is 3 minutes 3 seconds in length:
mencoder -ss 1 minute -endpos 2 minutes 3 seconds -oac copy -ovc copy mymovie.avi -o myeditedmovie.avi
A way not so simple but functional for print the command for the process that's listening a specific port.
I got the pid from lsof because I think it's more portable but can be used netstat
netstat -tlnp
Show Sample Output
Changes pidgin status using its dbus interface. The status code can be obtained using command #4543.
Returns code of current status of pidgin accounts via dbus interface Show Sample Output
For KDE 4.2.* with plasma overlay activated I use this.
My old Solaris server does not have lsof, so I have to use pfiles.
Just put this line in a file that resides in your /etc/cron.d/ folder, and you're set. The -q option is used to suppress php headers.
This command will shorten any URL the user inputs. What makes this command different is that it utilizes 5 different services and gives you 5 different outputs: is.gd, bit.ly, u.nu, geekology.co.za, and tinyurl. curl -s http://tinyurl.com/create.php?url=$1 \ | sed -n 's/.*\(http:\/\/tinyurl.com\/[a-z0-9][a-z0-9]*\).*/\1/p' \ | uniq ; curl -s http://bit.ly/?url=$1 \ | sed -n 's/.*\(shortened-url" value="http:\/\/bit.ly\/[a-zA-Z0-9][a-zA-Z0-9]*\).*/\1/p' \ | sed -n 's/.*\(http:\/\/bit.ly\/[a-zA-Z0-9][a-zA-Z0-9]*\).*/\1/p' \ | uniq ; curl -s http://geekology.co.za/shortii/create.php?u=$1 \ | sed -n 's/.*\(http:\/\/geekology.co.za\/[a-z0-9][a-z0-9]*\).*/\1/p' \ | uniq ; curl -s http://u.nu/unu-api-simple?url=$1 \ | sed -n 's/.*\(http:\/\/u.nu\/[a-z0-9][a-z0-9]*\).*/\1/p' \ | uniq ; curl -s http://is.gd/api.php?longurl=$1 \ | sed -n 's/.*\(http:\/\/is.gd\/[a-z0-9][a-z0-9]*\).*/\1/p' \ | uniq echo ""
A command to post a message and an auto-shortened link to Twitter. The link shortening service is provided by TinyURL.
Shows how many Windows and Linux devices are on your network. May add support for others, but that's all that are on my network right now. Show Sample Output
Display the $PATH with one line per entry, in a pager. Show Sample Output
If you set noclobber to on, bash won't allow redirection to overwrite existing files .
set -o noclobber command turn the option on (default it s off ) .
You can still append information but not overwrite the file .to turn it back off use : $ set +o noclobber .
I use it because i overwrite a file by accident , after thought , content of the file was very important , creating a one more file mean nothing for my hard disk (we are not anymore on the 64 k memory time) , but content of file is far much important . What we call exeprience :(
Show Sample Output
If you don't have netcat, you can use curl.
To see only earthquakes for today, add another pipe to egrep "`date '+%Y/%m/%d'`" Show Sample Output
Good when firewalled and only in need of a reasonable accurate time. Use a fast responding web server.
A better way to show the file lines 3n + 1
Simple file browser with dmenu, ls, and xdg-open.
files
awk extract every nth line. Generic is: awk '{if (NR % LINE == POSITION) print $0}' foo where "last" position is always 0 (zero). 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: