Results 1 to 4 of 4
Hi all,
I want to know the how can i read the directories in shell script i.e to brief i want to write a shell script which automatically finds what ...
- 06-04-2007 #1Just Joined!
- Join Date
- Jun 2007
- Posts
- 14
Help Regarding Shell Scripting
Hi all,
I want to know the how can i read the directories in shell script i.e to brief i want to write a shell script which automatically finds what are all the directories and files present in the directory which it runs and prints it.
Can any one let me know how can i do it. I also want to know which is the best book to learn shell scripting.
Regards
Yugandhar.
- 06-05-2007 #2Linux Enthusiast
- Join Date
- Aug 2006
- Posts
- 631
Try the find command.
Google for "manpage find examples".
To learn Bash scripting you can check these pdf files:
http://personal.riverusers.com/~theg.../abs-guide.pdf
http://tldp.org/LDP/Bash-Beginners-G...ners-Guide.pdf
Regards
- 06-05-2007 #3Linux User
- Join Date
- Jan 2007
- Location
- cleveland
- Posts
- 452
have you tried "ls -R" ?
the sun is new every day (heraclitus)
- 06-06-2007 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
If you want to do some work with directories/files within a script, look at the 'find' command. Here's an example of what's prossible, it lists the directories as a tree structure.
# find ./ -type d -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
Vic


Reply With Quote