Please consider:
cd ~
cd $HOME
I would say that the first command is a possible sugar syntax of the second command, and that the second is less abstract.
Just for the sake of demonstrating how commands can become less and less abstract to newcomers to programming (in the context of explaining what is abstraction), focusing on shell, I ask:
How to translate a non sugary syntactic shell (Bash) command into "lower" types of code such as assembly or even machine code (or to anything coming between, say cd $HOME
to its assembly representation)?
What software I could use, perhaps in shell, to achieve this goal to demonstrate how a computer command goes from the simple to the complicated?
cd
translates almost directly to thechdir()
system call, turning it into low level operations is either trivial (if you stop at the system call), or quite complicated (given that the system call modifies process state kept in the OS, and that calls in the very concept of a process as unit of execution separated from other processes...) – ilkkachu May 07 '21 at 16:14