Help on cat filelist.txt |xargs -n1 find


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Help on cat filelist.txt |xargs -n1 find
# 1  
Old 10-08-2010
Help on cat filelist.txt |xargs -n1 find

I am trying to find all the files listed in a filelist.txt.
Why cant I use something like this

cat filelist.txt | xargs -n1 find $path
# 2  
Old 10-08-2010
First, you get a useless use of cat award.

Secondly, because find doesn't work that way. By default it expects paths to look inside, not file names; usually you'd do find /path -name filename

so:
Code:
xargs --max-args=1 find /path -iname < files.txt

This User Gave Thanks to Corona688 For This Post:
# 3  
Old 10-08-2010
Thanks that helped!
Also, thanks for the award link Smilie, this is my first post and I already feel such fun stuff on this site will help me gain more than i seek.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Single line backups with find or cat and xargs, etc

Hi, I'm new here and this is my first post. I used command line Unix at work for 3 years... about 10 years ago! Now I can't figure out nor hunt down examples of how to do the following: Say I built a list of file to backup like this: find ~ -name "*.pdf" -print >> MYPDF.txt So I am using find... (6 Replies)
Discussion started by: hwilliam777
6 Replies

2. UNIX for Beginners Questions & Answers

Find the files based on date from filelist

Hi All, I have a filelist which contains the "ls" output, i want to extract the filenames written in this files based on date. I know i can run loop and extract the file but i want to avoid it. also there is find command which can be used on directory i.e. find . -type f -newermt "2019-09-25"... (3 Replies)
Discussion started by: kumarinfa
3 Replies

3. Shell Programming and Scripting

Awk, sed, shell all words in INPUT.txt find in column1 of TABLE.txt and replce with column2 in

Hi dears i have text file like this: INPUT.txt 001_1_173 j nuh ]az 001_1_174 j ]esma. nuh ]/.xori . . . and have another text like this TABLE.txt j j nuh word1... (6 Replies)
Discussion started by: alii
6 Replies

4. UNIX for Dummies Questions & Answers

Get filelist.txt from a sftp remote server

Hi everyone, so I have a script create a login file to log into the sftp remote server, go to a certain directory and get the list of files in that direction into a text file in another folder (local folder). Here is the piece of code echo "#!/usr/local/bin/expect -f" >>... (5 Replies)
Discussion started by: warmboy610
5 Replies

5. UNIX for Dummies Questions & Answers

find lines in file1.txt not found in file2.txt memory problem

I have a diff command that does what I want but when comparing large text/log files, it uses up all the memory I have (sometimes over 8gig of memory) diff file1.txt file2.txt | grep '^<'| awk '{$1="";print $0}' | sed 's/^ *//' Is there a better more efficient way to find the lines in one file... (5 Replies)
Discussion started by: raptor25
5 Replies

6. Shell Programming and Scripting

cat vs head vs readline get variable from txt file

I have a file with a single filename in it, which I want to assign to a BASH variable, so I've been trying: c=$(head -1 somefile) echo $c which outputs correctly, but them when I do ... somecommand $c it says it can't find the file, is that because it's grabbing the whole line, and... (5 Replies)
Discussion started by: unclecameron
5 Replies

7. Shell Programming and Scripting

find | xargs cat

Hi, I am having trouble getting a combination of commands to work. I need to traverse through all sub-directories of a certain directory and 'cat' the contents of a particular file in the sub-directories. The commands on their own work but when I combine them I get no output. The... (4 Replies)
Discussion started by: DownunderDave
4 Replies

8. Shell Programming and Scripting

for i in `cat myname.txt` && for y in `cat yourname.txt`

cat myname.txt John Doe I John Doe II John Doe III ----------------------------------------------------------------------- for i in `cat myname.txt` do echo This is my name: $i >> thi.is.my.name.txt done ----------------------------------------------------------------------- cat... (1 Reply)
Discussion started by: danimad
1 Replies

9. Shell Programming and Scripting

Read from fileList.txt, copy files from directory tree

Hi, hopefully this is a fairly simple Q&A. I have a clean file list of approximately 180 filenames with no directory or slashes in front of the filename nor any extension or dot ".". I would like to read from this list, find these files recursively down through directory trees, copy the files... (1 Reply)
Discussion started by: fxvisions
1 Replies

10. Shell Programming and Scripting

find | xargs cat

Hai I just want to find a file *.txt in particular direcotry and display the file name puls the content. Do someone know hot to do this, thanks. I try : find test/ -name '*.txt' | xargs cat but It does'nt print out the file name, i want something below print out in my screen : test/1.txt... (4 Replies)
Discussion started by: asal_email
4 Replies
Login or Register to Ask a Question