02-21-2012
@rangarasan: umask doesn't work that way. It masks permissions defined in its parameter and not provides permissions.
So, when you say umask 022, you're masking write permission for group and others.
@sanoop: When you say umask 777, you're masking all permissions. So no permission will be provided to file.
A work-around would be to create a file and then provide necessary permissions: touch filename; chmod 777 filename
This User Gave Thanks to balajesuri For This Post:
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Please provide your inputs..
Thanks in Advance,
Mansa (1 Reply)
Discussion started by: mansa
1 Replies
2. Cybersecurity
User usrA creates dirA directory and runs chmod 777 on the directory. Can usrB issue another 777 on dirA? It appears the answer is no even if the usrA and usrB are part of the same group. I know this is a rare scenario but I just ran across it and found out that usrB receives an error when... (4 Replies)
Discussion started by: zlek131
4 Replies
3. Solaris
Hello Guruz,
Relay bad condition :mad:
Some has changed the permission to 777 recursively for /usr/bin directory by mistake. Now all the permission looks to be 777 on /usr/bin
Hence I am so many system related errors as 1 show below.
When I am trying to change the password, I am getting... (5 Replies)
Discussion started by: bullz26
5 Replies
4. Shell Programming and Scripting
In my script, I am creating a file ----> then writting one line (i.e. Timestamp) ----> then FTP'ing. The same script can be executed by many other users.
While other users executing this script, they couldn't Over write this one line (i.e. Timestamp)
My expectation
So I wanted to create a... (2 Replies)
Discussion started by: sbmk_design
2 Replies
5. Shell Programming and Scripting
Here is the sample code I'm trying to execute. I see that the permission on the file is set to 755 always I want to change it to 777. Please help me with this.
code :
#!/usr/bin/perl
use File::Path qw(make_path remove_tree);
my $path = "2010/sam";
make_path($path,{mode=>0777});
... (1 Reply)
Discussion started by: hansini
1 Replies
6. Shell Programming and Scripting
Hi All,
Is there any unix(solaris) command to get file permissions in 777 format or do we need to write some script for it? (7 Replies)
Discussion started by: rishav
7 Replies
7. UNIX for Dummies Questions & Answers
ANy reasons?
FILESYSTEM not FULL, PERMISSION is 777, but cant write to the filesystem?
any steps to do? reasons for this? (9 Replies)
Discussion started by: kenshinhimura
9 Replies
8. Shell Programming and Scripting
Hello,
I am looking for a UNIX shell script which can help me for access restriction.
1) /home/ram, there are number file with .txt extension, which should be only owned "ram" user.
like as below
ls -lrt *.txt
-rwx------ 1 ram dba 11 Jan 4 2015 PASS1.txt
-rwx------ 1 ram dba 10 Jan 4... (8 Replies)
Discussion started by: mr.trilok
8 Replies
9. Programming
Hi All,
I'm looking for JAVA code to create file in Linux with specific permission
File should be created and saved in Linux in this path \opt\sys\doc by Java with this permission 764
Anyone can help to provide this Java code (3 Replies)
Discussion started by: AbuAliiiiiiiiii
3 Replies
mkdir(1) User Commands mkdir(1)
NAME
mkdir - make directories
SYNOPSIS
mkdir [-m mode] [-p] dir...
DESCRIPTION
The mkdir command creates the named directories in mode 777 (possibly altered by the file mode creation mask umask(1)).
Standard entries in a directory (for instance, the files ".", for the directory itself, and "..", for its parent) are made automatically.
mkdir cannot create these entries by name. Creation of a directory requires write permission in the parent directory.
The owner-ID and group-ID of the new directories are set to the process's effective user-ID and group-ID, respectively. mkdir calls the
mkdir(2) system call.
setgid and mkdir
To change the setgid bit on a newly created directory, you must use chmod g+s or chmod g-s after executing mkdir.
The setgid bit setting is inherited from the parent directory.
OPTIONS
The following options are supported:
-m mode This option allows users to specify the mode to be used for new directories. Choices for modes can be found in chmod(1).
-p With this option, mkdir creates dir by creating all the non-existing parent directories first. The mode given to intermedi-
ate directories will be the difference between 777 and the bits set in the file mode creation mask. The difference, how-
ever, must be at least 300 (write and execute permission for the user).
OPERANDS
The following operand is supported:
dir A path name of a directory to be created.
USAGE
See largefile(5) for the description of the behavior of mkdir when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes).
EXAMPLES
Example 1: Using mkdir
The following example:
example% mkdir -p ltr/jd/jan
creates the subdirectory structure ltr/jd/jan.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of mkdir: LANG, LC_ALL, LC_CTYPE, LC_MES-
SAGES, and NLSPATH.
EXIT STATUS
The following exit values are returned:
0 All the specified directories were created successfully or the -p option was specified and all the specified directories now
exist.
>0 An error occurred.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
SEE ALSO
rm(1), sh(1), umask(1), intro(2), mkdir(2), attributes(5), environ(5), largefile(5), standards(5)
SunOS 5.10 1 Feb 1995 mkdir(1)