Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
I am using Fedora Core 4. By default, when I create a new file, it is given permissions of -rw-rw-r-- for files, and drwxrwxr-x for directories. Is there any way ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2005
    Location
    Pennsylvania, USA
    Posts
    27

    Default file permissions


    I am using Fedora Core 4. By default, when I create a new file, it is given permissions of -rw-rw-r-- for files, and drwxrwxr-x for directories. Is there any way to change my settings so that files have default permissions of -rw-r--r-- and directories have default permissions of drwxr-xr-x?

  2. #2
    Linux Enthusiast
    Join Date
    Aug 2005
    Location
    Hell
    Posts
    514
    Change your umask from 0002 to 0022:
    Code:
    umask 0022

  3. #3
    Just Joined!
    Join Date
    Oct 2005
    Location
    Pennsylvania, USA
    Posts
    27
    That works great, but it doesn't seem to stick once I close the terminal; is there any way to make it permanent?

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028
    Put it in /etc/profile.

  6. #5
    Just Joined!
    Join Date
    Oct 2005
    Location
    Pennsylvania, USA
    Posts
    27
    Quote Originally Posted by a thing
    Put it in /etc/profile.
    I did that, and then I logged out and logged back in to test it, but that didn't work...

  7. #6
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    bash uses /etc/bashrc, not /etc/profile. I'd suggest putting it in the .bash_profile in your home directory.

  8. #7
    Just Joined!
    Join Date
    Oct 2005
    Location
    Pennsylvania, USA
    Posts
    27
    Quote Originally Posted by scm
    bash uses /etc/bashrc, not /etc/profile. I'd suggest putting it in the .bash_profile in your home directory.
    I put it in .bash_profile, logged out and logged back in to test, and it didn't work either.

  9. #8
    Just Joined!
    Join Date
    Oct 2005
    Location
    Pennsylvania, USA
    Posts
    27
    Anyone have any ideas? I tried putting it in ~/.bashrc, as well, and that didn't work.

  10. #9
    Linux Engineer
    Join Date
    Jan 2005
    Location
    Chicago (USA)
    Posts
    1,028
    Are you even using Bash?

  11. #10
    Just Joined!
    Join Date
    Oct 2005
    Location
    Pennsylvania, USA
    Posts
    27
    Yes.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •