cd
is not a program that can be exec
uted, it's a built-in shell command. It has to be, since it's too hard to change current directory in parent process.
Two ways of entering a directory by inode number?
Question
If I want to enter a directory by its inode number, why
cd $(find . -inum $inode_num)
works, but the following command does not work:
find . -inum $inode_num -exec cd {} \;
what's the difference between these two, and why is the 2nd one wrong?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow