这是默认行为 ls
ls /net/nas/data/languages/pypm/sites/rex/free/2.6/*/pool/v/vi/virtual*1.4.4*pypm
/net/nas/data/languages/pypm/sites/rex/free/2.6/linux-x86/pool/v/vi/virtualenv-1.4.4_linux-x86_2.6_1.pypm
/net/nas/data/languages/pypm/sites/rex/free/2.6/linux-x86_64/pool/v/vi/virtualenv-1.4.4_linux-x86_64_2.6_1.pypm
/net/nas/data/languages/pypm/sites/rex/free/2.6/macosx/pool/v/vi/virtualenv-1.4.4_macosx_2.6_1.pypm
/net/nas/data/languages/pypm/sites/rex/free/2.6/win32-x86/pool/v/vi/virtualenv-1.4.4_win32-x86_2.6_1.pypm
如何ls
只打印基本名称?喜欢:
ls $OPTIONS /net/nas/data/languages/pypm/sites/rex/free/2.6/*/pool/v/vi/virtual*1.4.4*pypm
virtualenv-1.4.4_linux-x86_2.6_1.pypm
virtualenv-1.4.4_linux-x86_64_2.6_1.pypm
virtualenv-1.4.4_macosx_2.6_1.pypm
virtualenv-1.4.4_win32-x86_2.6_1.pypm
注意:find
与/ net / nas / data / languages / pypm / sites / rex / free包含大量文件和目录相比,我更喜欢使用shell globing。
1
当目录包含许多文件时,您更喜欢使用find进行shell遍历?错字?
—
akira 2010年
我猜想OP不想列出子目录,并且不知道传递
—
直觉
-maxdepth 1
给的选项find
。