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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-09-2012, 04:26 AM
|
#1
|
LQ Newbie
Registered: Aug 2011
Posts: 6
Rep:
|
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
|
|
|
07-09-2012, 04:28 AM
|
#2
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
well the literal equivalent would be to type "cd /" if that's what you mean. OR "cd .." enough times too, just like DOS.
|
|
|
07-09-2012, 04:28 AM
|
#3
|
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
|
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.
|
07-09-2012, 04:50 AM
|
#4
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
Quote:
Originally Posted by acid_kewpie
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.
|
07-09-2012, 07:17 PM
|
#6
|
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809
|
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....
|
|
|
07-09-2012, 08:50 PM
|
#7
|
Member
Registered: May 2012
Posts: 426
Rep:
|
Quote:
Originally Posted by gselvam
Can you please also tell me the basic linux file structure.
|
Quite a useful Youtube video on this is here.
|
|
|
07-09-2012, 10:23 PM
|
#8
|
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
|
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 01:16 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|