What command is used to create a symbolic link in Linux?

Prepare for the LPIC-2 Certification Test with our study tools, including flashcards and multiple choice questions with hints and explanations. Get ready to pass your exam!

The command used to create a symbolic link in Linux is indeed "ln -s source target." This command serves a very specific purpose: it creates a link to a file or directory, allowing users to reference that file or directory from another location without duplicating its content. The "-s" option indicates that the link being created is a symbolic link, as opposed to a hard link.

Symbolic links are particularly useful when you need to create shortcuts to files or directories that may reside in different locations within the filesystem. Unlike hard links, which point directly to the inode of a file and cannot span across different filesystems, symbolic links are more flexible, allowing them to reference files or directories across different mounted filesystems or paths.

Regarding the other options, the "link" command does not create symbolic links; rather, it is used for creating hard links, which are different from symbolic links. The "symlink create" option does not exist in the Linux command set, making it an invalid choice. Finally, "mklink" is a command used in Windows environments, not in Linux, which further highlights why it is not applicable in this context.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy