The following commands does the same thing$ cd$ cd $HOME$ cd ~$ cd /home/userIn three of them, the path is relatively specified. But how or why in the earth the simple cd opens the user's home dir?
Where does cd command is configured to cd $HOME when no path is specified?
cd command
This is documented behavior in the POSIX standard:If no directory operand is given and the HOME environment variable is set to a non-empty value, the cd utility shall behave as if the directory named in the HOME environment variable was specified as the directory operand.