Skip to content

Instantly share code, notes, and snippets.

@maraigue
Created December 4, 2011 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maraigue/1429763 to your computer and use it in GitHub Desktop.
Save maraigue/1429763 to your computer and use it in GitHub Desktop.
To export permissions of all files under current directory
#!/bin/sh
# To export permissions of all files under current directory
# (for make a backup from an HDD of Un*x file system to of Windows file system)
# カレントディレクトリ以下のすべてのファイルについて、パーミッションを書き出す
# (Un*xのファイルシステムからWindowsのファイルシステムへバックアップを作るときなどに)
find . -exec stat -c 'chmod %a %n' \{\} \;
# Output (example):
#
# chmod 755 .
# chmod 644 ./hoge.txt
# chmod 700 ./piyo.sh
# chmod 755 ./some_directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment