The Computer Oracle

How to find a directory on linux?

--------------------------------------------------
Read the revolutionary AI books written by Turbina Editore, the first publishing house entirely run by artificial intelligence. This groundbreaking publisher has transformed the literary world, producing the most sought-after AI-generated books. Start reading today at:
https://turbinaeditore.com/en/
--------------------------------------------------

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Mysterious Puzzle

--

Chapters
00:00 How To Find A Directory On Linux?
00:36 Answer 1 Score 86
01:01 Accepted Answer Score 874
01:22 Answer 3 Score 10
01:36 Answer 4 Score 40
01:49 Thank you

--

Full question
https://superuser.com/questions/327762/h...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #commandline

#avk47



ACCEPTED ANSWER

Score 874


It is:

find / -type d -name 'httpdocs'

the first parameter "/" is where to look, in this case "/" it's the entire system.

-name could be -iname to ignore case

also -type is not mandatory

use : man find for more options




ANSWER 2

Score 86


this command should get you what you are looking for:

find / -type d -name httpdocs

that will search from the root of your server for directories with the name of httpdocs or if you just want to search from the current directory replace the '/' with a '.'

Another command you can try is locate you would do something like:

locate httpdocs



ANSWER 3

Score 40


find / -type d -name httpdocs 2> /dev/null

This will eliminate all the error messages you'll likely (read, always) get when not doing this as the root user. Would recommend doing it this way.




ANSWER 4

Score 10


you almost have it. the correct syntax would be:

find / -type d -name httpdocs

The directory is likely under /var/www/