With /Home
you are probably referring to what in Nautilus is signified with 'Home'. The name of this folder actually is not "Home". This folder is named /home/ in the filesystem. /home
is the folder which contains all the users Home-folders. (Which explains why you need sudo
to do anything there.) /home/username
is the personal folder of that user.
So, you can type cd /home/
and press tab to see which options you have (or if you're the only user it will autocomplete your username). ls /home
will list all the files and folders in /home
. If you have anything there, I would highly recommend moving it to your personal folder, since that's much cleaner.
Faster ways you can cd back to it, are cd
(without arguments) or cd ~
(with a possible path behind it, like ~/Pictures )
A /
at the end of the name of a directory/folder is optional. Most of the time, including or omitting the final slash in a directory name does not change the effect of a command.
So cd ../
is equivalent to cd ..
.
Paths that don't start with a /
are relative paths; they are resolved relative to the current directory.
Every directory has two special entries:
- a directory entry called
.
that resolves to the directory itself
- a directory entry called
..
that resolves to the directory's parent (i.e., the directory that contains that directory)
Therefore cd ../
and cd ..
change directory to the parent of the current directory. Thus, if you start out in /home/fazlan
and run cd ..
or cd ../
, you'll end up in /home
.
In contrast, /..
is an absolute path (albeit an unusual one). /
is the filesystem root--the directory you get to if you go up in the directory hierarchy all the way. (Using the same parent and child metaphor, we say /
is the ancestor of everything in the filesystem.)
Since ..
means "the parent directory of this directory" and /
means "the top of the filesystem," /..
means "the parent directory of the top of the filesystem."
But what does it mean to talk about the directory that contains /
? Well, /
is an exception. Since no directory contains it, we say that /
's parent is itself. Therefore, in /
, ..
is /
. Consequently, /..
is the same as /
.
This is why cd ../
brings you up one directory from where you started, while cd /..
brings you to the very top. More elegant and easily read ways to do these things are cd ..
and cd /
, respectively.
Best Answer
If you're coming to the Linux world (taking Ubuntu flavour as your choice or other one) from the Microsoft Windows world, then these folder structures might seem very confusing.
To answer your question, let me give a very brief introduction to the Linux filesystem. In a Linux filesystem every possible and accessible files, folders are created under the "root" filesystem and in Linux system it's denoted as "/" symbol (unlike Windows, where different Drives are created, named C:, D: etc. and you can create and store your files and folders inside those drives). In Windows, the OS is most of the time installed in C: drive. In Linux, everything comes under / (aka "root" directory). When you install the Ubuntu OS, you'll notice that, several existing folders are already there inside /. Open nautilus and click "File system" (or in some new version "Computer" under Devices) in the left sidebar. This is actually what is inside /. Among those folders there are two named "root" and "home".
Now, In every Linux system, there is a root user who has all the power to change anything inside the OS (the super-admin ;), as I like to call it). You can create other users too. Whenever a new user is created, they'll have there own personal folder inside /home, e.g. /home/enigma (equivalent to C:\users\enigma in Windows). root user is the special one, who has one for his/her own directly under /, e.g. /root. Any user's personal directory is exclusively accessible to only that user (not technically only that user as root user can go & check & change anywhere). The other one with the same name as the User's name under /media is for mounting (beyond the scope of this discussion for mount, sorry, have to learn separately) storage devices like external HDD, Pendrive, CD/DVD etc. Modern Ubuntu handles them nicely and give a shortcut to those devices on the desktop. But, if you want to access those files through the terminal (command line), then you have to traverse like