DEV Community

loading...

Best way to avoid accidental modification of the file

chanduthedev
I am a developer
・1 min read

Recently I learned very useful tip to avoid accidentally modifying/editing a original file. This will work in all unix like systems including Mac.

The Idea is to just change file permissions to read only using chmod command as below


>chmod 444 file_name

Enter fullscreen mode Exit fullscreen mode

or


>chmod 400 file_name

Enter fullscreen mode Exit fullscreen mode

Discussion (0)

Forem Open with the Forem app