nerdexam
LPI

010-100 · Question #46

You have a program called /usr/bin/foo. You wish to create a symbolic link, /home/user/foo, that points to it. Which command will do this task?

The correct answer is B. ln -s /usr/bin/foo /home/user/foo. Creating a symbolic link with 'ln' requires the '-s' flag, followed by the target path and then the desired link path.

The Power of the Command Line

Question

You have a program called /usr/bin/foo. You wish to create a symbolic link, /home/user/foo, that points to it. Which command will do this task?

Options

  • Aln -sym /home/user/foo /usr/bin/foo
  • Bln -s /usr/bin/foo /home/user/foo
  • Cln /home/user/foo /usr/bin/foo
  • Dln /usr/bin/foo /home/user/foo
  • Eln --symlink /home/user/foo /usr/bin/foo

How the community answered

(60 responses)
  • A
    3% (2)
  • B
    78% (47)
  • C
    12% (7)
  • D
    5% (3)
  • E
    2% (1)

Why each option

Creating a symbolic link with 'ln' requires the '-s' flag, followed by the target path and then the desired link path.

Aln -sym /home/user/foo /usr/bin/foo

'-sym' is not a valid option for the 'ln' command; the correct flag for symbolic links is '-s'.

Bln -s /usr/bin/foo /home/user/fooCorrect

The 'ln -s' command creates a symbolic (soft) link. The correct syntax is 'ln -s TARGET LINK_NAME', so 'ln -s /usr/bin/foo /home/user/foo' creates a symlink at /home/user/foo that points to /usr/bin/foo. The order of arguments places the existing target first and the new link path second.

Cln /home/user/foo /usr/bin/foo

'ln' without '-s' creates a hard link, not a symbolic link, and the argument order is also reversed.

Dln /usr/bin/foo /home/user/foo

'ln' without '-s' creates a hard link rather than a symbolic link.

Eln --symlink /home/user/foo /usr/bin/foo

'--symlink' is not a valid long option for 'ln'; the correct long option is '--symbolic' or the short form '-s'.

Concept tested: Creating symbolic links with ln -s

Source: https://man7.org/linux/man-pages/man1/ln.1.html

Topics

#symbolic link#ln command#soft link#file system

Community Discussion

7
Ingrid P.Ingrid P.Apr 2, 2026

B is the one to put on a card. The flag is -s for symbolic, the source is the existing target (/usr/bin/foo), and the destination is the link you are creating (/home/user/foo), so the order is ln -s TARGET LINK, exactly as B has it. The other options either invent flags that do not exist (-sym, --symlink) or use the hard link form without -s.

13
Yusuf A.Yusuf A.Apr 23, 2026

B is right, the order trips people up: source first, then where you want the link.

2
Fatima Z.Fatima Z.Mar 26, 2026

B is right: ln -s always goes SOURCE then LINK, "s" for symlink.

1
Bao N.Bao N.Apr 8, 2026

Got this one on my actual exam and almost second-guessed myself because I kept reading the options too fast and mixing up the argument order. The flag is -s, the source is the real file, the destination is the link you want to create, so ln -s /usr/bin/foo /home/user/foo is the move, and B is your answer, period.

-1
Ingrid P.Ingrid P.Apr 11, 2026

The argument order trips a lot of people so I make a card with cloze on the syntax plus a second card testing what happens when you run the link without the -s flag, because getting burned on hard links versus symbolic links is a separate failure mode worth drilling before exam day.

0
Devraj B.Devraj B.Apr 16, 2026

The long form --symlink is clearer and more explicit than -s.

-1
Bao N.Bao N.Apr 17, 2026

The correct answer is B, the -s flag, because that is the standard and universally recognized option for creating symbolic links with the ln command, and the long form --symlink does not actually exist in ln.

0
Full 010-100 Practice