04-24-2012
@coolboys. That syntax is incorrect
@sridhardw. See man chmod
10 More Discussions You Might Find Interesting
1. OS X (Apple)
Strangely, chown and chmod don't seem to work on symlinks. In particular, I tried this (as root):
# touch foo
# ln -s foo mysymlink
# chown SOMEUSER mysymlink
as well as changing the last line to:
# chown -h someuser mysymlink
where "-h" is supposed to change the UID of the actualy... (1 Reply)
Discussion started by: noahcowan
1 Replies
2. UNIX for Advanced & Expert Users
How do I change the owner of the process in runtime.I'm working AIX.
I would appreciate ,If I get sample scripts. (1 Reply)
Discussion started by: kkb_karthi
1 Replies
3. UNIX for Advanced & Expert Users
Hi,
I have a file in my system as below
My user and grp id is sns / sns
-rwxrwxrwx 1 sns sns 6012357 Sep 27 06:01 sample
Is there a way to change the owner and grp of this file to app / app ... ie. as given below
-rwxrwxrwx 1 app app 6012357 Sep 27 06:01 sample
I guessed... (1 Reply)
Discussion started by: Sabari Nath S
1 Replies
4. Solaris
Hi,
I own a file, when i try to change the owner of my file to other user it is throwing error like
chown: changing ownership of `a.txt': Not owner
my OS is sunOS 5.8
Thanks. (1 Reply)
Discussion started by: shahnazurs
1 Replies
5. UNIX for Dummies Questions & Answers
How to change the owner of a file.
example:
suppose original owner is A and we want to change to B
Please provide the syntax
Thanks (1 Reply)
Discussion started by: skyineyes
1 Replies
6. Solaris
Hi Folks,
I know that changing users and groups is pretty basic admin, but this one has got me stumped. When I try to change the group of a file for which I am the owner for, it still gives me a 'Not owner' error.
For example, when I am logged in as 'webadmin', I have the following file:
... (4 Replies)
Discussion started by: brizrobbo
4 Replies
7. UNIX for Dummies Questions & Answers
hai,
I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc".
(here "oasitqtc" is the owner of the directory or sub directory.)
i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Discussion started by: gagan4599
6 Replies
8. OS X (Apple)
Would the owner as listed , be the one who made the directory in the first place. when any one could use chown in a script.
I do not know where this directory came form or who made it. And am attempting to just find out more info on it.
what could i use to find its origins and its why does it... (3 Replies)
Discussion started by: cowLips
3 Replies
9. Solaris
i need to do the following operations in solaris 10:
1.change owner and group owner for files which are not owned by the current user and user group
2.to can delete files in the /tmp directory which are not of the current user
3. allow to a standard user the deletion of files in the /tmp... (1 Reply)
Discussion started by: sirmark
1 Replies
10. AIX
Hi.
My example:
I have a filesystem /log. Everyday, log files are copied to /log. I'd like to set owner and permission for files and directories in /log like that
chown -R log_adm /log/*
chmod -R 544 /log/*It's OK, but just at that time. When a new log file or new directory is created in /log,... (8 Replies)
Discussion started by: bobochacha29
8 Replies
LEARN ABOUT CENTOS
fchmodat
FCHMODAT(2) Linux Programmer's Manual FCHMODAT(2)
NAME
fchmodat - change permissions of a file relative to a directory file descriptor
SYNOPSIS
#include <fcntl.h> /* Definition of AT_* constants */
#include <sys/stat.h>
int fchmodat(int dirfd, const char *pathname, mode_t mode, int flags);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
fchmodat():
Since glibc 2.10:
_XOPEN_SOURCE >= 700 || _POSIX_C_SOURCE >= 200809L
Before glibc 2.10:
_ATFILE_SOURCE
DESCRIPTION
The fchmodat() system call operates in exactly the same way as chmod(2), except for the differences described in this manual page.
If the pathname given in pathname is relative, then it is interpreted relative to the directory referred to by the file descriptor dirfd
(rather than relative to the current working directory of the calling process, as is done by chmod(2) for a relative pathname).
If pathname is relative and dirfd is the special value AT_FDCWD, then pathname is interpreted relative to the current working directory of
the calling process (like chmod(2)).
If pathname is absolute, then dirfd is ignored.
flags can either be 0, or include the following flag:
AT_SYMLINK_NOFOLLOW
If pathname is a symbolic link, do not dereference it: instead operate on the link itself. This flag is not currently implemented.
RETURN VALUE
On success, fchmodat() returns 0. On error, -1 is returned and errno is set to indicate the error.
ERRORS
The same errors that occur for chmod(2) can also occur for fchmodat(). The following additional errors can occur for fchmodat():
EBADF dirfd is not a valid file descriptor.
EINVAL Invalid flag specified in flags.
ENOTDIR
pathname is relative and dirfd is a file descriptor referring to a file other than a directory.
ENOTSUP
flags specified AT_SYMLINK_NOFOLLOW, which is not supported.
VERSIONS
fchmodat() was added to Linux in kernel 2.6.16; library support was added to glibc in version 2.4.
CONFORMING TO
POSIX.1-2008.
NOTES
See openat(2) for an explanation of the need for fchmodat().
The GNU C library wrapper function implements the POSIX-specified interface described in this page. This interface differs from the under-
lying Linux system call, which does not have a flags argument.
SEE ALSO
chmod(2), openat(2), path_resolution(7), symlink(7)
COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 2012-05-22 FCHMODAT(2)