0

I am inside the home directory of a Linux machine (which I logged into using Putty).

From there on I need to find a folder named my-web1.0.

Is there any way to go know the path of that directory named my-web1.0?

Tamara Wijsman
58k28 gold badges190 silver badges258 bronze badges
asked Oct 26, 2011 at 7:16
1
  • 1
    locate can be handy and fast if you are running updatedb already Commented Oct 26, 2011 at 10:42

3 Answers 3

4

You can use the find command:

find $HOME -name my-web1.0 -type d -print

If that doesn't produce any results, the folder is probably somewhere else. Try / instead of $HOME but that might take some time (searches the whole disk).

[EDIT] That will print the path. Use cd "path" to go there. The quotes are only necessary when the path contains spaces.

answered Oct 26, 2011 at 7:19
2
  • 1
    And if you use / as path, append a 2>/dev/null at the end of the command. Commented Oct 26, 2011 at 7:20
  • Do notice the original question also asked "how to go to the path", this answer merely replies how to find the path. Commented Oct 26, 2011 at 7:22
1

if my-web1.0 is within your home folder:

cd ~
find . -type d -name 'my-web1.0'

if you don't know where it is at all:

find / -type d -name 'my-web1.0'
answered Oct 26, 2011 at 7:18
0

Try using the tree view

sudo apt-get install tree

then

tree -L 1

or just use

tree

You can obtain more information about it using

man tree
Tamara Wijsman
58k28 gold badges190 silver badges258 bronze badges
answered Oct 26, 2011 at 7:22

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.