LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-09-2012, 04:26 AM   #1
gselvam
LQ Newbie
 
Registered: Aug 2011
Posts: 6

Rep: Reputation: Disabled
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
 
Old 07-09-2012, 04:28 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
well the literal equivalent would be to type "cd /" if that's what you mean. OR "cd .." enough times too, just like DOS.
 
Old 07-09-2012, 04:28 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
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
 
2 members found this post helpful.
Old 07-09-2012, 04:50 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by acid_kewpie View Post
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.
 
1 members found this post helpful.
Old 07-09-2012, 06:59 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,403

Rep: Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783Reputation: 2783
@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/
 
1 members found this post helpful.
Old 07-09-2012, 07:17 PM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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....
 
Old 07-09-2012, 08:50 PM   #7
nixblog
Member
 
Registered: May 2012
Posts: 426

Rep: Reputation: 53
Quote:
Originally Posted by gselvam View Post
Can you please also tell me the basic linux file structure.
Quite a useful Youtube video on this is here.
 
Old 07-09-2012, 10:23 PM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
  


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
[SOLVED] Seperating Home folder from Root Folder to a new partition. baxzius Linux - Newbie 5 08-01-2011 03:26 PM
write access to a Windows partition folder from Linux (as root) dows Linux - Newbie 5 02-02-2011 12:37 AM
Root folder J@kk%h1t Linux - Newbie 5 03-09-2007 05:01 PM
permissions difference between /home/..../folder and /root/folder darkleaf Linux - General 3 07-21-2005 05:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:16 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
Open Source Consulting | Domain Registration