0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Macでzip ~作成される.DS_Storeと_MACOSX問題に対応する~

Last updated at Posted at 2024-04-09

Mac対応

Finderでzipを行うと_MACOSXや.DS_Storeが含まれる。
ターミナルでzipすれば_MACOSXは作成されない。ここからさらに.DS_Storeを除外する

ターミナルでzipコマンドを利用する。

zip ファイル名.zip -r ファイル名/ -x "*.DS_Store"

-r:再起的にしフォルダ対応
-x:除外

暗号化する場合 -e

zip -e ファイル名.zip -r ファイル名/ -x "*.DS_Store"

既存ファイル・フォルダ削除

ルートから検索し削除

find . -name ".DS_Store" -print -exec rm {} ";"

Windowsで既存ファイル・フォルダ削除

①_MACOSXがあるパスを検索

dir /s/b _MACOSX .DS_Store

/s:サブフォルダを含む
/b:パスだけで表示

②削除

rd /s/q _MACOSX
del .DS_Store

/s:サブフォルダを含む
/q:強制削除

備考

ターミナルで.DS_Store を作成しないよう設定できるらしいが、毎回叩く必要がある?(未確認)

defaults write com.apple.desktopservices DSDontWriteNetworkStores true
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?