09-13-2007
9 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi,
when I launch my perl script, I write on the shell:
perl x.pl
How I can can change the permission to write only:
x
to launch the program? (2 Replies)
Discussion started by: Minguccio75
2 Replies
2. Shell Programming and Scripting
how to disable the contraint type of a field (which is present in diffrent tables ) in database using a single unix script file. (4 Replies)
Discussion started by: shaksing
4 Replies
3. Solaris
Hi,
I want to create one user who has right to run chmod command in solaris,
Any Idea? (7 Replies)
Discussion started by: manoj.solaris
7 Replies
4. OS X (Apple)
Hi there,
If we have 2 apps on our customers machines that can both open files of a certain file extension, is there any way via shell commands to set which application should be the default?
Essentially, I'm hoping to replicate Get Info > Open With > Change All, but using a script.
Thanks... (0 Replies)
Discussion started by: davewg
0 Replies
5. Shell Programming and Scripting
Hello,
i want just to change Rights for a few direcories anf files, but some directories must be exclude.
How can i put the command chmod as
chmod -R 755 * exclude toto tata
where toto and tata are directories
Could you help me for that or must I use the find command
Thanks (2 Replies)
Discussion started by: steiner
2 Replies
6. Shell Programming and Scripting
I have changed the premission of a file to 777. Now I would like to change permission to previously used ( UNDO ). Is there any command ?:confused: (3 Replies)
Discussion started by: frintocf
3 Replies
7. UNIX for Dummies Questions & Answers
I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status.
Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies
8. Red Hat
Hello,
I have been going through our environment and I see we have a few servers with LVM's setup and the file system type is still set to "83" within fdisk. If I change this to "8e", will it hurt the data or cause any loss? I need to know for sure before I make the change. (1 Reply)
Discussion started by: s ladd
1 Replies
9. Shell Programming and Scripting
Hello.
I use this command :
rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command.
And no full source directories are in use, only some files.
Source example... (2 Replies)
Discussion started by: jcdole
2 Replies
CHMOD(3) 1 CHMOD(3)
chmod - Changes file mode
SYNOPSIS
bool chmod (string $filename, int $mode)
DESCRIPTION
Attempts to change the mode of the specified file to that given in $mode.
PARAMETERS
o $filename
- Path to the file.
o $mode
- Note that $mode is not automatically assumed to be an octal value, so to ensure the expected operation, you need to prefix $mode
with a zero (0). Strings such as "g+w" will not work properly.
<?php
chmod("/somedir/somefile", 755); // decimal; probably incorrect
chmod("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect
chmod("/somedir/somefile", 0755); // octal; correct value of mode
?>
man 1 chmod' and ' man 2 chmod'.
<?php
// Read and write for owner, nothing for everybody else
chmod("/somedir/somefile", 0600);
// Read and write for owner, read for everybody else
chmod("/somedir/somefile", 0644);
// Everything for owner, read and execute for others
chmod("/somedir/somefile", 0755);
// Everything for owner, read and execute for owner's group
chmod("/somedir/somefile", 0750);
?>
RETURN VALUES
Returns TRUE on success or FALSE on failure.
NOTES
Note
The current user is the user under which PHP runs. It is probably not the same user you use for normal shell or FTP access. The
mode can be changed only by user who owns the file on most systems.
Note
This function will not work on remote files as the file to be examined must be accessible via the server's filesystem.
Note
When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the
script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits.
SEE ALSO
chown(3), chgrp(3), fileperms(3), stat(3).
PHP Documentation Group CHMOD(3)