LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 05-04-2014, 03:34 PM   #1
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Rep: Reputation: 5
Directory access


I have a directory that I was trying to look into and couldn't get into it the normal way.

me@host~/.Mix$ ls -a
. mixrand.bin pool secring.pgp stats.log time.log
me@host~/.Mix$ cd /pool
-bash: cd: /pool: No such file or directory

When I tried it this way, it got in there:

me@host~/.Mix$ ls -a
. mixrand.bin pool secring.pgp stats.log time.log
me@host~/.Mix$ cd \pool
me@host~/.Mix/pool$

What is going on here?
 
Old 05-04-2014, 03:38 PM   #2
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
"/pool" is the wrong path - it refers to a directory called "pool" in /, rather than in the current directory (i.e. it's an absolute path, rather than a relative one).
 
Old 05-04-2014, 03:45 PM   #3
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by ndc85430 View Post
"/pool" is the wrong path - it refers to a directory called "pool" in /, rather than in the current directory (i.e. it's an absolute path, rather than a relative one).
root@host~# cd /root
root@host~# ls -a
. .. .aptitude .bash_history .bashrc .nano_history .profile .ssh

root@host~# cd /
root@host/# ls -a
. bin dev home lib media opt root sbin srv tmp var
.. boot etc initrd.img lost+found mnt proc run selinux sys usr vmlinuz
root@host/#

Ok, but I don't see it in /root or /. Where is it finding pool?

And since it is a directory, why can I not look into it?

Last edited by battles; 05-04-2014 at 03:46 PM.
 
Old 05-04-2014, 03:46 PM   #4
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
Reread the output from your first post:

Quote:
-bash: cd: /pool: No such file or directory
This is correct, because there's no directory called "pool" in /.
 
Old 05-04-2014, 03:56 PM   #5
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Quote:
Originally Posted by ndc85430 View Post
Reread the output from your first post:



This is correct, because there's no directory called "pool" in /.

Thanks. I have not been understanding how to use the cd command correctly. When moving within your own user account, you don't use the /. If wanting to look outside the user account, then you use the /, such as cd /etc/...
 
Old 05-04-2014, 04:01 PM   #6
ndc85430
Member
 
Registered: Apr 2014
Distribution: Slackware
Posts: 92

Rep: Reputation: Disabled
You'd probably do well to read about absolute and relative paths. See this, for example.
 
Old 05-04-2014, 04:24 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,976

Rep: Reputation: 1283Reputation: 1283Reputation: 1283Reputation: 1283Reputation: 1283Reputation: 1283Reputation: 1283Reputation: 1283Reputation: 1283
Quote:
When moving within your own user account, you don't use the /. If wanting to look outside the user account, then you use the /, such as cd /etc/...
It's not being in your /home/user directory that matters although if you are in your /home/user directory and want to go to the Desktop directory of that user, you just do: cd Desktop/. If you are in a directory and want to change to a first level sub-directory there you do not need the forward slash. So you are right in that if you want to leave the directory you are in and go to another directory that is at the same level, you need the forward slash. As in your example, if you are in /home/user and want to access a file in /etc, you would need the forward slash.
 
Old 05-04-2014, 05:11 PM   #8
battles
Member
 
Registered: Apr 2014
Distribution: Debian GNU/Linux 7.5 (wheezy)
Posts: 231

Original Poster
Rep: Reputation: 5
Thanks, I have looked at the link and read your alls explanations. I will probably have to experiment to be sure that I understand.
Thanks again.
 
  


Reply


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
Access to Directory mah454 Linux - General 3 12-01-2012 06:20 AM
[SOLVED] access directory outside of home directory? runinguy Linux - Newbie 7 04-16-2010 02:13 AM
How to access the nodes under the /dev directory to access the device? Nishant Desai Programming 2 11-18-2006 05:09 PM
Samba access by Windows users locking out directory access with Konqueror harry_fine SUSE / openSUSE 1 12-18-2004 06:33 AM
directory access iquadri1 Linux - Networking 0 09-29-2001 02:35 PM


All times are GMT -5. The time now is 10:55 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration