WGU D281 Linux Foundations - Udemy Section 2: Lesson 5 - Managing Files and Data questions with complete verified solutions 2025

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/520

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

521 Terms

1
New cards

Describe where you would find most application files on the Linux system:

Applications that are critical and that most normal users would run are normally stored in the /bin directory. Applications that are critical but mostly used by the administrator are stored in the /sbin category. Noncritical applications are normally stored in the /usr director (MU1_Ch7_ExamEssentials)

2
New cards

Explain the basic commands to create, copy, move, or delete a file:

You can create an empty file using the touch command. In Linux you can copy files using cp command, or move a file into the a new file name by using mv command. To delete a file, use rm command. (MU1_Ch7_ExamEssentials)

3
New cards

Describe the /tmp directory and what Linux uses it for:

The /tmp directory is intended for temporary files that do not need to be saved. Theoretically the Linux system can clear out any files in the /tmp directory when it reboots, although many Linux distributions don't do that. However, never expect a file that you store in the /tmp directory to be there after the next system reboot. (MU1_Ch7_ExamEssentials)

4
New cards

Which of the following commands would you type to rename newfile.txt to afile.txt?

(A) mv newfile.txt afile.txt

(B) cp

(C) ln

(D) rn

(E) touch

mv newfile.txt afile.txt

