![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need script to find errored files inside directories | osramos | Shell Programming and Scripting | 4 | 09-24-2008 01:13 PM |
| "find command" to find the files in the current directories but not in the "subdir" | swamymns | Shell Programming and Scripting | 9 | 07-22-2008 11:23 AM |
| Script problem due to recursive directories Help please | robertmcol | Shell Programming and Scripting | 2 | 04-27-2008 07:00 PM |
| shell script to call other files..plz help | anju | Shell Programming and Scripting | 3 | 02-05-2008 04:07 AM |
| Question about Restricting Search path of FIND to current directory | super_duper_guy | UNIX for Dummies Questions & Answers | 2 | 10-17-2005 09:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
################################################################
Copy this script to your path from where you want to search for all the files and directories in subdirectories recursively. ################################################################# code starts here ################################################## #!/usr/bin/sh recur_fun() { for i in `ls -ltr | grep '^d'| awk '{print $9}'` do echo $i; cd $i; ls pwd recur_fun cd .. pwd done } recur_fun |
|
||||
|
Below is another variant
Code:
ls -ltR /path |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| recursion in shell script |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|