Mac - Get file user(owner) name & user id 2018-11-16 /posts/2018-11-16-mac-get-file-user-name/ Mac Table of Contents Mac - Get file user name & user id Get file owner name Get user id get file owner uid # Mac - Get file user name & user id ## Get file owner name stat -f '%Su' <file or folder name> ## Get user id ### show user id // or id <user name> ### get uid id -u // or id -u <user name> ## get file owner uid stat -f ‘%Su’ <file or folder name> | xargs id -u stat -f '%u' <file or folder name> Refer - 将Linux命令的结果作为下一个命令的参数