Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-21-2012, 06:58 PM   #1
Registered: Sep 2011
Location: Philly
Distribution: Gentoo
Posts: 470

Rep: Reputation: Disabled
dd and sed

is there a way to pipe dd and sed together?

I know it sounds completely useless, but can I search a location such a /dev/random for characters, manipulate them with sed and save them to a file?
Old 02-21-2012, 07:14 PM   #2
Registered: Nov 2011
Location: Germany, Bavaria, Nueremberg area
Distribution: openSUSE, Debian, LFS
Posts: 205

Rep: Reputation: 43
What are you __really__ trying to do?

Of course you can read from /dev/random and then manipulate the output.
cat /dev/random | doWhatEverYouLike
Old 02-22-2012, 12:23 AM   #3
Senior Member
Registered: Aug 2009
Distribution: CentOS
Posts: 2,967

Rep: Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268Reputation: 1268
The dd utility works just fine with pipes. If you don't specify an output destination ("of=xxxx") it writes to stdout. Similarly, if you don't specify the input source ("if=xxxx") it reads from stdin. Here's a reasonably useless example:
dd if=/dev/urandom bs=256 count=1 | sed -e 's/X/****X****/g' >some_file


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] head -n -1 (sed -n -e '1,$-1p' is incorrect) sed question, as stupid as it could be. kaz2100 Programming 1 12-27-2011 10:18 PM
[SOLVED] sed 's/Tb05.5K5.100/Tb229/' alone but doesn't work in sed file w/ other expressions Radha.jg Programming 6 03-03-2011 08:59 AM
sed: how to change MAC address string with sed cold Linux - Software 5 08-02-2010 08:43 AM
bash script with grep and sed: sed getting filenames from grep odysseus.lost Programming 1 07-17-2006 12:36 PM
Insert character into a line with sed? & variables in sed? jago25_98 Programming 5 03-11-2004 07:12 AM

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration