
경로에 빠르게 도달할 수 있는 스크립트를 만들고 싶습니다. "/var/www/vhosts/" 아래의 디렉터리를 자동 완성하기 위해 "full" 명령이나 다른 명령을 사용할 수 있는지 궁금합니다. 스크립트는 다음과 같습니다.
#!/bin/bash
if [ -d /var/www/vhosts/$1/httpdocs ]; then
cd /var/www/vhosts/$1/httpdocs
else
cd /var/www/vhosts/$1
fi