Specific directory parsing in a directory tree


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Specific directory parsing in a directory tree
# 1  
Old 03-06-2012
Specific directory parsing in a directory tree

Hi friends,

Hello again Smilie

i got stuck in problem. Is there any way to get a special directory from directory tree?
Here is my problm.." Suppose i have one fix directory structure "/abc/xyz/pqr/"(this will be fix).Under this directory structure i have some other directory and sub-directories. Now i want to search a directory (dynamically entered by user)and list out all the files under that particular directory".

I tried but i couldn't Smilie unless i manually type full directory path. Smilie ...
I hope, friends you got my question. please give me some idea....
# 2  
Old 03-06-2012
Code:
find "/abc/xyz/pqr/$INPUTDIR" -type f

# 3  
Old 03-07-2012
Thanks a lot..but after getting output of this find "/abc/xyz/pqr/$INPUTDIR" -type f ..i want to list all the files availble in that particular direcotry with time stamp.

Can you please also throw some light on that...
# 4  
Old 03-07-2012
use ls with find , something like below .

Code:
find "/abc/xyz/pqr/$INPUTDIR" -type f -ls

This User Gave Thanks to codemaniac For This Post:
# 5  
Old 03-12-2012
Thanks a lot it worked... Smilie ...but now same thing i am trying to list out all the symbolic links...but it's not working...can you please give any idea..because same command is working for actual files......
# 6  
Old 03-12-2012
for symbolic link, use

Code:
 
type -l

# 7  
Old 03-12-2012
i tried with type -l but its not working. So i tried with
find . -type l -print | xargs ls -ld its working...thnks anyway for ur time Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

2. Web Development

Directory index forbidden by Options directive error on specific directory with indexing disabled

I am seeing the following error appear numerous times in my Apache error log: I have my Apache config configured as below, so I would expect indexing not to occur on this directory as it falls under the parent /web directory. Strangely all the IP address, including this example, all... (5 Replies)
Discussion started by: crmpicco
5 Replies

3. Shell Programming and Scripting

Delete all files with specific extension in directory tree

I'm sure this has been asked many times, but a search didn't turn up a definitive best method for this (if there ever is such a thing). I have been using rsync to back up my main data directory, but I have accumulated a large number of older backups that I don't need. All of the files I don't... (14 Replies)
Discussion started by: LMHmedchem
14 Replies

4. UNIX for Dummies Questions & Answers

directory tree with directory size

find . -type d -print 2>/dev/null|awk '!/\.$/ {for (i=1;i<NF;i++){d=length($i);if ( d < 5 && i != 1 )d=5;printf("%"d"s","|")}print "---"$NF}' FS='/' Can someone explain how this works..?? How can i add directory size to be listed in the above command's output..?? (1 Reply)
Discussion started by: vikram3.r
1 Replies

5. UNIX for Dummies Questions & Answers

Fllatten directory tree

Hi there, I have a filestore that is just two levels: dir/ file1 file2 file3 ... subdir1/ file4 file5 file6 subdir2/ file7 file8 file9 ... I am looking for acommand or scrip that will flatteb this tree and copy all the... (6 Replies)
Discussion started by: loquela
6 Replies

6. UNIX for Dummies Questions & Answers

Move all files in a directory tree to a signal directory?

Is this possible? Let me know If I need specify further on what I am trying to do- I just want to spare you the boring details of my personal file management. Thanks in advance- Brian- (2 Replies)
Discussion started by: briandanielz
2 Replies

7. Shell Programming and Scripting

directory tree

Hi all, The following is a script for displaying directory tree. D=${1:-`pwd`} (cd $D; pwd) find $D -type d -print | sort | sed -e "s,^$D,,"\ -e "/^$/d"\ -e "s,*/\(*\)$,\:-----\1,"\ -e "s,*/,: ,g" | more exit 0 I am trying to understand the above script.But... (3 Replies)
Discussion started by: ravi raj kumar
3 Replies

8. Shell Programming and Scripting

Recursively copy only specific files from a directory tree

Hi I am a shell-script newbie and am looking to synchronize certain files in two directory structures. Both these directory-trees are in CVS and so I dont want the CVS directory to be copied over. I want only .sh and .pl files in each subdirectory under these directory trees to be... (3 Replies)
Discussion started by: sharpsharkrocks
3 Replies

9. Programming

directory as tree

hi i have modified a program to display directory entries recursively in a tree like form i need an output with the following guidelines: the prog displays the contents of the directory the directory contents are sorted before printing so that directories come before regular files if an entry... (2 Replies)
Discussion started by: anything2
2 Replies

10. Programming

Directory tree search???

Hi all, I've got a problem, what function do i use to list the contents of all the directory tree (simular to "find")? Any other suggestions? Thank you all (3 Replies)
Discussion started by: solvman
3 Replies
Login or Register to Ask a Question