How to find a folder on my server with a certain name?

297,727

Solution 1

find / -xdev 2>/dev/null -name "exampledocs" 

Note: This is from Debian, but it should work.

Solution 2

This also should work

find folder_full_path -name exampledocs -type d

Solution 3

locate exampledocs | grep /exampledocs$

Share:
297,727

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    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.

  • heroin
    heroin almost 6 years
    @AmitabhaBiswas you need to set path instead of "/" in the command to search in specific folder.
  • Trect
    Trect about 4 years
    This works better