LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-18-2006, 07:22 AM   #1
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
Word search


I've just restored my rm'ed ext2 partition. Now I have about 1 million $Inode files. So I need a way how to identify which files I need to restore. I could find these files by searching for some word which I know they would include. So I tried: cat *|grep WORD but I got an error from cat: too many arguments or smth similar. Can anybody give me any suggestion?

Thanks in advance
It would be sad if I didn't recover them having gone so far.

File names go like this $Inode1 - $Inode1002324.
 
Old 04-18-2006, 08:39 AM   #2
Ramark
LQ Newbie
 
Registered: Mar 2006
Location: Serbia
Distribution: Slackware 10.2
Posts: 8

Rep: Reputation: 0
grep WORD *
 
Old 04-18-2006, 09:33 AM   #3
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Original Poster
Rep: Reputation: 53
As I said:
Code:
/usr/bin/grep: Argument list too long
 
Old 04-18-2006, 10:45 AM   #4
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
Code:
find . -print0 | xargs -0 grep WORD
 
Old 04-18-2006, 11:53 PM   #5
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Original Poster
Rep: Reputation: 53
Thank you, mdarby. You have saved me from another 3 hours of desperate picoing.
 
Old 04-19-2006, 05:52 AM   #6
mdarby
Member
 
Registered: Nov 2004
Location: Columbus, Ohio
Distribution: Slackware-Current / Debian
Posts: 795

Rep: Reputation: 30
But of course. I'm quite the fan of xargs
 
  


Reply



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
search a file for a word - bash script paul_mat Linux - Software 12 04-16-2006 01:59 AM
I have a harddrive that I want to search for deleted word files, what do I do first? abefroman Linux - Security 2 07-31-2005 07:37 PM
remove color after word search in vi editor dylan912 Linux - Newbie 1 12-10-2004 04:15 AM
How do i change the word "FISH" when i use Lan search ? frank-01 Linux - Networking 11 01-22-2004 03:00 PM
Viewers for Word, Word Perfect, etc. Claude Williams Linux - General 2 11-22-2001 04:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:51 AM.

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