Does macOS have a command to get list of folders and files in your directory
dir /b/s
Or a command to get file names and save to a text file
dir /b/s/w *.jpg > "filename.txt"
使用查找(请参阅终端中的查找man find
或https://ss64.com/bash/find.html )
find $PWD -type f -name "*.jpg" >"filename.txt"
macOS is POSIX compliant so it contains the usual command line utilities found in Unix environments.
ls /b/s
will list all files in the directory /b/s
ls /b/s/w*.jpg > filename.txt
will list all files under /b/s
starting with w
and ending with .jpg
and pipe the output onto a text file called filename.txt
ls -l
命令将为您提供目录内容的详细信息以及权限,就像dir
命令一样。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.