Sponsored Content
Top Forums Shell Programming and Scripting Changing file permissions of a file created by another user Post 302753669 by qwertyu on Wednesday 9th of January 2013 07:22:51 AM
Old 01-09-2013
Setting permissions :

If it were a compressed file already, then why is the "compression" option available where we can specify metadata_only, data_only, all or none ??
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

changing file permissions

Use the following to Change permission of fileB (fileB could be fileB*) to change its permission same as the permission of fileA. chmod `ls -l fileA | awk '{pr int "u+", substr($1,2,1), substr($1,3,1), substr($1,4,1), ",g+", substr($1,5,1), substr($1,6,1), substr($1,7,1), ",o+",... (0 Replies)
Discussion started by: gagansharma
0 Replies

2. UNIX for Advanced & Expert Users

Changing permissions of a user

So I need to change the permissions of my user account. I can access the root account on the server, but don't know how to change the permissions of my user account. I was advised to try 'userconf' to see if I am part of a group, but I dunno how that works. ANyone who knows how to see the... (3 Replies)
Discussion started by: achink125
3 Replies

3. UNIX for Advanced & Expert Users

Changing file permissions on upload

Hello ! When I connect to a RH FTP server, the files I transfer (from my "windows computer") to this server have the following permissions : -rw------- but I would like those files to have the following permissions : - rw-rw-r-x How can I do that ??? :) Thanks for your help ! G. (6 Replies)
Discussion started by: guix
6 Replies

4. UNIX for Dummies Questions & Answers

changing default file permissions

How can I change the default permissions that are assigned when I create a file? (By default the file has: -rw-r--r-- ..... I'd like it to be -rw-r----- How can I change this default behavior? (8 Replies)
Discussion started by: FredSmith
8 Replies

5. UNIX for Dummies Questions & Answers

Changing file permissions

Is there a way to change a unix user's default file permissions so that when he creates a file, by default permissions are 777??? Thanks! (7 Replies)
Discussion started by: FredSmith
7 Replies

6. Cybersecurity

changing /cn@0:console file permissions

I'm doing a security sweep of a Sun Sol 5.8 system. The file: /dev/console, which links to /devices/pseudo/cn@0:console, has the following perms: crw--w--w- I would like to get rid of the world write permissions. I can change the file permissions, but as soon as log back in, they are changed... (4 Replies)
Discussion started by: ErnieG
4 Replies

7. Shell Programming and Scripting

HELP changing file permissions

does anyone know how to write a script that will change file permissions. because the Admin blocked me from altering any of my files im only allowed to read and i heard a script like this can bypass it but i dont know how to write it. Display current users. Display user Ids only. Display... (10 Replies)
Discussion started by: live2learn
10 Replies

8. Homework & Coursework Questions

changing permissions of a file whos name was passed to 755

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script that gives a passed file the "755" access permissions. The shell script should: Change... (0 Replies)
Discussion started by: anix007
0 Replies

9. Homework & Coursework Questions

changing permissions of a file whos name was passed to 755

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a shell script that gives a passed file the "755" access permissions. The shell script should: Change... (5 Replies)
Discussion started by: anix007
5 Replies

10. UNIX for Dummies Questions & Answers

Creating a File system with required permissions for all DIR's created in

Hello All, I am application admin. I need to clear all the temporary files cleared by the applications. I need help/suggestion that is there any way to create a file system such that every Dir created in by any user will have 775 permissions. So, that i can simply clear the temporary file which... (6 Replies)
Discussion started by: firestar
6 Replies
umask(1)						      General Commands Manual							  umask(1)

NAME
umask - set or display the file mode creation mask SYNOPSIS
Set Mask Display Mask DESCRIPTION
The command sets the value of the file mode creation mask or displays the current one. The mask affects the initial value of the file mode (permission) bits for subsequently created files. Setting the File Mode Creation Mask The command sets a new file mode creation mask for the current shell execution environment. mask can be a symbolic or numeric (obsoles- cent) value. A symbolic mask provides a flexible way of modifying the mask permission bits individually or as a group. A numeric mask specifies all the permission bits at one time. When a mask is specified, no output is written to standard output. A symbolic mask replaces or modifies the current file mode creation mask. It is specified as a comma-separated list of operations in the following format. Whitespace is not permitted. [who][operator][permissions][, ...] The fields can have the following values: who One or more of the following letters: Modify permissions for user (owner). Modify permissions for group. Modify permissions for others. Or: Modify permissions for all = operator One of the following symbols: Add permissions to the existing mask for who. Delete permissions from the existing mask for who. Replace the existing mask for who with permissions. permissions One or more of the following letters: The read permission. The write permission. The execute/search permission. If one or two of the fields are omitted, the following table applies: | Format Entered Effect | Input Equals ---------------------------------------------------------+---------------- who Delete current permissions for who | operator No action | (none) permissions Equal to: | Delete current permissions for who | No action | (none) No action | (none) whopermissions Equal to: | operatorpermissions Equal to: | A numeric mask replaces the current file mode creation mask. It is specified as an unsigned octal integer, constructed from the logical OR (sum) of the following mode bits (leading zeros can be omitted): Displaying the Current Mask Value To display the current file mode creation mask value, use one of the commands: Print the current file mode creation mask in a symbolic format: The characters (read), (write), and (execute/search) represent the bits that are clear in the mask for (user/owner), (group), and (other). All other bits are set. Print the current file mode creation mask as an octal value. The zero bits in the numeric value correspond to the displayed and permission characters in the symbolic value. The one bits in the numeric value correspond to the missing permission characters in the symbolic value. Depending on implementation, the display consists of one to four octal digits; the first digit is always zero (see DEPENDENCIES). The rightmost three digits (leading zeros implied as needed) represent the bits that are set or clear in the mask. Both forms produce output that can be used as the mask argument to set the mask in a subsequent command. General Operation When a new file is created (see creat(2)), each bit that is set in the file mode creation mask causes the corresponding permission bit in the the file mode to be cleared (disabled). Conversely, bits that are clear in the mask allow the corresponding file mode bits to be enabled in newly created files. For example, the mask (octal disables group and other write permissions. As a result, files normally created with a file mode shown by the command as (octal become mode (octal while files created with file mode (octal become mode (octal Note that the file creation mode mask does not affect the set-user-id, set-group-id, or "sticky" bits. The file creation mode mask is also used by the command (see chmod(1)). Since affects the current shell execution environment, it is generally provided as a shell regular built-in (see DEPENDENCIES). If is called in a subshell or separate utility execution environment, such as one of the following: it does not affect the file mode creation mask of the calling environment. The default mask is (octal RETURN VALUE
exits with one of the following values: The file mode creation mask was successfully changed or no mask operand was supplied. An error occurred. EXAMPLES
In these examples, each line show an alternate way of accomplishing the same task. Set the value to produce read and write permissions for the file's owner and read permissions for all others displays on newly created files): Set the value to produce read, and write permissions for the file's owner, read-only for others users in the same group, and no access to others Set the value to deny read, write, and execute permissions to everyone Add the write permission to the current mask for everyone (there is no equivalent numeric mode): WARNINGS
If you set a mask that prevents read or write access for the user (owner), many programs, such as editors, that create temporary files will fail because they cannot access the file data. DEPENDENCIES
The command is implemented both as a separate executable file and as built-in shell commands. POSIX Shell and Separate File All features are supported (see sh-posix(1)). The numeric mask display uses a minimum of two digits. Korn Shell The option is not supported in the Korn shell built-in command (see ksh(1)). The numeric mask display uses a minimum of two digits. C Shell The option and symbolic mask values are not supported in the C shell built-in command (see csh(1)). The numeric mask display uses a mini- mum of one digit. SEE ALSO
chmod(1), csh(1), ksh(1), sh-posix(1), sh(1), chmod(2), creat(2), umask(2). STANDARDS CONFORMANCE
umask(1)
All times are GMT -4. The time now is 05:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy