File System Navigation Flashcards
7 cards from real Linux practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 7 File System Navigation flashcards as text
Which command displays the full path of the current working directory?
Answer: pwd
The `pwd` (print working directory) command outputs the absolute path of the current directory.
What does the `cd -` command do in Linux?
Answer: Switches to the previous working directory
`cd -` switches to the previous working directory stored in the $OLDPWD variable.
Which command lists directory contents sorted by modification time, newest first?
Answer: ls -lt
`ls -lt` sorts output by modification time with the newest files listed first.
What is the absolute path of the home directory for the root user on most Linux systems?
Answer: /root
The root user's home directory is `/root`, not under `/home` like regular users.
Which `find` command option limits the search depth to 2 directory levels?
Answer: -maxdepth 2
The `-maxdepth 2` option tells `find` to descend at most 2 levels below the starting point.
What does `ls -d */` display?
Answer: Only directories in the current location
`ls -d */` matches and lists only directories (the trailing slash selects directories, `-d` prevents recursion).
Which variable stores the path to the current user's home directory?
Answer: $HOME
The `$HOME` environment variable holds the absolute path of the current user's home directory.