Is it possible to create a script to save and restore permissions?

前端 未结 13 1329
逝去的感伤
逝去的感伤 2021-01-30 04:29

I am using a linux system and need to experiment with some permissions on a set of nested files and directories. I wonder if there is not some way to save the permissions for t

13条回答
  •  盖世英雄少女心
    2021-01-30 05:15

    I have a Python script for doing this at https://github.com/robertknight/mandrawer/blob/master/save-file-attrs.py

    save-file-attrs.py save

    Will save the permissions, mode and modification times of files in the dir tree rooted at the current working directory to a local file (.saved-file-attrs) and:

    save-file-attrs.py restore

    Will restore those attributes from the file and display the changes.

提交回复
热议问题