For example:
$ ls -aF
./ ../ bin/
$ cd tin # with a tee, not bee
bin
$ pwd
/home/user/bin
In other words, cd
guesses that what I really meant was cd bin
, and successfully (huh?) changes the current directory accordingly. I do not find this behavior documented in man bash
or the Bash Reference Manual.
I would like Bash to produce an error, write something informative to standard error, and leave the current directory unchanged if no directory matching the dir
argument (accounting for expansion) is found.
FYI,
$ type cd
cd is a shell builtin
$ ps -p $$
PID TTY TIME CMD
46959 pts/8 00:00:00 bash
$ bash --version
GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ hostnamectl
Static hostname:
Icon name: computer-server
Chassis: server
Machine ID:
Boot ID:
Operating System: Red Hat Enterprise Linux
CPE OS Name: cpe:/o:redhat:enterprise_linux:7.9:GA:server
Kernel: Linux 3.10.0-1160.83.1.el7.x86_64
Architecture: x86-64
$ #DELETED: Static hostname, Machine ID, Boot ID