如何在终端中获取可寻址的文件列表,以便以后使用。在终端中,使用工具(如 ls)具有以下工作流程会很好:
1:Population and Other Problems (China National Publications).pdf
2:Weeds in a Changing World (British Crop Protection Council).pdf
3:The Joy of Chickens (Prentice Hall)- 1.pdf
5:The Joy of Chickens (Prentice Hall)- 2.pdf
6:The Weather God ist not nice.pdf
8:The Joy of Chickensoup.pdf
9:FolderBC.png
$
Run Code Online (Sandbox Code Playgroud)
然后我可以简单地做例如:
rm 5:
Run Code Online (Sandbox Code Playgroud)
而不是必须写:
rm 'The Joy of Chickens (Prentice Hall).pdf'
Run Code Online (Sandbox Code Playgroud)
通过使用 - 正如 Pilot6 所建议的 -Tab可以自动完成,但如果你有相似的名字,你仍然需要写很多。还有其他懒惰的方法吗?