Welcome to the most active Linux Forum on the web.
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 11-21-2006, 11:09 PM   #1
Registered: Oct 2006
Posts: 36

Rep: Reputation: 15
urgent umask problem


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 i wish to change umask to which file i have to mention it and what will be the coding command which i will have to write in the file.


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

Rep: Reputation: 75
  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.
    umask 022
Old 11-22-2006, 06:35 AM   #3
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
If you're even unsure, just test it.
for testmask in 012 345 677; do 
  umask $testmask
  mkdir $testmask.d
  touch f$testmask.f
ls -l
This table summarizes the results:
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:
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
Registered: Oct 2006
Posts: 36

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



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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:46 AM.

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