(Explanation: The mv command is used both to move and rename files. In this case, you're renaming the file from newfile.txt to afile.txt.)

(MU1_Ch7_ReviewQs)

5
New cards

You want to copy a directory, MyFiles, to a USB flash drive that uses FAT filesystem. The contents of MyFiles are as follows:

$ ls MyFiles/

contract.odt

outline.pdf

Outline.PDF

The USB flash drive is mounted at /media/usb, and so you type cp -a MyFiles/media/usb. What problem will occur when you attempt to copy these files?

(A) The command will fail because it tries to create links.

(B) The MyFiles directory will be copied, but none of its files will be copied.

(C) One file will be missing on the USB flasher flash drive.

(D) One file's name will be changed during the copy.

(E) Everything will be fine; the command will work correctly.

One file will be missing on the USB flash drive

(Explanation: FAT filesystems are not case-sensitive. So outline.pdf and Outline.PDF will be seen as the same file. One will overwrite the other during the copy.)(MU1_Ch7_ReviewQs)

6
New cards

You type mkdir one/two/three and receive an error message that reads, in part No such file or directory. What can you do to overcome this problem? (Choose all that apply.)

(A) Add the --parents parameter to the mkdir command

(B) Issue three separate mkdir commands; mkdir one, then mkdir one/two, and then mkdir one/two/three.

(C) Type touch /bin/mkdir to be sure the mkdir program file exists.

(D) Type rmdir one to clear away the interfering base of the desired new directory tree.

(E) Type rm -r one to clear away the entire interfering directory tree.

Add the --parents parameter to the mkdir command & Issue three separate mkdir commands

(Explanation:

mkdir --parents one/two/three or mkdir -p one/two/three creates all necessary parent directories. You can also create them step-by-step with separate commands. (C), (D), and (E) are not helpful or appropriate in this context.)

(MU1_Ch7_ReviewQs)

7
New cards

You can create a symbolic link from low-level filesystem to another. True or False?

True

(Explanation: Symbolic links (symlinks) can span across different filesystems because they reference file paths, not physical locations.)

(MU1_Ch7_ReviewQs)

8
New cards

You can easily damage your Linux installation by mistyping an rm command when you log into your regular account. True or False?

False

(Explanation: A regular user doesn't have permission to delete critical system files. You'd typically need root privileges for that. However, you can damage your own files.)

(MU1_Ch7_ReviewQs)

9
New cards

You can set directory's time stamps with the touch command. True or False?

True

(Explanation: The touch command updates the access and modification timestamps of files and directories.)(MU1_Ch7_ReviewQs)

10
New cards

You want to copy a file (origfile.txt) to backups directory, but if a file called origfile.txt exists in the backups directory, you want to go ahead with the copy only if the file and the source location is newer than the one in the backups. The command to do this is cp _____ origfile.txt backups/.

(A) -f

(B) -r

(C) -s

(D) -u

(E) -v

-u

(Explanation: The -u (update) option tells cp to copy the file only if the source file is newer than the destination file or if the destination file does not exist.)(MU1_Ch7_ReviewQs)

11
New cards

You've typed rmdir junk to delete the junk directory, but this command has failed because junk contains word processing files. a command that will work is ________________.

(A) rmdir -r junk

(B) rmdir -P junk

(C) rmdir -v junk

(D) rm -r junk

(E) rm -f junk

rm -r junk

(Explanation: rmdir only removes empty directories. To remove a directory and its contents recursively, use rm -r.)(MU1_Ch7_ReviewQs)

12
New cards

The ______ wildcard character matches any one symbol in a filename.

(A) ?

(B) _ (underscore)

(C) *

(D) . (period)

(E) - (dash)

?

(Explanation: The ? wildcard matches exactly one character in a filename.)

(MU1_Ch7_ReviewQs)

13
New cards

What directory primarily contains system configuration files?

(A) /bin

(B) /etc

(C) /usr

(D) /var

(E) /sbin

/etc

(Explanation: The /etc directory stores system-wide configuration files and shell scripts used to boot and initialize system settings.)

(MU1_Ch7_ReviewQs)

14
New cards

Describe using basic regular expressions:

Regular expressions are used with programs, such as grep, to match text data with patterns. Bracket regular expressions are characters enclosed in square brackets, the brackets represent a single character and that character may match anyone character within the brackets. A variation of bracket expressions is arranged expression where you designate a range of potential character matches by using the first and last possible character with a dash between them, such as [a-z]. When you need to match a single character but that character can be anything, use a question mark instead of a bracket expression. If the pattern you are searching for is at the beginning of a text line, put a ^ before the pattern. If it is at the end of the line, tack a dollar sign on to the pattern's end. To specify a pattern that can match with any substring, use the dot asterisk (*). (MU1_Ch8_ExamEssentials)

15
New cards

Summarize the commands used to search for and extract data:

Use the grep command to search for a specified string or regular expression pattern within a file or directory of files. To locate files in a specified directory tree by their name, size, owner, creation date, or other data, use the find utility. If you want to display a file, the cat command can help, and it will also display multiple files one after the other or concatenate them to your screen. To see only the first 10 lines of a file, use head, and for the last 10 lines, use tail command. If you want to display a text file sorted, use the sort utility. To extract out only portions of text file records, use the cut command. if you'd like some statistical information about a text file, such as the # of lines, words, and bytes contained within it, then the wc tool is the one to use. (MU1_Ch8_ExamEssentials)

16
New cards

Explain how to redirect standard input and output:

Standard output is where normal program messages are sent, whereas error messages are sent to standard error and it is represented by the number 2 by the way. To send a command standard output to a file and overwrite the file's current contents, use the > operator. Use >> to append the output to the files existing data instead. For standard error, use the 2> operator to send a command's standard error to a file and overwrite the file's current contents and the 2>> operator to append the error messages instead. To send a programs output as input to another program, Use the pipe, which is a vertical bar (|), between the commands. (MU1_Ch8_ExamEssentials)

17
New cards

Detail archiving data with tar and zip:

The tar utility archives various files into a single file, called an archive file, which is sometimes compressed at the same time resulting in a tarball. Multiple options exist for use with tar, including long options, short options, and even the single-letter old-style options. The utility preserves Linux ownership and permission information, (and it uses special options to unpack and if needed to remove the compression) archive files. Also available to create tarball-like archives is a zip utility. Unlike with the tar program, you do not need to add special options to automatically compress the resulting archive file. However, you will need to use the unzip program to reverse the compression and unpack it. (MU1_Ch8_ExamEssentials)

18
New cards

Outline the compression utilities on Linux:

The gzip, bzip2, and xz Utilities can be used with tar or by themselves to compress files. The oldest is gzip and the one that provides the most compression is xz. To reverse their compression, use their corresponding "un" tools -- gunzip, bunzip2, and unxz.

(MU1_Ch8_ExamEssentials)

19
New cards

Which of the following commands will print lines from the file world.txt that contains the matches the changes and changed?

(A) grep change[ds] world.txt

(B) tar change[d-s] world.txt

(C) find "change'd|s'" world.txt

(D) cat world.txt changes changed

(E) find change[^ds] world.txt

grep change[ds] world.txt

(Explanation: The regular expression change[ds] matches changed and changes by allowing either d or s to follow change. The grep command searches for matching lines in the file.)

(MU1_Ch8_ReviewQs)

20
New cards

Which of the following redirection operators appends a program's standard output to an existing file without overwriting that file's original contents?

(A) |

(B) 2>

(C) &>

(D) >

(E) >>

>>

(Explanation:The >> operator appends output to the specified file, while > overwrites it.)

(MU1_Ch8_ReviewQs)

21
New cards

You've received a tar archive called data79.tar from a colleague, but you want to check the names of the files it contains before extracting them. Which of the following commands would you use to do this?

(A) tar uvf data79.tar

(B) tar cvf data79.tar

(C) tar xvf data79.tar

(D) tar tvf data79.tar

(E) tar Avf data79.tar

tar tvf data79.tar

(Explanation: The t option stands for "list," v for "verbose," and f for "file." So this command lists the contents of the archive without extracting them.)

(MU1_Ch8_ReviewQs)

22
New cards

The regular expression Linu[^x].*lds matches the string Linus Torvalds. True or False?

True

(Explanation:[^x] matches any character except x, and s in "Linus" satisfies this. Then .* matches any characters (like the space and "Torva") before lds. So it matches "Linus Torvalds".)

(MU1_Ch8_ReviewQs)

23
New cards

The find command enables you to locate files based on their sizes. True or False?

True

(Explanation:find can use the -size option to locate files of specific sizes (e.g., find . -size +100M).)

(MU1_Ch8_ReviewQs)

24
New cards

To compress files archived with zip, you must use an external compression program such as gzip or bzip2 in a pipeline with zip. True or False?

False

(Explanation:Unlike tar, the zip utility already compresses files. You don't need to pipe it into gzip or bzip2.)

(MU1_Ch8_ReviewQs)

25
New cards

The character that represents the start of a line in a regular expression is _______________.

(A) ^

(B) $

(C) |

(D) (

(E) "

^

(Explanation:The caret (^) denotes the start of a line in regular expressions.)

(MU1_Ch8_ReviewQs)

26
New cards

The _____________ command can extract specified data fields from a file's records.

(A) grep

(B) cut

(C) sort

(D) find

(E) cat

cut

(Explanation:The cut command can be used to extract fields from text based on delimiters (e.g., cut -d',' -f1 for the first field of a CSV).)

(MU1_Ch8_ReviewQs)

27
New cards

Complete the following command to redirect both standard output and standard error from the bigprog program to file out.txt.

$ bigprog ________ out.txt

(A) |

(B) 2>

(C) &>

(D) >

(E) >>

&>

(Explanation:&> redirects both standard output and standard error to the same file in Bash.)

(MU1_Ch8_ReviewQs)

28
New cards

The gzip, bzip2, and xz programs all perform ________________ compression, in which the compressed data will exactly match the original data, when uncompressed.

(A) zip

(B) tar

(C) high

(D) lossy

(E) lossless

lossless

(Explanation:These compression utilities use lossless algorithms, meaning no data is lost during compression and decompression.)

(MU1_Ch8_ReviewQs)

29
New cards

Explain how package management makes installing software easy:

Package management bundles all the files required for an application into a single installation process. When you install an application using a package management system, it places the files in the correct location automatically and tracks the version of each file required for the application. If a newer version of the application is available, the package management software can inform you and make updating application files a simple one step process.

(MU1_Ch9_ExamEssentials)

30
New cards

Describe how you can view the programs running on your Linux system:

Programs running on Linux system are called processes. Currently you can view currently running processes using either the ps or top commands. The ps command provides a snapshot view of what processes are running when you run the command. It has lots of options that allow you to customize what information it displays. The top command provides a real time chart of running processes, allowing you to sort the chart data based on different criteria, such as CPU usage, memory usage, or program name.

(MU1_Ch9_ExamEssentials)

31
New cards

Describe how you can see error messages generated by the kernel:

Linux stores messages generated by the kernel in the kernel ring buffer, a circular buffer area reserved in memory. As new messages enter the buffer area, old messages are deleted to make room. You use the dmesg command to view the messages currently stored in the kernel ring buffer, but any old messages are lost and can't be retrieved.

(MU1_Ch9_ExamEssentials)

32
New cards

Which of the following tools are best suited to installing a software package and all of its dependencies on a Debian computer?

(A) yum

(B) zypper

(C) dmesg

(D) rpm

(E) apt-get

apt-get

(Explanation:apt-get is the package manager used on Debian-based systems. It resolves and installs dependencies automatically. Tools like yum and zypper are used on Red Hat- and SUSE-based systems, respectively. rpm is a low-level tool used on Red Hat-type systems that doesn't handle dependencies by itself. dmesg is not related to package management.)

(MU1_Ch9_ReviewQs)

33
New cards

What are the two most popular utilities used as the first process that the Linux kernel runs, aside from itself? (Choose two.)

(A) init

(B) bash

(C) systemd

(D) login

(E) grub

init & systemd

(Explanation:Historically, init was the first user-space process run by the kernel (PID 1). Most modern Linux distributions now use systemd as the init system replacement. bash, login, and grub are not init systems.)

(MU1_Ch9_ReviewQs)

34
New cards

What do most log files reside on a Linux computer?

(A) /var/log

(B) /etc/logging

(C) /usr/log

(D) /home/logging

(E) /log/usr

/var/log

(Explanation: The standard directory for system logs and application logs on)

(MU1_Ch9_ReviewQs)

35
New cards

When using suitable commands, you can normally install a program and be sure that all the software on which it depends will also be installed, provided you have an Internet connection. True or False?

True

(Explanation:Package managers like apt, dnf, or zypper automatically resolve and install dependencies if a network connection is available to fetch the packages.)

(MU1_Ch9_ReviewQs)

36
New cards

By default, the first process listed in top is currently consuming the most CPU time. True or False?

True

(Explanation:The top command lists processes sorted by CPU usage by default. The top-listed process is the one using the most CPU at that moment.)

(MU1_Ch9_ReviewQs)

37
New cards

The dmesg command may produce different output after a computer has been running for weeks than when it first started. True or False?

True

(Explanation:dmesg shows kernel ring buffer messages, primarily from boot time and hardware detection. Over time, this buffer may fill with new messages and discard old ones, so its output changes.)

(MU1_Ch9_ReviewQs)

38
New cards

Most Linux distributions maintain information on what packages are installed in the ________________.

(A) kernel

(B) package database

(C) graphical desktop

(D) /usr/lib/ directory

(E) Software updater

package database

(Explanation:Each package manager maintains a local database of installed packages, which it uses to track software and dependencies.)

(MU1_Ch9_ReviewQs)

39
New cards

You're using bash, and you type emacs to launch the emacs editor. In this case, emacs is bash's __________ process.

(A) child

(B) parent

(C) server

(D) client

(E) parallel

child

(Explanation:When you run a command from a shell, the shell (bash) spawns a child process to run that command.)

(MU1_Ch9_ReviewQs)

40
New cards

General system messages are likely to be found in /var/log/messages or /var/log/____________, depending on your distribution.

(A) secure

(B) dmesg

(C) syslog

(D) mail

(E) wtmp

syslog

(Explanation:Different distributions use either /var/log/messages or /var/log/syslog to store general system messages.)

(MU1_Ch9_ReviewQs)

41
New cards

The command you use to read messages generated during the boot process and stored in the kernel ring buffer is the ____________ command.

(A) ls

(B) pwd

(C) chmod

(D) cat

(E) dmesg

dmesg

(Explanation:The dmesg command reads messages from the kernel's ring buffer, including those generated during hardware initialization at boot time.)

(MU1_Ch9_ReviewQs)

42
New cards

Describe editing with nano:

Launch the nanotechs editor along with the name of the current file you wish to edit or the new file you want to create. You can reach the line you want to change by using arrow or control keys, some of which are displayed in the shortcut list. For editing, basic keyword keys are control and/or meta keys are also available. For example, Ctrl+K allows you to cut a line of text, whereas Ctrl+U paste any cut text.

(MU1_Ch10_ExamEssentials)

43
New cards

Explain how to save modified text files with nano:

You can save any changes made to the text file within the nano editor pressing the Ctrl+O key combination. The editor will prompt for the file name, and if it is the name displayed, you can simply press Enter. You can also initiate this process by pressing Ctrl+X.

(MU1_Ch10_ExamEssentials)

44
New cards

Describe editing files with vi:

Start the vi text editor along with the name of the current file you want to edit or the new file you want to create. The initial editor mode is command mode. It is easiest for those new to vi to start editing by entering insert mode by pressing I on the keyboard. After you have completed your edits, leave insert mode by pressing the Esc key

(MU1_Ch10_ExamEssentials)

45
New cards

Describe the various methods to save changes with vi:

To save your edits when using the vi editor, you can use ex mode, but you must first must be out of insert mode (press the Esc key to leave insert mode if needed). Type :w to write out the editors buffer to the file on the disk. You can save the changes and quit the vi editor at the same time by typing :wq. If you need to quit without saving changes, type :q!. You can also command mode to save your modifications by typing ZZ.

(MU1_Ch10_ExamEssentials)

46
New cards

Summarize needed user privileges for editing:

To successfully edit system files, which include some configuration files, you must obtain superuser privileges prior to editing them. This also includes other files that only allow users with such privileges to write to the file. When using nano, you will see near the bottom of the editor screen the message Warning: no right permission if you have loaded a file that you have no permission to change.

(MU1_Ch10_ExamEssentials)

47
New cards

For which type of file is nano least likely to be useful for examining or editing?

(A) A text file encoded in unicode

(B) A shell script file

(C) A text file encoded in ASCII

(D) A LibreOffice word processing document

(E) A Linux configuration file

A LibreOffice word processing document

(Explanation:Nano is a terminal-based text editor meant for editing plain text files. LibreOffice documents are binary files in a compressed XML format and are not human-readable in a text editor like nano.)

(MU1_Ch10_ReviewQs)

48
New cards

Which keystrokes involved a nano search function? (Choose all that apply.)

(A) F3

(B) F6

(C) Esc-S

(D) Ctrl+F

(E) Ctrl+W

Ctrl+F & Ctrl+W

(Explanation:

Ctrl+W is the main keybinding to begin a search in nano.

Ctrl+F moves the cursor forward (right), but also functions as a search-forward shortcut in some contexts.

F3, F6, and Esc-S do not initiate searches in nano.)

(MU1_Ch10_ReviewQs)

49
New cards

How would you remove two lines of text from a file when using vi?

(A) In command mode, position the cursor on the first line and type 2dd.

(B) In command mode, position the cursor on the last line and type 2yy.

(C) In insert mode, Position the cursor at the start of the first line, hold down the shift key while pressing the down arrow key twice, and press the Delete key on the keyboard.

(D) In insert mode, Position the cursor at the start of the first line and press Ctrl+K twice.

(E) Select the text with the mouse, and then select File > Delete from the menu.

In command mode, position the cursor on the first line and type 2dd.

(Explanation:In vi (or vim), dd deletes one line. Prepending it with a number deletes that many lines. So 2dd deletes the current line and the one below it.)(MU1_Ch10_ReviewQs)

50
New cards

Unicode is useful for encoding most European languages but not languages in Asia? True or False?

False

(Explanation:Unicode was designed to handle all written languages, including Asian scripts like Chinese, Japanese, and Korean.)

(MU1_Ch10_ReviewQs)

51
New cards

GUI text editors for ASCII are superior to text mode ASCII text editors because the GUI editors support underlining, italics, and multiple fonts. True or False?

False

(Explanation:ASCII itself does not support formatting like underlining or fonts. GUI editors may support richer features, but for raw ASCII text, a terminal editor is just as effective. GUI features don't enhance ASCII itself.)(MU1_Ch10_ReviewQs)

52
New cards

If you have use a text editor before, the nano text editor is usually the best one to learn 1st. True or False?

True

(Explanation:Nano is beginner-friendly with visible commands and straightforward navigation, making it ideal for new users.)

(MU1_Ch10_ReviewQs)

53
New cards

ASCII supports ________ unique characters (not including control characters).

(A) 64

(B) 128

(C) 512

(D) 1024

(E) 2048

128

(Explanation:Standard ASCII uses 7 bits, which gives 128 possible characters (from 0 to 127).)

(MU1_Ch10_ReviewQs)

54
New cards

three key strokes that can initiate a search and replace operation in nano are ________, ________, and ________.

(A) Esc+R

(B) F6

(C) F14

(D) Ctrl+F

(E) Ctrl+\

Esc+R, F6, and Ctrl+\

(Explanation:

Ctrl+\ initiates a search and replace in nano.

Esc+R and F6 can be used in some terminal configurations to reach replace mode.

Ctrl+F is not a search-and-replace command.)(MU1_Ch10_ReviewQs)

55
New cards

While in vi's command mode, you can type ________ to undo a change.

(A) ~

(B) :wq

(C) ZZ

(D) u

(E) /

u

(Explanation:The u command in command mode undoes the last change in vi.)

(MU1_Ch10_ReviewQs)

56
New cards

To save a file and exit the vi text editor in command mode, type ________.

(A) ~

(B) ?

(C) ZZ

(D) cw

(E) /

ZZ

(Explanation:Typing uppercase ZZ in command mode writes the file and exits. Alternatively, :wq also does the same.)

(MU1_Ch10_ReviewQs)

57
New cards

What does the `cd -` command do?

It takes you to your previous directory.

(MU1_USec8_66)

58
New cards

What happens when you type `cd` with no arguments?

It returns you to your home directory.

(MU1_USec8_66)

59
New cards

Why is the `cd -` command useful?

It allows you to quickly switch between two directory locations.

(MU1_USec8_66)

60
New cards

Who founded the Free Software Foundation and contributed to core Unix commands?

Richard Stallman

(MU1_USec8_67)

61
New cards

What command is being discussed as fundamental to Unix/Linux systems?

ls

(MU1_USec8_67)

62
New cards

What does the `ls` alias typically add to the command?

Color-coded output with --color=auto

(MU1_USec8_67)

63
New cards

How can you bypass an alias when running a command like ls?

Use a backslash, e.g., `\ls`

(MU1_USec8_67)

64
New cards

What does the `-F` option do in `ls`?

Appends special characters to indicate file types (e.g., `/` for directories, `*` for executables)

(MU1_USec8_67)

65
New cards

What does the `-l` option do in `ls`?

Displays a long listing format including permissions, owner, size, and last modified date

(MU1_USec8_67)

66
New cards

How can you sort `ls` output by the most recently modified file?

Use `ls -lt` and optionally reverse with `ls -ltr`

(MU1_USec8_67)

67
New cards

What does the `-R` option do in `ls`?

Recursively lists directories and their contents

(MU1_USec8_67)

68
New cards

How can you show hidden files and directories in `ls` output?

Use the `-a` option

(MU1_USec8_67)

69
New cards

What is the difference between `-a` and `-A` in `ls`?

`-a` shows all files including `.` and `..`, `-A` excludes `.` and `..` but includes other hidden files

(MU1_USec8_67)

70
New cards

What character does a hidden file or directory start with in Linux?

A dot `.`

(MU1_USec8_67)

71
New cards

How are directories indicated in `ls -l` output?

With a `d` in the leftmost character of the permissions block

(MU1_USec8_67)

72
New cards

How can you clear your terminal screen?

Use `Ctrl+L`

(MU1_USec8_67)

73
New cards

What does the `cd` command do in Linux?

It changes the current working directory.

(MU1_USec8_68)

74
New cards

What does typing `cd` with no arguments do?

It returns the user to their home directory.

(MU1_USec8_68)

75
New cards

What does `cd -` do?

It takes you to your previous directory.

(MU1_USec8_68)

76
New cards

Why should you avoid navigating one directory at a time when using `cd`?

It prevents the `cd -` command from being as effective since you're only moving one level each time.

(MU1_USec8_68)

77
New cards

What command shows your current working directory?

PWD

(MU1_USec8_68)

78
New cards

How can you check the value of the current working directory variable in bash?

Use `echo $PWD`

(MU1_USec8_68)

79
New cards

What variable stores the previous directory location in bash?

OLDPWD

(MU1_USec8_68)

80
New cards

What does `cd $OLDPWD` do?

It takes you to the previous directory, same as `cd -`

(MU1_USec8_68)

81
New cards

How can you use tab completion effectively with the `cd` command?

Type part of the directory name and press Tab to auto-complete it.

(MU1_USec8_68)

82
New cards

What is the significance of the prompt showing the current path?

It visually confirms the working directory, which helps with navigation.

(MU1_USec8_68)

83
New cards

What does `cd ..` do?

It moves to the parent directory of the current directory.

(MU1_USec8_68)

84
New cards

What are the special directories represented by `.` and `..`?

`.` refers to the current directory and `..` refers to the parent directory.

(MU1_USec8_68)

85
New cards

What is the PS1 variable used for?

It defines the shell prompt appearance, often showing the current path.

(MU1_USec8_68)

86
New cards

Why is `cd -` considered a shortcut?

Because it internally uses the value of the `OLDPWD` variable to switch to the previous directory.

(MU1_USec8_68)

87
New cards

Why is tab completion useful with directory navigation?

It speeds up navigation and avoids typos by auto-completing valid paths.

(MU1_USec8_68)

88
New cards

What command is used to create a new directory in Linux?

mkdir

(MU1_USec8_69)

89
New cards

What does the number 2 represent in the long listing of a new directory?

It indicates the directory has two hard links: its own name and the special file name dot (.)

(MU1_USec8_69)

90
New cards

What special file is used to represent the current directory?

.

(MU1_USec8_69)

91
New cards

What command is used to view the properties of a directory without listing its contents?

ls -ld [directory name]

(MU1_USec8_69)

92
New cards

What is the hard link count of a newly created directory?

2

(MU1_USec8_69)

93
New cards

What additional files are present inside every directory in Linux?

. and ..

(MU1_USec8_69)

94
New cards

What does the dot (.) directory represent?

The current directory

(MU1_USec8_69)

95
New cards

What does the dot-dot (..) directory represent?

The parent directory

(MU1_USec8_69)

96
New cards

What happens to the hard link count of a parent directory when a subdirectory is added?

It increases by 1

(MU1_USec8_69)

97
New cards

How can you determine how many subdirectories a directory has?

Subtract 2 from the hard link count

(MU1_USec8_69)

98
New cards

What is the significance of a hard link count of 1760 in /usr/share/doc?

It indicates the directory has 1758 subdirectories

(MU1_USec8_69)

99
New cards

How can tab completion help with directory navigation?

It auto-completes directory names, reducing typing errors

(MU1_USec8_69)

100
New cards

How do you move up two directories in Linux?

cd ../..

(MU1_USec8_69)