954,525 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Find a file recursively in a directory

I am supposed to find a file recursively in a given directory. Rules are not to use find and recursive options like ls -R and grep -r. I can any other other option expect recursive.

I had written the script using recursion.

#!/bin/csh
foreach i (`ls -R $1 | grep : | sed 's/://'`)
readlink -f "$i/$2"
end

Please help me solve this. It is quite urgent.

Thanx

naiksuresh
Newbie Poster
4 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

Well I got the answer

use du -a $1|cut -f2|grep $2

naiksuresh
Newbie Poster
4 posts since Aug 2010
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: