Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to find a directory, using the terminal and I am not sure where it is. I mean that i used the wget command to obtain the file and used it for installation and now i am not able to find where I kept it.

I did try,

find . -type f -name "postgis-2.0.0"

also

locate postgis-2.0.0

But with no luck. What is the command to find a directory in your desktop?

share|improve this question

3 Answers 3

up vote 20 down vote accepted

Try find ~/ -type f -name "postgis-2.0.0" instead.

Using . will only search the current directory. ~/ will search your entire home directory (likely where you downloaded it to). If you used wget as root, its possible it could be somewhere else so you could use / to search the whole filesystem.

Goodluck

share|improve this answer
    
oh ya i used wget as root so / worked thanks –  Sam007 May 31 '12 at 17:09
    
@Sam007 Glad to have helped. If this answer solved your problem you can accept it using the check mark to the left of it. Edit: although I actually like reverendj1's answer better... so maybe upvote me if it worked and give him the accepted answer :P –  adempewolff May 31 '12 at 17:11
    
ya actually I tried earlier and it said that I can accept it only after 8 min so I can now and voila!! –  Sam007 May 31 '12 at 17:23
    
lol, I gave you an upvote, since ur completely right and marked as anser, and I felt bad seeing didnt got upvoted xD –  Dr_Bunsen May 31 '12 at 17:45

find is one of the most useful Linux/Unix tools.

Try find . -type d | grep DIRNAME

share|improve this answer

I would try:

sudo find / -type d -name "postgis-2.0.0"

The . means search only in the current directory, it is best to search everything from root if you really don't know. Also, type -f means search for files, not folders. Adding sudo allows it to search in all folders/subfolders.

Your syntax for locate is correct, but you may have to run

sudo updatedb

first. For whatever reason, I never have good luck with locate though.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.