How do you create a symbolic link in linux - CompTIA Linux + XK0-005

Question

How do you create a symbolic link in Linux?
 

Answers
  1. correct
Explanation

Correct Answer: b. ln -s

The ln -s command in Linux is used to create a symbolic link (also known as a soft link). A symbolic link is a type of file that points to another file or directory. It acts like a shortcut and can span across different file systems. 

The -s flag tells ln to create a symbolic link rather than the default hard link, offering more flexibility and easier management.

Why the Other Options Are Incorrect:

  • a. link: This is a system call, not a user-level command. It creates hard links, not symbolic links, and lacks the flexibility of ln -s. It's rarely used directly by users in scripts or terminals.
  • c. symlink: Like link, this is a system call, not a command. It's used in C programming, not in shell or CLI environments. It cannot be executed directly from the command line.
  • d. ln -hard: This is not a valid option. The ln command does support hard linking by default, but there is no -hard flag. Using it would result in an error message.

Related Courses

Discover a range of courses designed to provide you with the knowledge and skills needed to excel in your chosen field.

a prepsaret exam featured image
CompTIA Prep

220-1201 - CompTIA A+ Exam Core 1

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

220-1202 - CompTIA A+ Exam Core 2

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA SecurityX CAS-005

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Cloud Essentials+ CLO-002

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Network+ N10-009

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Security+ SY0-701

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Data + DA0-001

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Pentest+

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA CySA+ CSO-003

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA DataSys+ DS0-001

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Tech+ FC0-U71

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Cloud+ CV0-004

Start Course Prep
a prepsaret exam featured image
CompTIA Prep

CompTIA Server+ SK0-005

Start Course Prep

Easy way to pass your test within a week with prepsaret

You don’t need one month to study and pass your test.
With Prepsaret, it takes you a few days to grasp all the concepts needed to pass your exams

View Courses Offered