Skip to main content
InterviewHubPRO
Section Overview
Q3

Question 3 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

6%
Bash & Shell Scripting (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What is the difference between Command Substitution `$(command)` and Backticks `` `command` ``?

junior Levelbash-shellBasic

In Simple Words: Both execute a shell command and capture its standard output:

  • $(command) (Modern Standard): Readable, supports clean arbitrary nesting without escaping: parent_dir=$(dirname $(realpath "$0"))
  • Backticks `command` (Legacy): Difficult to read and requires awkward escaping when nesting: parent_dir=\dirname `realpath "$0"```