How do I lock a file in Linux?

How do I lock a file in Linux?
Answer
To enable mandatory file locking in Linux, two requirements must be satisfied:
  1. We must mount the file system with the mand option (mount -o mand FILESYSTEM MOUNT_POINT).
  2. We must turn on the set-group-ID bit and turn off the group-execute bit for the files we are about to lock (chmod g+s,g-x FILE).
 

Tìm kiếm

Back
Top