Share your knowledge at the LQ Wiki.
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 11-10-2004, 11:52 PM   #1
Registered: Feb 2003
Distribution: Suse 8.1
Posts: 102

Rep: Reputation: 15
Need some help with linux command


I'm relatively new to linux.

Here's what I'm trying to do,

I have a file, called image.dd, which is an image of a drive.

I wish to search this drive and extract all files called 'index.dat' and parse them through another program and output them to one text file, which is the standard output of the parsing program.


the parsing program works like:

# ./pasco index.dat > output.txt

However I have to do this for every index.dat file on the drive.

I was hoping to use somethign like find to go through the drive in a manner such as

# find . -name index.dat /dev/sda

and push the resulting files through pasco and have them all add to one large text file,

Can anyone help me with the syntax?

TIA for any pointers,

Old 11-11-2004, 02:26 AM   #2
LQ Addict
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Maybe a simple pipe would work.

find . -name index.dat /dev/sda | ./pasco index.dat >> output.txt

Notice the append (>>). That would add input to an existing file. Redirect (>) would overwrite the existing file.
Old 11-11-2004, 03:47 AM   #3
Registered: Sep 2004
Distribution: Slackware 13; openSUSE 11.2
Posts: 255

Rep: Reputation: 34
The first thing you need to do is mount that file as if it was a disk. To do this you need a mount point.

[code]cd ~
mkdir test
mount -o loop ~/image.dd ~/test

Assuming image.dd is in your home directory, it should mount it as if it was a disk device. Then you can try your find command on it.


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
linux command neerajchaudhari Linux - Newbie 1 09-09-2005 03:58 AM
linux command neerajchaudhari Linux - Newbie 2 09-08-2005 08:05 AM
Require Linux/Perl equivalent command for windows Command alix123 Programming 7 08-19-2005 03:23 AM
linux command anirudh Programming 3 02-25-2005 12:53 PM
unix command to linux command leonidas Linux - General 1 09-10-2004 01:40 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:53 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