LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 11-21-2006, 11:09 PM   #1
makkays
Member
 
Registered: Oct 2006
Posts: 36

Rep: Reputation: 15
urgent umask problem


hello,

there was previous related thread to umask question but it was unable to satisfy my problem.

1.If i change defualt umask will that same umask be aplicable to both files and directories or it will be for only files or directories.

2. i am logging through Root.now i wish to change umask to 022.in which file i have to mention it and what will be the coding command which i will have to write in the file.

thanks

makkays
 
Old 11-22-2006, 05:52 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
  1. Yes it should apply to both files and directories
  2. Hopefully you are only logging in as root when doing sysadmin and not daily use. You can put the umask value in your ~/.bash_profile or /etc/profile e.g.
    Code:
    umask 022
 
Old 11-22-2006, 06:35 AM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
If you're even unsure, just test it.
Code:
for testmask in 012 345 677; do 
  umask $testmask
  mkdir $testmask.d
  touch f$testmask.f
done
ls -l
This table summarizes the results:
Code:
umask :  0   1   2   3   4   5   6   7
dir   : rwx rw- r-x r-- -wx -w- --x ---
file  : rw- rw- r-- r-- -w- -w- --- ---
If the octal argument confuses you, you can use symbolic mode:
Code:
umask a=rx,ug+w
The manual page describes this in more detail, and has quite a few examples.
 
Old 11-22-2006, 07:43 AM   #4
makkays
Member
 
Registered: Oct 2006
Posts: 36

Original Poster
Rep: Reputation: 15
thanks a lot reddaz and mathewg42.thanks for quick responce

regards
 
  


Reply


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
boot sector and lilo collapse !!!!! URGENT URGENT URGEN !!!!! frelihm Linux - Software 21 12-02-2009 11:21 AM
Permissions problem...samba...umask? yanik Linux - General 2 01-27-2006 08:10 AM
vsftp umask and permission problem dagalicous Linux - Software 2 10-22-2003 09:55 PM
vsftpd umask-problem hihachi Linux - Software 0 03-19-2003 05:16 PM
umask...inheritance of file attributes problem iam3 Linux - General 0 11-11-2001 09:44 AM


All times are GMT -5. The time now is 10:03 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration