LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


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

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

Rep: Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721Reputation: 3721
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
eklavya
Member
 
Registered: Mar 2013
Posts: 636

Rep: Reputation: 142Reputation: 142
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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