Finding files in Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Finding files in Unix
# 1  
Old 07-13-2001
Data Finding files in Unix

I need help with the syntax to serach a directory and all the folders in that directorys for a single pdf file. I would than like to move that file to another folder. I don't know if this is possible with one command. Please Help.
# 2  
Old 07-13-2001
%xargs cp << end
`find . -depth -name a.pdf -print`
`echo ./test/.`
end


Please ensure that there are no 2 copies

Last edited by DPAI; 07-13-2001 at 05:53 PM..
# 3  
Old 07-13-2001
Hammer & Screwdriver

try this

find /DirectoryName -name "xxx.pdf" -exec mv {} /WhereFileGoes \;

i.e.
find /project/unix -name "test.pdf" -exec mv {} /team \;
Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Finding total distinct count from multiple csv files through UNIX script

Hi All , I have multiple pipe delimited csv files are present in a directory.I need to find out distinct count on a column on those files and need the total distinct count on all files. We can't merge all the files here as file size are huge in millions.I have tried in below way for each... (9 Replies)
Discussion started by: STCET22
9 Replies

2. Shell Programming and Scripting

Finding out the common lines in two files using 4 fields with the help of awk and UNIX

Dear All, I have 2 files. If field 1, 2, 4 and 5 matches in both file1 and file2, I want to print the whole line of file1 and file2 one after another in my output file. File1: sc2/80 20 . A T 86 F=5;U=4 sc2/60 55 . G T ... (1 Reply)
Discussion started by: NamS
1 Replies

3. Shell Programming and Scripting

Finding files with wc -l results = 1 then moving the files to another folder

Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
Discussion started by: Dj Moi
5 Replies

4. UNIX for Dummies Questions & Answers

finding files in unix and excluding certain folders

hi good day I am using redhat linux. Is there a better utility than the 'find' command to search for files I am trying to search through and enitre directory such as /repos for a files that have 'UAP' in it. However there are some '.step' folders littered throughout the /repos folder at varying... (8 Replies)
Discussion started by: johnstrong
8 Replies

5. Shell Programming and Scripting

Finding just unix user

I need to check for username that we are logged in.There are a lot of unix users and proceed according to that i.e find unix user if then echo "x" elif then echo "y' fi fi Now I dont know how to find and put user in if condition (8 Replies)
Discussion started by: sriki32
8 Replies

6. Shell Programming and Scripting

a comand finding all files from unix system

Hi, I am new in using unix systems and I need your help. I would like to make a command that prints all files (not directories) from a file system. These files must be executable from all users (--x --x --x) Thank you in advance (2 Replies)
Discussion started by: peter20
2 Replies

7. Shell Programming and Scripting

Need help in writing script for finding files in the unix machine?

I would like to find whether a file exists in the UNIX machine. That i can check using if ;then echo "exists" echo " `cat $file` " else echo "invalid file" fi. and i can find out using : find / -name "filename" . But it i have wanted to search in all directories. How to get... (3 Replies)
Discussion started by: rparsa001
3 Replies

8. UNIX for Dummies Questions & Answers

Unix shell script for finding top ten files of maximum size

I need to write a Unix shell script which will list top 10 files in a directory tree on basis of size. i.e. first file should be the biggest in the whole directory and all its sub directories. Please suggest any ideas (10 Replies)
Discussion started by: abhilashnair
10 Replies

9. Shell Programming and Scripting

finding duplicate files by size and finding pattern matching and its count

Hi, I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern. Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies

10. Shell Programming and Scripting

finding files in Unix

Hi 1)How do i find files in unix that end either in .pc or .h This does not return any output find . -name "*(pc|h)" 2)I have a file like this 001123456 .. ... i want the output to be like 001-123-456 any tricks in regular expression can do this in vi. regards Hrishy (7 Replies)
Discussion started by: xiamin
7 Replies
Login or Register to Ask a Question