考虑具有任意子目录的某个目录的固定绝对路径:
/full/path/to/fixed/directory
/full/path/to/fixed/directory/first_subdirectory
/full/path/to/fixed/directory/first_subdirectory/second_subdirectory
以及不是上述子目录的任意其他目录directory
:/other/path
我想在终端中看到以下内容:
user@host: .../directory$
user@host: .../directory/first_subdirectory
user@host: .../directory/first_subdirectory/second_subdirectory
user@host: /other/path$
最后一行是典型情况,但其他行是
user@host: /full/path/to/fixed/directory$
user@host: /full/path/to/fixed/directory/first_subdirectory
user@host: /full/path/to/fixed/directory/first_subdirectory/second_subdirectory
如何实施?
PS 路径可以包含空格。