I was running the Linux Shell commands in a particular way, I wanted to figure out if both ways of running them would generate the same result.
Example 1:
echo "echo "hi"" | /bin/sh
hi
Example 2:
echo "pwd" | /bin/sh
/root/test
Example 3:
Here, assume that there's a file called test.txt which only contains the word "test"
echo "cat test.txt" | /bin/sh
test
So far, everything seemed to working fine, but then when I typed the following
echo "cd .." | /bin/sh
Nothing happened, which shouldn't be the case, because if I type cd ..
without | /bin/sh
and press Enter, the Shell takes me back to the previous path which in this case would be /root
So, I just want to know what's the actual list of available commands for use via /bin/sh