I have a directory somewhere on my server wth the name "exampledocs". I tried to find it's location using:
ls -d */ | grep -E 'exampledocs'
and
find * -regextype posix-extended \-regex 'exampledocs' \-type d
and
grep "exampledocs" * --recursive
Nothing worked. How can I do this from the command line? I'm using Ubuntu Server 11.0.
This also should work
Note: This is from Debian, but it should work.
locate exampledocs | grep /exampledocs$
With
bash
'sglobstar
shell option and[[
evaluation, we can make use of recursive globbing and prefix removal to find directories that contain the needed string. Here's how I'd search forbin
folder: