Commands using sed (1,319)

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

diff files while disregarding indentation and trailing white space
**NOTE** Tekhne's alternative is much more succinct and its output conforms to the files actual contents rather than with white space removed My command on the other hand uses bash process substitution (and "Minimal" Perl), instead of files, to first remove leading and trailing white space from lines, before diff'ing the streams. Very useful when differences in indentation, such as in programming source code files, may be irrelevant

Find dead symbolic links
-L tells find to follow symbolic links, so -type l will only return links it can't follow (i.e., those that are broken).

List all packages by installed size (Bytes) on rpm distros

View internet connection activity in a browser
In addition to generating the current connections, it also opens then in your default browser on gnome.

BASH: Print shell variable into AWK
Alternatively: export MyVAR=84; awk '{ print ENVIRON["MyVAR"] }'

print DateTimeOriginal from EXIF data for all files in folder
see output from `identify -verbose` for other keywords to filter for (e.g. date:create, exif:DateTime, EXIF:ExifOffset).

See entire packet payload using tcpdump.
This command will show you the entire payload of a packet. The final "s" increases the snaplength, grabbing the whole packet.

Show available conversions
aliases on each line. i.e. txt2html: $recode ..HTML file.html txt to Base64: $recode ../b64 file.b64 and so on.

Copy recursivelly files of specific filetypes
Copying only wmv and mpg files recursively from to

Bash autocomplete case insensitive search
Change bash autocomplete case search to insensitive when pressing tab for completion.


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: