现在的位置: 首页 > 综合 > 正文

mac下用xattr命令来删除文件的扩展属性

2014年09月05日 ⁄ 综合 ⁄ 共 1643字 ⁄ 字号 评论关闭

mac下发现不能用记事本打开文本文件,ls -la 发现格式后面有个@

wenke-mini:changeServer wenke$ ls -la
total 144
drwxr-xr-x  20 wenke  staff    680  6  4 16:37 .
drwxr-xr-x  22 wenke  staff    748  6  3 16:54 ..
-rw-r--r--@  1 wenke  staff  39940  6  4 16:37 .DS_Store
drwxr-xr-x   8 wenke  staff    272  3 27 11:44 103
drwxr-xr-x   6 wenke  staff    204  3 27 13:56 110
drwxr-xr-x   7 wenke  staff    238  3 27 11:44 215
drwxr-xr-x   7 wenke  staff    238  6  4 16:37 215_110
drwxr-xr-x   8 wenke  staff    272  5 30 13:38 225
drwxr-xr-x   8 wenke  staff    272  3 27 11:44 225_110
-rwxr-xr-x   1 wenke  staff    950  4  2 18:39 changeServerTo110
-rwxr-xr-x   1 wenke  staff   1351  4  2 15:46 changeServerTo215
-rwxr-xr-x@  1 wenke  staff   1474  5  2 13:10 changeServerTo225
-rwxr-xr-x   1 wenke  staff    960  4 17 16:31 changeServerTo225_110
-rwxr-xr-x@  1 wenke  staff   1474  5  6 20:26 changeServerToHome
-rwxr-xr-x   1 wenke  staff    933  4 17 16:31 changeServerTos1
-rwxr-xr-x   1 wenke  staff    936  4  2 18:39 changeServerTos1_pop

goole了一下,用xattr命令可以查看和删除这个@.

wenke-mini:changeServer wenke$ xattr -l *
changeServerTo225: com.apple.quarantine: 0002;53589829;QQ;
changeServerToHome: com.apple.quarantine: 0042;53589829;QQ;

wenke-mini:changeServer wenke$ xattr -c changeServerTo225
wenke-mini:changeServer wenke$ xattr -c changeServerToHome

wenke-mini:changeServer wenke$ ls -l
total 64
drwxr-xr-x  8 wenke  staff   272  3 27 11:44 103
drwxr-xr-x  6 wenke  staff   204  3 27 13:56 110
drwxr-xr-x  7 wenke  staff   238  3 27 11:44 215
drwxr-xr-x  7 wenke  staff   238  6  4 16:37 215_110
drwxr-xr-x  8 wenke  staff   272  5 30 13:38 225
drwxr-xr-x  8 wenke  staff   272  3 27 11:44 225_110
-rwxr-xr-x  1 wenke  staff   950  4  2 18:39 changeServerTo110
-rwxr-xr-x  1 wenke  staff  1351  4  2 15:46 changeServerTo215
-rwxr-xr-x  1 wenke  staff  1474  5  2 13:10 changeServerTo225
-rwxr-xr-x  1 wenke  staff   960  4 17 16:31 changeServerTo225_110
-rwxr-xr-x@ 1 wenke  staff  1474  5  6 20:26 changeServerToHome
-rwxr-xr-x  1 wenke  staff   933  4 17 16:31 changeServerTos1
-rwxr-xr-x  1 wenke  staff   936  4  2 18:39 changeServerTos1_pop

抱歉!评论已关闭.