Thursday, September 17, 2026

Linux Soft Link & Hard Link Quiz

### 🐧 Linux Soft Link & Hard Link Quiz


Test your Linux knowledge! Covering soft links, hard links, inodes, permissions, file sizes, and commands.


QUESTION 1

### What is a soft link (symbolic link) in Linux?

A. A duplicate copy of a file

B. A reference to another file path

C. A file with two inodes

D. A compressed file


QUESTION 2

### Which command creates a soft link?

A. ln file link

B. ln -s file link

C. cp -s file link

D. link -h file link


QUESTION 3

### Which command creates a hard link?

A. ln -s original hard

B. ln original hard

C. cp -l original hard

D. mklink original hard


QUESTION 4

### Do a file and its hard link share the same inode?

A. Yes

B. No

C. Only in different directories

D. Only for directories


QUESTION 5

### What happens to a soft link when its target file is deleted?

A. It becomes a hard link

B. It becomes a dangling link

C. It recreates the target

D. It deletes the entire directory


QUESTION 6

### What happens to a hard link when the original filename is deleted?

A. The data is immediately deleted

B. The hard link becomes broken

C. The data remains accessible through the hard link

D. The inode changes automatically


QUESTION 7

### Which command displays inode numbers?

A. ls -lh

B. ls -i

C. ls -p

D. ls -a


QUESTION 8

### What does the link count in ls -l indicate for a regular file?

A. File size in bytes

B. Number of hard links to the inode

C. Number of soft links only

D. Number of permissions


QUESTION 9

### A 100 KB file has one hard link created. What is the approximate combined disk usage of the file and hard link?

A. 200 KB always

B. 100 KB of file data (excluding filesystem overhead)

C. 0 KB

D. Depends only on permissions


QUESTION 10

### Which command can show that a soft link points to a target?

A. ls -l

B. chmod

C. pwd

D. touch


QUESTION 11

### What does chmod 777 file do?

A. Makes the file read-only

B. Gives read, write, and execute permissions to owner, group, and others

C. Changes the inode

D. Creates a hard link


QUESTION 12

### Can you normally create hard links to directories using standard ln?

A. Yes, without restrictions

B. No, generally prohibited for regular users

C. Only with ln -s

D. Only for empty directories


QUESTION 13

### What is the output of this command sequence?

\`touch a.txt\` \`ln a.txt b.txt\` \`ls -i a.txt b.txt\`

A. Different inode numbers

B. Same inode number

C. No inode number

D. Two copies of the file


QUESTION 14

### Which statement about soft links is correct?

A. They always share the target's inode

B. They have their own inode

C. They duplicate the target data

D. They cannot point to directories


QUESTION 15

### What does \`ls -l\` typically show for a symbolic link?

A. The target's inode number

B. The link path followed by \`->\` and its target

C. Only the file size

D. Only the target's permission 

No comments: