Bird
0
0

You run the command: ln -s file1 file2 file3 and get an error. Why?

medium📝 Debug Q6 of 15
Linux CLI - File and Directory Operations
You run the command: ln -s file1 file2 file3 and get an error. Why?
ABecause symbolic links cannot be created for multiple files.
BBecause ln -s requires the last argument to be a directory when multiple sources are given.
CBecause file1 does not exist.
DBecause ln -s does not accept more than two arguments.
Step-by-Step Solution
Solution:
  1. Step 1: Understand ln -s with multiple sources

    When multiple source files are given, the last argument must be a directory to place the links inside.
  2. Step 2: Identify cause of error

    If the last argument is not a directory, ln -s throws an error.
  3. Final Answer:

    Because ln -s requires the last argument to be a directory when multiple sources are given. -> Option B
  4. Quick Check:

    Multiple sources need directory target = Because ln -s requires the last argument to be a directory when multiple sources are given. [OK]
Quick Trick: Multiple sources need directory as last argument [OK]
Common Mistakes:
MISTAKES
  • Thinking symbolic links can't be made for multiple files
  • Assuming ln -s only accepts two arguments
  • Ignoring directory requirement for multiple sources

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes