LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-19-2011, 05:21 AM   #1
shik28
LQ Newbie
 
Registered: Sep 2011
Location: India
Posts: 25

Rep: Reputation: Disabled
Question Find a directory


I am logged in as shik28 to a remote system. I have to locate a directory /log in it.

But when I hit ls in the root directory, it does not display /log anywhere. But when I say cd /log there is no error. How to find where exactly /log is present?
 
Old 09-19-2011, 05:48 AM   #2
hi2arun
Member
 
Registered: Apr 2010
Distribution: Fedora
Posts: 109
Blog Entries: 4

Rep: Reputation: 33
By 'root directory', do you mean '/root' or '/'?
 
Old 09-19-2011, 05:51 AM   #3
shik28
LQ Newbie
 
Registered: Sep 2011
Location: India
Posts: 25

Original Poster
Rep: Reputation: Disabled
@hi2arun: I meant home directory. What is the difference between /root and /?
 
Old 09-19-2011, 05:57 AM   #4
samtoddler
Member
 
Registered: Jul 2011
Location: Delhi
Distribution: Cent OS/RHEL
Posts: 37

Rep: Reputation: Disabled
Hi,

where you have executed ls command in the /root (which is home of superuser directory) or / (which is the filesystem root.
make sure where you trying to find out the directory.

execute
Code:
 ll
in the exact directory

or may be there are situations where you have mounted a filesystem but after reboot it's not mounted.

samtoddler
 
Old 09-19-2011, 06:16 AM   #5
shik28
LQ Newbie
 
Registered: Sep 2011
Location: India
Posts: 25

Original Poster
Rep: Reputation: Disabled
The command is not executed in superuser directory. It is executed in user's home directory.
 
Old 09-19-2011, 06:25 AM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,500

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
Code:
It is executed in user's home directory.
Quote:
cd /log
the "log" directory is a subdirectory from "/"
When you are in
Code:
/home/user
ls will show the files and directories from "/home/user"
To see the files/directories from "/",
you need to be in the "/" directory
Code:
cd /
ls
Some info on the linux file system:
http://www.thegeekstuff.com/2010/09/...tem-structure/
http://www.debianadmin.com/linux-dir...-overview.html

Kind regards
 
1 members found this post helpful.
Old 09-19-2011, 06:26 AM   #7
linux1986
LQ Newbie
 
Registered: Sep 2011
Distribution: redhat
Posts: 14

Rep: Reputation: Disabled
Hello,

Check where you are

#pwd

you can check the location of log dir using following command

find / -type d -name log
 
Old 09-20-2011, 12:21 AM   #8
shik28
LQ Newbie
 
Registered: Sep 2011
Location: India
Posts: 25

Original Poster
Rep: Reputation: Disabled
@repo and @linux1986: Thanks a lot!
 
  


Reply

Tags
cd, directory, find, remote, root


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to find a particular string!! from a Directory anishkumarv Linux - Newbie 8 07-28-2011 01:10 PM
Find directory older than x and mv directory with sub files command ajhart Linux - Newbie 4 07-15-2011 05:24 AM
[SOLVED] Find Directory only doby48 Linux - Newbie 4 07-19-2010 04:14 PM
find exactly in that directory basak Linux - Newbie 1 08-21-2006 08:26 AM
How do I find out when a directory was created? gumpish Linux - Newbie 1 09-29-2004 08:12 PM


All times are GMT -5. The time now is 01:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration