Podcast
Questions and Answers
What happens if you don't start your path with a slash?
What happens if you don't start your path with a slash?
- You will get an error message
- The home directory is the assumed starting point
- The current directory is the assumed starting point (correct)
- The root directory is the assumed starting point
What is the command to show the current directory?
What is the command to show the current directory?
- ls -a
- pwd (correct)
- cd ~
- cd pwd
What is the purpose of the tab key in path completion?
What is the purpose of the tab key in path completion?
- To delete incorrect paths
- To list the contents of a directory
- To show hidden files
- To expand the command line to a correct path (correct)
What is the effect of typing 'cd home' when the current directory is '/home/paul'?
What is the effect of typing 'cd home' when the current directory is '/home/paul'?
What is the purpose of the 'ls -a' command?
What is the purpose of the 'ls -a' command?
What happens when you type 'cd /paul' from the '/home' directory?
What happens when you type 'cd /paul' from the '/home' directory?
What is the effect of typing 'cd home' when the current directory is '/'?
What is the effect of typing 'cd home' when the current directory is '/'?
What is a hidden file in a Linux file system?
What is a hidden file in a Linux file system?
What does the pwd
command do?
What does the pwd
command do?
What is the effect of typing cd
without a target directory?
What is the effect of typing cd
without a target directory?
What is the purpose of the cd..
command?
What is the purpose of the cd..
command?
What does the cd -
command do?
What does the cd -
command do?
What is an absolute path?
What is an absolute path?
What is the purpose of the cd ~
command?
What is the purpose of the cd ~
command?
What is the effect of typing cd.
?
What is the effect of typing cd.
?
What is the main difference between absolute and relative paths?
What is the main difference between absolute and relative paths?
Study Notes
Working with Directories
- The
pwd
command displays the current working directory. - The
cd
command is used to change the current directory. cd
without a target directory will put you in your home directory.cd ~
is a shortcut to get back into your home directory.cd ..
is used to go to the parent directory.cd .
is used to stay in the current directory.cd -
is used to go to the previous directory.
Absolute and Relative Paths
- Absolute paths start with a slash (/) and are relative to the root of the file tree.
- Relative paths do not start with a slash and are relative to the current directory.
- When in the root directory, both absolute and relative paths can be used.
Path Completion
- The tab key can be used to complete a path without errors.
- The tab key will expand the command line to the correct path if it exists.
ls Command
- The
ls
command is used to list the contents of a directory. - The
-a
option is used to show all files, including hidden files. - Hidden files start with a dot (.) and are not shown by default.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn basic Linux commands for working with directories, including pwd, cd, ls, mkdir, and rmdir, as well as absolute and relative paths and path completion in the bash shell.