DEV Community

Bijay Kumar Pun
Bijay Kumar Pun

Posted on

ELI5 : Subshell in linux and its usage

I've just started learning more about the linux environment in general and I came across this idea of subshells. I know it's a shell started by another shell; such by running commands inside () for example, but what I don't understand is what they really are and what's the point of it, in a grand scheme of things.

Top comments (1)

Collapse
 
bijaykumarpun profile image
Bijay Kumar Pun

Accidentally bumped into the diff command, where subshell is used.
The diff command is used for comparison between two outputs:
diff -u --color <( cat one.txt ) <( cat two.txt)
-u will show unified difference
--color adds some nice colors
And the symbols < and ( should be used together!