Navigate to

Florian Diesch diesch at spamfence.net
Wed May 31 13:18:51 UTC 2006


Avraham Hanadari <rufus at hanadari.net> wrote:

> On Mon, 2006-05-29 at 01:56 +0200, Florian Diesch wrote:
>> Avraham Hanadari <rufus at hanadari.net> wrote:
>> 
>> > While in the process of trying to install the downloaded file, however,
>> > I was instructed to "navigate to the folder" and then key a command
>> > line. I tried to write the path to where the installation file was, but
>> > that didn't work. What is meant by "navigate to" and how is it done?
>> 
>> You have to open a Terminal window. There you type 
>>  cd /the/folder/they/told/you
>> 
>> 
>> "cd" means "change directory" (on unix-like platforms you often use
>> "directory" instead of "folder")

> cd was a command in DOS days. 

If you have some DOS knowledge (a lot of people today don't have) you
have at least some basic knowledge about how to work with a shell. You
may think of the bash as something like a DOS shell with additional 25
years of development.

The "From DOS/Windows to Linux HOWTO" may be a good starting point for
you. After installing the package doc-linux-nonfree-html you find it at 
/usr/share/doc/HOWTO/en-html/DOS-Win-to-Linux-HOWTO.html 
It's somewhat dated but still usable.


> I used it now and this is what I got:
> rick at DeepThought:~$ cd /rick
> bash: cd: /rick: No such file or directory


After login you are in your home directory. ~ is a shorthand for that.
You see you current working directory at the prompt between the : and $.
The command
 pwd
("print working directory") tells you where you are without the ~ shorthand.


Paths starting with / are absolute paths like paths in DOS that start
with something like c:\

> rick at DeepThought:~$ cd /home
> bash: cd: /home: No such file or directory

That's strange as per standard your home dir is /home/username.

> rick at DeepThought:~$ sudo cd /rick
> Password:
> sudo: cd: command not found

Using sudo with cd doesn't work for some reasons:
 * cd is a shell build in and you can't use sudo with it
 * It would be useless as if you are not allowed to change to that 
   directory you aren't allowed to stay there.
 * Even if you could stay there id would be useless as the working
   directory is not some kind of global state but a property of a
   process (that's why cd is a shell build in). So if sudo cd /rick 
   would work it wouldn't give you anything as any effect of cdd would
   be lost after sudo has finished (which is right after cd has finished)



   Florian
-- 
<http://www.florian-diesch.de/>




More information about the ubuntu-users mailing list