Created
December 4, 2011 09:53
-
-
Save maraigue/1429763 to your computer and use it in GitHub Desktop.
To export permissions of all files under current directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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