script needed for listing files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting script needed for listing files
# 1  
Old 09-10-2007
script needed for listing files

hi,
i have a the direcories like

usr\clone1\heap001.txt
usr\clone2\heap334.txt
usr\clone3\heap8899.txt

i nead a command which list all the file starting with heap*.i have to execute the command from usr directory. find command is hanging, i need some other form of script to do this. please help me on this
# 2  
Old 09-10-2007
Hi,

The blow code did the task for me.Why 'find' command is hanging?Check your permissions for inner directories?


/usr $ find . -name "heap*"
./clone1/heap001.txt
./clone2/heap334.txt
./clone3/heap8899.txt


With Regards
Dileep Pattayath
# 3  
Old 09-10-2007
find /usr -name "heap*" -type f

ls -R /usr |grep -i heap

both ways you will get the desired output if you have the right permissions.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script help needed(lookup 2 text files)

Hi, iam new to unix scripting need a help. The scenario is i have 2 text files. a.txt has colA colB colC colD JKU1270A JKU1042A 9 1 JKU1270A JKU1042B 9 1 JKU1270A JKU1042C 9 1 JKU1270B JKU1107B 9 1 JKU1270B JKU1107C 9 1... (1 Reply)
Discussion started by: tech_frk
1 Replies

2. Shell Programming and Scripting

Request for shell script for listing directories, subdirs containing specific files.

I'm looking for a script which outputs the list of directories and sub directories from root level consisting of specific files. For instance I want shell script to list all the directories and subdirectories containing .txt files.:wall: (4 Replies)
Discussion started by: super210
4 Replies

3. Shell Programming and Scripting

Listing files script

hey guys I am writing a bash script that compares 2 directories and lists the contents that are different in each directory. I have figured out how to do this but the only problem is that it lists the file like this: -rw-r--r-- 1 joey12 users 0 2010-10-29 16:13 test/file3 I want it to print... (16 Replies)
Discussion started by: Joey12
16 Replies

4. Shell Programming and Scripting

Help needed in formatting script files

Hi, Can anyone tell me how i can convert all tab spaces inside a script to 4 spaces through another script. Also i need to find if all the quotes are matching and ended properly. Any idea whould be of great help. Many thanks! (3 Replies)
Discussion started by: justchill
3 Replies

5. Shell Programming and Scripting

perl script for listing files and mailing the all files

Hi, I am new to perl: I need to write perl script to list all the files present in directory and mail should be come to my inbox with all the files present in that directory. advanced thanks for valuable inputs. Thanks Prakash GR (1 Reply)
Discussion started by: prakash.gr
1 Replies

6. UNIX for Dummies Questions & Answers

Help needed for listing files using SFTP

Hello All I want to list files using SFTP. this should work the same way as ls -Ap1t $dir is working in a perl program. but for SFTP i dont find any option like as A,p,1,t.so how to use this (0 Replies)
Discussion started by: vikas_poonia
0 Replies

7. Shell Programming and Scripting

help needed in a shell script for printing files

Hi All, I am writing a shell script to print all the files in a particular folder. This script is on solaris server . I am using the lp command to send the requests . lp -d printername filename . The output I get is the request id. Is there any way I can use the request Id to determine if... (1 Reply)
Discussion started by: shahshilpa
1 Replies

8. UNIX for Dummies Questions & Answers

Help needed in Listing Files

I need to list files in alphabetical-group and each such group listed in increasing order of timestamp. Example : If I list files in a directory ( ls -lrt ) it shows like below. c3 b4 b3 a4 a3 c2 b2 c1 b1 a2 a1 What I need is c3 c2 (4 Replies)
Discussion started by: coolbhai
4 Replies

9. Shell Programming and Scripting

script for listing files of today's time stamp

Hi, I need to write a script,which behaves like this, Given the folder name, it should list the files with today's timestamp. Please direct me on this. Thanks. (2 Replies)
Discussion started by: kid123
2 Replies

10. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies
Login or Register to Ask a Question