Enrollments Open for Advanced Certification Courses on Data Science, ML & AI by E&ICT Academy IIT Roorkee
Apply NowA file is kept inside a directory. A directory can have a file or another directory inside it. It is like an inverted tree.
The top-level directory is "/" called root. "/" directory does not have a parent. /A/B means B is inside A which is inside the top-level directory "root" denoted by /
.
To see the list of files use the command: ls
There are two ways to represent a file/directory path:
Absolute: This way of representing a file/directory is independent of the current directory of the user. Such paths start with "/". Example: The absolute path is the path of the directory from the root directory, like the path of 'john' directory, is actually '/home/john' as you can see in the tree structure
Relative: Relative to the current working directory. Example: Consider that you're currently in directory projects
, the relative path from directory projects
to directory john
would be ../../../home/john
it is like tracing the path back to /
then to john
.
You can change the directory using the cd
command. Every user is given a separate home directory.
Inside the console, you are always in a directory. On login, by default, you land in your home directory.
To see the present working directory use: pwd
To change the directory to your home directory use only cd
command without any arguments.
No hints are availble for this assesment
Answer is not availble for this assesment
Loading comments...