ls -R command but need complete path name on each line


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users ls -R command but need complete path name on each line
# 1  
Old 12-10-2005
ls -R command but need complete path name on each line

Can anyone help me with the following:
I need to traverse subdirectories to create a list of files with the pathname. For example, here's what I get with a simple ls -alR command:

/MAIN/data/30007390 dte2>>ls -alR

.:

total 2

drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 .

drwxrwx--- 37 ecfadmin staff 1024 Oct 24 18:35 ..

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 GroupB

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 GroupA



./GroupB:

total 8

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 .

drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 ..

-rwxrwx--- 1 ecfadmin staff 1968 Oct 24 18:35 02050506.GZ

-rwxrwx--- 1 ecfadmin staff 1976 Oct 24 18:35 02050720.GZ



./GroupA:

total 20

drwxrwx--- 2 ecfadmin staff 96 Oct 24 18:35 .

drwxrwx--- 4 ecfadmin staff 96 Oct 24 18:35 ..

-rwxrwx--- 1 ecfadmin staff 9453 Oct 24 18:35 05050602.GZ



What I would like to get back is something with the full path name and file name:



/MAIN/data/30007390/GroupB/02050720.GZ

/MAIN/data/30007390/GroupB/02050506.GZ

/MAIN/data/30007390/GroupA/05050602.GZ

*Permissions, primary and secondary group names, dates times and sizes are not needed but don't have to be excluded.

I'm looking for something pretty straight forward, I could write a little shell to handle it but was hoping for something a little more elegant. (I was hoping there was a version (or option) of “ls” out there that might do it).

Any help would be appreciated.
# 2  
Old 12-10-2005
try "find" instead ... see "man find" ...

find . -type f -print
# 3  
Old 12-12-2005
That was exactly what I was looking for. It works great. Thanks very much!!!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pattern match a path anywhere in the line and replace it with new path

I want to pattern match only path part from below and replace them with new path string. LoadModule jk_module /fldrA/fldrBaf/fldrCaa/modules/mod_jk.so JkWorkersFile /fldrA/fldrBaf/fldrCaa/config/OHS/ohs1/workers.properties JkLogFile... (4 Replies)
Discussion started by: kchinnam
4 Replies

2. Solaris

Show complete command on command line when we use 'ps'

Hi, When I query using ps -ef, the complete command is not displayed and is truncated. Can you please tell me a method to resolve this ? I have tried the below. ps -ef | cat ps -ef | grep imp >/tmp/t1.txt /usr/ucb/ps -auxw pargs <pid> /usr/ucb/ps -aefyl | grep imp Thanks (11 Replies)
Discussion started by: mk1216
11 Replies

3. UNIX for Dummies Questions & Answers

How to get complete path in variable excluding last word?

Hello Experts, Can you please help me by providing a code which can give me the complete path except last word in a variable, the variable i can use anywhere else for my operation eg: if this below one is my path: ... (3 Replies)
Discussion started by: aks_1902
3 Replies

4. UNIX for Dummies Questions & Answers

Can grep command return word instead of complete line

Hi Is there any way GREP command can return word and not complete line. My file has following data: Hello Everyone I am NitinrajSrivastava Hi Friends Welcome VrajSrivastava I am using grep 'raj' which is returning me complete line.However I want only the word having keyword 'raj'. Required... (11 Replies)
Discussion started by: dashing201
11 Replies

5. Shell Programming and Scripting

Split a line on positions before reading complete line

Hi, I want to split before reading the complete line as the line is very big and its throwing out of memory. can you suggest. when i say #cat $inputFile | while read eachLine and use the eachLine to split its throwing out of memory as the line size is more than 10000000 characters. Can you... (1 Reply)
Discussion started by: vijaykrc
1 Replies

6. UNIX for Dummies Questions & Answers

how to find complete path of a file in unix

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture... (5 Replies)
Discussion started by: yahoo!
5 Replies

7. UNIX for Advanced & Expert Users

how to find complete path of a file in unix

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to capture... (1 Reply)
Discussion started by: yahoo!
1 Replies

8. UNIX for Dummies Questions & Answers

Using the Esc key to complete command line typing

Dear Techs, In the past on a different box (HP) I use to be able to complete something I was typing by entering a portion of the filename in the pwd and I would hit the Esc key and it would match the rest of the filename. I did this without understanding how it was setup. Now I am on a new... (1 Reply)
Discussion started by: jxh461
1 Replies

9. UNIX for Dummies Questions & Answers

display full unix path as part of the command line

Hi all, Does anyone know how to ammend the .cshrc file in $HOME for your session to display the path as part of the command line? So that I dont need to keep on typing pwd to see where I am? thanks Ocelot (3 Replies)
Discussion started by: ocelot
3 Replies

10. Shell Programming and Scripting

displaying the path in the command line

Hi all, Does anyone know how to ammend the .cshrc file in $HOME for your session to display the path as part of the command line? So that I dont need to keep on typing pwd to see where I am? thanks Ocelot (2 Replies)
Discussion started by: ocelot
2 Replies
Login or Register to Ask a Question