Search code examples
linuxpermissionsfile-permissions

Auto assigning 777 to files created


sudo rm -rf app/logs
sudo mkdir app/logs
sudo chmod -R 777 app/logs

This is what I do but the problem is when a file gets created behind the scene by any program, web application or a behat test, the file doesn't automatically get 777 permission assigned to it. They rather get 644. That's my problem. What am I missing?

I've checked these:


Solution

  • You can choose any of the three methods

    1. Use mkdir -m 777 app/logs

    2. Create a script

      #!/bin/bash

      sudo mkdir -m 777 $1

    So exectute ./script_name.sh app/logs