LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to go to root folder in Linux (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-go-to-root-folder-in-linux-4175415650/)

gselvam 07-09-2012 04:26 AM

How to go to root folder in Linux
 
What is the command to go to root folder in Linux.

Can you please also tell me the basic linux file structure.

Ex In dos

We have root folder, then sub folder1, then sub folder2
I can go to root from subolder by typing CD.
or CD..

How to do in Linux

acid_kewpie 07-09-2012 04:28 AM

well the literal equivalent would be to type "cd /" if that's what you mean. OR "cd .." enough times too, just like DOS.

EricTRA 07-09-2012 04:28 AM

Hello,

The 'cd' command also exists in Linux. For a good basic starting point, have a look at the Rute User's Tutorial and Exposition.

Kind regards,

Eric

acid_kewpie 07-09-2012 04:50 AM

Quote:

Originally Posted by acid_kewpie (Post 4722770)
well the literal equivalent would be to type "cd /" if that's what you mean. OR "cd .." enough times too, just like DOS.

Actually, I just remembered that under DOS it's "cd.." compared to "cd ..". This is a great example of how shi**y DOS really is, how they took bits of consistent UNIX convention and just broke them enough to make NO sense. ".." referred to the parent directory in the unix filesystem long before it did in DOS. So it makes sense to have a space in there, so the usage of the cd command is consistent. You wouldn't expect "cdmy_new_directory" to work in DOS, so why should "cd.."? See also "echo some_string > com1". DOS just magically pulls a reference to a serial port out of the air, when redirecting anything to a different name would make a text file containing it... stupid.

chrism01 07-09-2012 06:59 PM

@OP; here's some useful links and note also that Linux cmds are lower-case and in fact Linux is case sensitive for cmds, names (eg files, dirs etc) and usually params as well...

http://rute.2038bug.com/index.html.gz
http://tldp.org/LDP/Bash-Beginners-G...tml/index.html
http://www.tldp.org/LDP/abs/html/

pixellany 07-09-2012 07:17 PM

Add this to the reading list:
http://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/

Quote:

This is a great example of how shitty DOS really is, how they took bits of consistent UNIX convention and just broke them enough to make NO sense.
It **sorta** makes sense if you consider that MS is not a technology company, but rather a marketing company.

Also, you forgot to mention that DOS has all the "/"s backwards....;)

nixblog 07-09-2012 08:50 PM

Quote:

Originally Posted by gselvam (Post 4722769)
Can you please also tell me the basic linux file structure.

Quite a useful Youtube video on this is here.

theNbomr 07-09-2012 10:23 PM

In Linux the top level directory, the parent of all directories, the 'root' of the filesystem is '/'. As humans we call this the the root directory, however there is possibly anther directory that you might be thinking of; '/root', which is the home directory of the user 'root'. In either case, in all shells that I know of, the command 'cd' can be used to navigate to any specified directory, including '/', or '/root'.

--- rod.


All times are GMT -5. The time now is 06:40 AM.