Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-23-2017, 10:38 AM   #1
Senior Member
Registered: Jan 2015
Posts: 1,432

Rep: Reputation: 11
Post Set a directory or file permission to default.

When I change a file or directory permission then how can I reset it?

Thank you.
Old 10-23-2017, 10:43 AM   #2
LQ Guru
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 6,352
Blog Entries: 3

Rep: Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264Reputation: 3264
There is no system default. The default is what you decide it should be for that directory or file. If you are working with ACLs though, you might look at the -b option for setfacl to see about clearing the settings each time.
Old 10-24-2017, 04:27 AM   #3
Registered: Mar 2013
Posts: 633

Rep: Reputation: 141Reputation: 141
When you create a file or directory, the default file permissions assigned to the file or directory are controlled by the user mask. The user mask is set by the umask command in a user initialization file. You can display the current value of the user mask by typing umask and pressing Return.
The user mask contains the following octal values:
The first digit sets permissions for the user
The second sets permissions for group
The third sets permissions for other, also referred to as “world”
Note that if the first digit is zero, it is not displayed. For example, if umask is set to 022, 22 is displayed.
To determine the umask value you want to set, subtract the value of the permissions you want from 666 (for a file) or 777 (for a directory). The remainder is the value to use with the umask command. For example, suppose you want to change the default mode for files to 644 (rw-r--r--). The difference between 666 and 644 is 022, which is the value you would use as an argument to the umask command.
You can also determine the umask value you want to set by using the following table, which shows the file and directory permissions that are created for each of the octal values of umask.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Cannot set to default locale, no such file or directory Penguin884 Linux - General 4 05-06-2015 03:57 PM
[SOLVED] Default file manager launcher opens inode/directory in Firefox when set to Konquerer flokofcgulls Slackware 8 01-17-2014 09:58 AM
"Cannot set LC_CTYPE to default locale: No such file or directory" boofhead Linux - General 2 02-06-2012 08:10 PM
Set default file/directory permissions replica88 Linux - Newbie 2 04-04-2010 10:12 AM
Can I set default file/directory permission levels? toes Linux - Security 5 01-05-2007 06:21 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration