LinuxQuestions.org
Review your favorite Linux distribution.
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-29-2005, 12:40 PM   #1
obnascar
Member
 
Registered: Aug 2005
Location: Wisconsin USA
Posts: 185

Rep: Reputation: 30
Idiot can not change directory in terminal


ok, I have lost my mind somewhere. When trying to change directories in a terminal, I use this:

(user terminal) xxxxx@xxxxx:~$ cd /my directory name

but it shows me "No such file or directory"
What are the symbols "~$" for, what is that ? I am using ubuntu.

(root terminal) xxxxx@xxxxx: cd /my directory name
Same results.

I have done all kinds of searches, they don't show anything different than I already am doing. Either that or none of them explain it very well or they are leaving something out or I am indead an idiot.....lol

I welcome anyone that can help me !

Last edited by obnascar; 09-29-2005 at 02:11 PM.
 
Old 09-29-2005, 12:43 PM   #2
murder
LQ Newbie
 
Registered: Aug 2005
Posts: 29

Rep: Reputation: 15
use a reletive path rather than the absolute like if your in "/usr" and you wanna goto "local" use "cd local"(<--relative) or "cd /usr/local" (<--Absolute)
 
Old 09-29-2005, 12:57 PM   #3
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Originally posted by obnascar
What are the symbols "~$" for
One is an abbreviation, and one is an end-of-prompt indicator.

The '~' is an abbreviation for your home directory. In a slightly modified version of the example you gave (xxxx@yyyy:~$), "xxxx" is the name of the user currently logged in, "yyyy" is the name of the host machine (so, user@host), the ~ says that the current directory is the user's home directory, and the '$' indicates the end of the prompt. In total, it reads something like this: "user@host:directory$"

When you became root, the '$' probably changed to '#'. It means the same thing: end of the prompt, but it's a visual indicator that you should be careful; you're running as root.

Last edited by Dark_Helmet; 09-29-2005 at 12:58 PM.
 
Old 09-29-2005, 01:01 PM   #4
obnascar
Member
 
Registered: Aug 2005
Location: Wisconsin USA
Posts: 185

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by murder
use a reletive path rather than the absolute like if your in "/usr" and you wanna goto "local" use "cd local"(<--relative) or "cd /usr/local" (<--Absolute)
No, the relative path did not work for me either, Hmmmmmm ?
 
Old 09-29-2005, 01:07 PM   #5
bigfez
LQ Newbie
 
Registered: Mar 2005
Posts: 29

Rep: Reputation: 15
so following from Dark_Helmet's example you can use the tilde (~) as an absolute path to your home directory.

xxxxx@xxxxx:~$ cd ~/my directory name/

will still give you a no such file error.
in *nix spaces in directory names are bad bad bad (well, more of a pain in the ass) because they need to be escaped.

so

xxxxx@xxxxx:~$ cd ~/my\ directory\ name/

should let you change to that directory under your home directory. if you are already in your home directory, then you can leave off the ~ AND the / and you will get the same effect. the initial / is not just a divider, it's an actual place, the root of your file system, so any path that starts with a / is an absolute path.
 
Old 09-29-2005, 01:17 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Not trying to confuse the situation, but if you don't like escaping the spaces, you can use double quotes instead. So an alternative to bigfez's command would be:

cd "~/my directory name"
 
Old 09-29-2005, 02:01 PM   #7
obnascar
Member
 
Registered: Aug 2005
Location: Wisconsin USA
Posts: 185

Original Poster
Rep: Reputation: 30
bigfez, Dark_Helmet, murder, thanks for your replies (BIG TIME)

I am not just sure what I was doing wrong but I got it now. The funny part of this is about two weeks ago I was doing it right with no problem. I think I got confused of what directory I was actually in at the prompt. I will be sure to add this post to my computer library directory. Thanks all.......

root@ubuntu:~ # cd /home/jerryo
root@ubuntu:/home/jerryo #

root@ubuntu:/home/jerryo # cd TarDownloads
root@ubuntu:/home/jerryo/TarDownloads #
 
Old 09-29-2005, 06:28 PM   #8
hlpboplz
Member
 
Registered: May 2005
Location: West Central Alabama
Distribution: Fedora Core 4
Posts: 34

Rep: Reputation: 15
Quote:
Originally posted by obnascar
bigfez, Dark_Helmet, murder, thanks for your replies (BIG TIME)

I am not just sure what I was doing wrong but I got it now. The funny part of this is about two weeks ago I was doing it right with no problem. I think I got confused of what directory I was actually in at the prompt. I will be sure to add this post to my computer library directory. Thanks all.......

root@ubuntu:~ # cd /home/jerryo
root@ubuntu:/home/jerryo #

root@ubuntu:/home/jerryo # cd TarDownloads
root@ubuntu:/home/jerryo/TarDownloads #
Typing pwd at the prompt will tell you where in the directory tree you currently are.
See example:
[bo@bolinuxdt ~]$ pwd >enter<
/home/bo <out put>
[bo@bolinuxdt ~]$ <back to prompt>
 
  


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
How to change directory windefault Linux - Newbie 5 11-02-2004 04:28 AM
cant change directory permission? dwarf007 Linux - General 1 09-24-2004 09:35 AM
How to change directory? bngrhl Linux - Newbie 5 05-16-2004 01:20 AM
script to change directory trout21 Linux - Newbie 9 02-17-2004 12:49 PM
mountig - change ro to rw, delete directory, change rw to ro ?? itsjustme Linux - General 6 10-17-2003 11:48 AM


All times are GMT -5. The time now is 01:37 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