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?
What is the command to show the current directory?
What is the command to show the current directory?
What is the purpose of the tab key in path completion?
What is the purpose of the tab key in path completion?
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'?
Signup and view all the answers
What is the purpose of the 'ls -a' command?
What is the purpose of the 'ls -a' command?
Signup and view all the answers
What happens when you type 'cd /paul' from the '/home' directory?
What happens when you type 'cd /paul' from the '/home' directory?
Signup and view all the answers
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 '/'?
Signup and view all the answers
What is a hidden file in a Linux file system?
What is a hidden file in a Linux file system?
Signup and view all the answers
What does the pwd
command do?
What does the pwd
command do?
Signup and view all the answers
What is the effect of typing cd
without a target directory?
What is the effect of typing cd
without a target directory?
Signup and view all the answers
What is the purpose of the cd..
command?
What is the purpose of the cd..
command?
Signup and view all the answers
What does the cd -
command do?
What does the cd -
command do?
Signup and view all the answers
What is an absolute path?
What is an absolute path?
Signup and view all the answers
What is the purpose of the cd ~
command?
What is the purpose of the cd ~
command?
Signup and view all the answers
What is the effect of typing cd.
?
What is the effect of typing cd.
?
Signup and view all the answers
What is the main difference between absolute and relative paths?
What is the main difference between absolute and relative paths?
Signup and view all the answers
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.