Bash Shell Expansions and Links

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering Bash shell expansions (pathname, tilde, variable, command substitution, and brace expansion) and Linux hard versus symbolic links.

12 Terms

1
New cards

Pathname expansion

A Bash shell expansion also known as file globbing.

2
New cards

Tilde expansion (~)

A Bash expansion where a tilde (~) on its own refers to the current user's home directory (e.g., cd ~ or cd ~/Public).

3
New cards

Tilde expansion (~username)

A Bash expansion where a tilde (~) followed immediately by a user's name refers to that specific user's home directory (e.g., cd ~student).

4
New cards

Variable expansion ($)

A Bash expansion where a dollar sign ($) placed immediately in front of a variable's name evaluates to that variable's contents (e.g., echo $PATH).

5
New cards

Command substitution

A Bash mechanism that executes a command and substitutes its output into a string, specified using backticks (cmd) or the $(cmd line) syntax.

6
New cards

Brace expansion

A Bash expansion mechanism used to generate arbitrary strings or create multiple files using comma-separated lists or ranges enclosed in curly braces (e.g., touch file{1,2,3,4} or touch file{5..8}).

7
New cards

Hard link

A directory entry pointing directly to an existing file's data; it increments the file's link count, shares file data and metadata, and is indicated in file listings by a dash (-).

<p>A directory entry pointing directly to an existing file's data; it increments the file's link count, shares file data and metadata, and is indicated in file listings by a dash (-).</p>
8
New cards

Symbolic link (soft link)

A file that points to the path of another target file or directory rather than the physical data directly, uses 0 data blocks, and is indicated in file listings by the letter l.

<p>A file that points to the path of another target file or directory rather than the physical data directly, uses 0 data blocks, and is indicated in file listings by the letter l.</p>
9
New cards

Dangling link

A potential problem with symbolic links that occurs when the symlink points to a target file that has been deleted or does not exist.

<p>A potential problem with symbolic links that occurs when the symlink points to a target file that has been deleted or does not exist.</p>
10
New cards

Recursive link

A potential problem with symbolic links in which two or more symbolic links point to each other in a closed loop (e.g., link_a points to link_b, and link_b points to link_a).

<p>A potential problem with symbolic links in which two or more symbolic links point to each other in a closed loop (e.g., link_a points to link_b, and link_b points to link_a).</p>
11
New cards

Required use cases for soft links

Situations where a symbolic link must be used instead of a hard link: 1. linking to a directory (e.g., ln -s /tmp temp), and 2. linking to a file on a different filesystem or partition (e.g., ln -s /boot/grub2/grub.cfg mygrub.cfg).

12
New cards

Removing a link

The operation performed using the rm command (e.g., rm mylink) to delete a link without deleting the underlying target file if other references remain.