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

Download full FLAC albums from archive.org
The only zipped version of an album available for download is the lossy mp3 version. To download lossless files, because of their size, you must download them individually. This command scrapes the page for all the FLAC (or also SHN) files.

Limit the transfer rate of a pipe with pv
-L RATE, --rate-limit RATE Limit the transfer to a maximum of RATE bytes per second. A suffix of "k", "m", "g", or "t" can be added to denote kilobytes (*1024), megabytes, and so on. It must be an integer.

Get information about a video file

Highlight network TX, RX information change

Watch how many tcp connections there are per state every two seconds.

mplayer -af scaletempo
Pitch-correct play speed with mplayer. You can also use [] and {} keys to change play speed on-the-fly.

SMS reminder
Send an e-mail to SMS reminder in 15 minutes from now, to call my wife. See list of carriers bellow Carrier Email to SMS Gateway Alltel [10-digit phone number]@message.alltel.com AT&T (formerly Cingular) [10-digit phone number]@txt.att.net [10-digit phone number]@mms.att.net (MMS) [10-digit phone number]@cingularme.com Boost Mobile [10-digit phone number]@myboostmobile.com Nextel (now Sprint Nextel) [10-digit telephone number]@messaging.nextel.com Sprint PCS (now Sprint Nextel) [10-digit phone number]@messaging.sprintpcs.com [10-digit phone number]@pm.sprint.com (MMS) T-Mobile [10-digit phone number]@tmomail.net US Cellular [10-digit phone number]email.uscc.net (SMS) [10-digit phone number]@mms.uscc.net (MMS) Verizon [10-digit phone number]@vtext.com [10-digit phone number]@vzwpix.com (MMS) Virgin Mobile USA [10-digit phone number]@vmobl.com

All what exists in dir B and not in dir A will be copied from dir B to new or existing dir C
Assumed dir A, B, C are subdirs of the current dir Exact syntax of the command is: rsync -v -r --size-only --compare-dest=/path_to_A/A/ /path_to_B/B/ /path_to_C/C/ (do not omit end-slashes, since that would copy only the names and not the contents of subdirs of dir B to dir C) You can replace --size-only with --checksum for more thorough file differences validation Useful switch: -n, --dry-run perform a trial run with no changes made

Encrypted archive with openssl and tar
Create an AES256 encrypted and compressed tar archive. User is prompted to enter the password. Decrypt with: $ openssl enc -d -aes256 -in | tar --extract --file - --gzip

create iso image from a directory
create iso image from directory . Usefull for virtualised machine To create CD ISO image of directories that contain long file name or non-8.3 format (particularly if you want to burn the CD image for use in Windows system), use the -J option switch that generates Joliet directory records in addition to regular iso9660 file names. For example, to create CD image of Vista SP1 directory: mkisofs -o VitaSP1.iso -J VistaSP1


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: