Changing default permissions -without "umask"-...


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Changing default permissions -without "umask"-...
# 1  
Old 11-17-2005
Changing default permissions -without "umask"-...

Hi!

My question is this:

Is it possible to change the default permissions in UNIX (666 for files and 777 for directories)?.

I am not talking about using the command "umask".

I mean, with the command "umask" you can modify permissions from a default permissions x. Is it possible to make "umask" modifies permissions not from x but from y?

I supouse that the numbers 666 and 777 are defined in some file anywhere in the file system. Where are they defined? How can I change it?

Thanks for your time.
# 2  
Old 11-17-2005
When someone writes a program that creates files, they decide on what file permission to use. umask can be used to inhibit some some bits that the programmer tried to set. But it can't turn on new bits that the programmer did not want. Many programmers use that 666, 777 standard. But if you don't like the choice that a programmer made, write your own version of the program that operates the way you want. No other way to do it.
# 3  
Old 11-17-2005
Ok, I understand this. I understand what is "umask" used for.

But i am not convinced about that.

I am sure these numbers (666 and 777) have to be defined anywhere. Where?

Maybe I am wrong, it is possible. But if not, i want to know the answer.

Again, thanks for your time.
# 4  
Old 11-17-2005
Quote:
Originally Posted by chicoGuapo
Ok, I understand this. I understand what is "umask" used for.

But i am not convinced about that.

I am sure these numbers (666 and 777) have to be defined anywhere. Where?

Maybe I am wrong, it is possible. But if not, i want to know the answer.

Again, thanks for your time.
umask does not modify permissions on any existing file. It only affects the permissions on newly created files. In your shell prompt, type umask, which shows the current setting. There's more about umask here
Code:
user@machine[/home/user]>umask
022

# 5  
Old 11-17-2005
Check either the user's $HOME/.profile or /etc/profile as that is where the umask is generally set --- in my experience anyways.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Apache 2.4 directory cannot display "Last modified" "Size" "Description"

Hi 2 all, i have had AIX 7.2 :/# /usr/IBMAHS/bin/apachectl -v Server version: Apache/2.4.12 (Unix) Server built: May 25 2015 04:58:27 :/#:/# /usr/IBMAHS/bin/apachectl -M Loaded Modules: core_module (static) so_module (static) http_module (static) mpm_worker_module (static) ... (3 Replies)
Discussion started by: penchev
3 Replies

2. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

3. Solaris

Changing "rx_queue_number" in "ixgbe.conf". Reboot or Network Restart?

Hi all, First post here. Working on Solaris 10, on a Sun t4-4, need to change RX queue depth(ethernet, not HBA) and was wondering if i could get by with just restarting the network or if i should just bounce the whole shebang. Apologies if i missed a similar thread. if there is one, please... (2 Replies)
Discussion started by: caspnx
2 Replies

4. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

cat $como_file | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g'

hi All, cat file_name | awk /^~/'{print $1","$2","$3","$4}' | sed -e 's/~//g' Can this be done by using sed or awk alone (4 Replies)
Discussion started by: harshakusam
4 Replies

7. Shell Programming and Scripting

Can I make "touch" create executable files by manipulating umask?

I'm getting to grips with this concept of the umask. What I thought was, setting umask uga+rwx would result in creating files with all permissions for everyone. Seems not to be the case though. Read and write bits get set, but not the execute bit. Is there some gap in my understanding, or is... (2 Replies)
Discussion started by: tphyahoo
2 Replies

8. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question