For example I'm in my directory:
/home/myname
and then I want to CD into a different directory.
/home/pulsar/...
Since I need to go pretty deep into the other directory, how can I go about this without having to type the whole line? I tried
cd */thedirectoryiwanttogointo
but that doesn't work. I have to type the whole line.
Probably your wildcard does not work because:
The usual approach (in a shell) to moving frequently among subdirectories is to use the CDPATH
feature, as well as pushd
and popd
.
The CDPATH
feature (perhaps first seen in tcsh) is a colon-separated list of directories. If the parent of your thedirectoryiwanttogointo
name is reasonably unique, then you could add the parent to the list.
For further reading (your shell's manual page should be first):
cd
(Red Hat Enterprise Linux Step By Step Guide)pushd
and popd
are newer than CDPATH
, but still dating from the mid-1990s. They allow you to save your current directory ("pushing" onto a stack) and restore it ("popping" from a stack) during their respective cd
commands. For further reading:
Other people use shell aliases or symbolic links. Those are most useful when going to well-known locations.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다