Bird
0
0

You want to create a script that launches a GUI file manager and then opens a terminal in the same directory. Which approach is best?

hard📝 Application Q9 of 15
Linux CLI - Linux Basics and Terminal
You want to create a script that launches a GUI file manager and then opens a terminal in the same directory. Which approach is best?
AWrite a script that runs 'ls' then 'pwd' commands
BUse a shell script that runs 'nautilus .' then 'gnome-terminal --working-directory=.'
CCreate a script that opens only the terminal and type commands manually
DUse a GUI tool to drag and drop files instead of scripting
Step-by-Step Solution
Solution:
  1. Step 1: Identify commands to open GUI and terminal

    'nautilus .' opens file manager in current directory; 'gnome-terminal --working-directory=.' opens terminal there.
  2. Step 2: Combine commands in a script

    Running both commands sequentially automates opening both apps in same folder.
  3. Final Answer:

    Use a shell script that runs 'nautilus .' then 'gnome-terminal --working-directory=.' -> Option B
  4. Quick Check:

    Script GUI + terminal in same folder = nautilus + gnome-terminal [OK]
Quick Trick: Use --working-directory option to open terminal in specific folder [OK]
Common Mistakes:
  • Confusing file manager commands with terminal commands
  • Not automating both apps in one script

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes