Я знаю, что ответ может быть немного запоздалым, но вам может понравиться идея CDPATH
vaiable. Это позволяет cd
обращаться к содержимому каталогов в этой переменной откуда угодно. Вот пример:
$ mkdir -p test/{1,2,3}
$ cd test/
$ mkdir 1/{a,b,c}
$ export CDPATH=/tmp/test/1
$ ls
1 2 3
$ cd a
$ pwd
/tmp/test/1/a
$ cd ~
$ cd b
$ pwd
/tmp/test/1/b
Подробнее см.man
:
CDPATH A <colon>-separated list of pathnames
that refer to directories. The cd utility
shall use this list in its attempt to change
the directory, as described in the DESCRIPTION.
An empty string in place of a directory
pathname represents the current directory. If
CDPATH is not set, it shall be treated as if
it were an empty string.
Да, действительно существует системный -общеизвестный файл hosts, который по умолчанию /etc/ssh/ssh_known_hosts
. Вы можете запустить man ssh_config
и найти GlobalKnownHostsFile
, чтобы увидеть значение по умолчанию в вашей системе. Вы также можете изменить значение этой опции как обычно (с помощью -o
), если хотите.