Okay, i use the command: chmod -R ugo+rwx thefolderIwanttochange
Thats fine, but when I create new files or folders within "thefolderIwantochange" they are created with their own permissions (I assume this is normal Unix behaviour) rather than the permissions I set on "thefolderIwanttochange" and any of its subfolders (using the -R)
So I was wondering, is there any way to make it so that when new files or directories are created in "thefolderIwanttochange" or any of its subfolders, that it will automatically have the same permission settings?
Thanks,
Graeme
Last edited by gmclean2006; 06-15-2006 at 12:30 PM..
You control global permission setting using umask. What umask does is - it applies a mask to the global permissions. Normally when files are created, the default permissions set are
Quote:
666 for files
777 for directories
This will be applicable if umask is set to 0(zero). If set a mask value of 022 like
then, the permissions generated are
Quote:
for files -> 666 - 022 = 644 (i.e) rw-r--r--
for dirs -> 777 - 022 = 755 (i.e) rwxr-xr-x
you can see the current umask setting by just giving
Quote:
umask
So, if you want to generate files with a definite set of permissions, you set the umask value accordingly in your .profile file. Ofcourse, you cant set 777 to a file by default as every file need not be executable.
You have to use chmod. There is no other way. The permissions are like that because no one would like their files to be executable by default. Just create a wrapper to give 777 permissions like
Put this into a file called
Quote:
cx
and give the file executable permissions. Then use this to create files with the permissions required.
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)
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)
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)
I copy home directory, file /etc/passwd, file /etc/group, file /etc/master.passwd
to the new server.
This is result of "ls/home" on the old server.
drwxr-xr-x 3 user1 user1 512 Aug 3 2012 user1
drwxr-xr-x 19 user2 user2 2560 Jan 9 09:24... (4 Replies)
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)
Hi. I am new to shell scripting.
I am writing a simple sequential logic script. After completing the script, the instructions say "use the sh command instead of the chmod comand".
Why didn't I have to use "chmod ugo+x scriptname",& then type ./ scriptname or just scriptname after using chmod?... (3 Replies)
Hey, I've got a script using mailx to send an email to the user, but i'd like it if I could have it send the email sometime in the future, not right away. And by future, i mean like 1 minute in the future.
And I don't want it to halt the script in anyway. Perhaps there's a way to have it... (3 Replies)
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)
I've got 100 directories that each have 2 directories with in them.
Structered like this:
/home/domains/domain1/
through to
/home/domains/domain100/
and those 2 directories mentioned above are here:
/home/domains/domain1/directory1/
/home/domains/domain1/directory2/
through to... (7 Replies)