检查文件扩展名“.ini”的文件是否存在,shell

Yot*_*tam 1 shell file-extension file exists

.ini如何(使用 shell)检查中是否存在具有文件扩展名的文件/dir?最快的方法是什么?谢谢!

And*_*rte 5

我\xc2\xb4ve 发现这个对于验证现有的jpeg 文件很有用。

\n\n
if ls /path/*.jpg &> /dev/null; then\n    #do something with existing files\nelse\n    echo "files do not exist"\nfi\n
Run Code Online (Sandbox Code Playgroud)\n