find files by OWNER


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting find files by OWNER
# 1  
Old 09-23-2008
find files by OWNER

i have written a script in which i have to go to a dir and search there for files belonging to owner pipe and then delete them

Can anyone tell me how to find files by owner pipe. below some of the files belonging to owner pipe

-rw------- 1 pipe pipe 163840 Mar 18 2008 Exaaa75848
-rw------- 1 pipe pipe 163840 Mar 18 2008 Exaaa52506
-rw------- 1 pipe pipe 163840 Mar 18 2008 Exaaa32542
-rw------- 1 pipe pipe 163840 Mar 18 2008 Exaaa32540
-rw------- 1 pipe pipe 163840 Mar 18 2008 Exaaa47198
-rw------- 1 pipe pipe 196608 Mar 18 2008 Exaaa30084

----------------------------------------------------------------------

How to get them using find command based on owner pipe ?

thanks in advance
# 2  
Old 09-23-2008
You can use the -user option of find with the -exec command, check the manpage of find.

Regards
# 3  
Old 10-25-2008
Hello,

I have a problem, I need to find files in folder by owner, not using find command at all and ls -R parameter. Thanx a lot.

Best regarts
# 4  
Old 10-25-2008
Tools

Can you use an ls -l to get a listing of files, then an awk command to only select on the appropprate column?

Why the restrictions on certain approaches?

Your original request:
Quote:
How to get them using find command based on owner pipe
Your follow-up:
Quote:
not using find command at all and ls -R parameter
# 5  
Old 10-25-2008
I have a task to write a shell script that finds files in folders by selected owner, without using find command at all and ls -R parameter. I can use ls -l command but I can't use sed,awk,perl as well.
# 6  
Old 10-25-2008
Hammer & Screwdriver What about the following command?

Code:
> ls -l | tr -s " " | grep "^-" | cut -d" " -f3,9- | grep "^pipe" | cut -d" " -f2-

where the word pipe is the file owner.
# 7  
Old 10-26-2008
sounds like homework to me.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find the owner user of each folder in a list

Hello I have a file containing the list of different folders like this file_list.txt: /s8/tests/test1 /s8/tests/tests/test2 /s8/tests/test2 /s8/tests/tests/test2/test5 I want a script to put the owner user of each folder in front of it in the text file. So the reult would become... (5 Replies)
Discussion started by: Johanni
5 Replies

2. Shell Programming and Scripting

How to find DL Owner info using ldapsearch?

Currently i have following syntax: ldapsearch -D "CN=..,OU=..,OU=All Businesses,DC=..,DC=..,DC=.." -w .. -h .. -p .. -b "OU=All Businesses,DC=..,DC=..,DC=.." "managedObjects=$DL_NAME_CN" employeeNumber givenName sn -S employeeNumber -x which gives me following info: "requesting:... (0 Replies)
Discussion started by: arsenghani
0 Replies

3. UNIX for Dummies Questions & Answers

Using find to search for any owner having execute permissions.

Hi I need help. I need to use find (or grep I don't care) to recursively search for files who have any kind of executable permissions (group and/or owner and/or other). I am looking for *.c and *.h This what I am using now: find . -name *.h -perm -111 -print but I don't want to retype that... (4 Replies)
Discussion started by: dissectcode
4 Replies

4. UNIX for Advanced & Expert Users

command to find the owner of a db

Hi, Im working with an Informix db, i would like to know the command to identify the owner of a particular database Thanks (2 Replies)
Discussion started by: dvah
2 Replies

5. UNIX for Advanced & Expert Users

How UNIX admin set up this? how files of 744 of other owner can be removed by another owner?

Hi all, We have some files are under 744 permissions and the the owner is say owner1 and group1. Now we have another user owner2 of group2, owner2 can remove files of the owner1 and the permission of those files are 744, unix admin told us he did some config at his side so we can do that. ... (14 Replies)
Discussion started by: TheGunMan
14 Replies

6. Shell Programming and Scripting

to parse a directory and its subdirectories and find owner name of files

hi all, i need to capture all the files in a directory and its subdirectories that have owner name different than the root owner. for one file it is " stat -c %U filename " but i need to search for each and every file and record it. thanks in advance (14 Replies)
Discussion started by: vyasa
14 Replies

7. UNIX for Dummies Questions & Answers

How to know owner of a file without ls and find command

How to know owner of a file without ls and find command :p (1 Reply)
Discussion started by: swat
1 Replies

8. UNIX for Dummies Questions & Answers

Find files by owner

Hello, I have a problem, I need to find files in folder by owner, not using find command at all and ls -R parameter. Thanx a lot. Best regarts (1 Reply)
Discussion started by: Boliakas
1 Replies

9. UNIX for Dummies Questions & Answers

command to find the files under particular owner

Hi, I need a command to find a files under particular owner ?All the files in the system for the particular user id is the owner? Please help me on this? (2 Replies)
Discussion started by: jayaramanit
2 Replies

10. Shell Programming and Scripting

how to extract owner from find command

hi how can I extract the owner of the file from the find command that I used below find /home -type f -atime +5 I tried something like this but didnt work. find /home -type f -atime +5 -ls |cut -f5 (5 Replies)
Discussion started by: tjay83
5 Replies
Login or Register to Ask a Question