Sponsored Content
Full Discussion: cp -p and permissions
Top Forums UNIX for Dummies Questions & Answers cp -p and permissions Post 19640 by penguin-friend on Monday 15th of April 2002 04:58:46 AM
Old 04-15-2002
cp -p and permissions

Hi all.
Her's what i want to do:
-> copy a file from /tmp to /usr/local/bin, and then give this file the default owner of /usr/local/bin.
My /usr/local/bin belongs to root:sys. When i detar the file mentionned, it keeps the rights it was created with.
How can i achieve what i want to do? A cp -p does not give the file the rights of the new directory...
This is something i'm doing over 400 servers..

Thanx
penguin-friend
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

permissions

with permission set to d-wx--x--x directoryname Why can't I do a long-listing on this directory? Is read access necessary? (1 Reply)
Discussion started by: mma_buc_98
1 Replies

2. UNIX for Dummies Questions & Answers

help with permissions

Can anyone help explain the "s" in the below permissions example. I was reading about the "sticky bit" (t) but I am a little confused. On file "test" wolf% chmod 4777 test wolf% ls -l total 4 drwx------ 2 john staff 512 Mar 19 21:34 nsmail -rwsrwxrwx 1 john staff ... (2 Replies)
Discussion started by: finster
2 Replies

3. UNIX for Dummies Questions & Answers

Permissions

Hi everyone, I'm looking for some information concerning Unix permissions. I am new to Unix and am doing research for a graduate class. Given the permissions below, can anyone give me five unique exploits that would be available to a hacker/cracker given this configuaration? -rw-rw-rw- 1... (1 Reply)
Discussion started by: skeeter
1 Replies

4. UNIX for Dummies Questions & Answers

permissions

I saved a perl code in xemacs. I used an xterminal to execute it but unix said that I don't have permission. I saved the files in my home directory. How do I change the permission. This is hat unix said: -ksh: ./names.pl: cannot execute (5 Replies)
Discussion started by: lnatz
5 Replies

5. HP-UX

Permissions

Hey, We've got quite a strange problem on our hands here. We are running an HP 9000/800 B.11.00. I've just created a new group in /etc/group which i called, let's say newgroup . Then I added 4 users to the group, namely user1, user2, user3, user4 . The command grpchk shows no strange things... (4 Replies)
Discussion started by: chrizz
4 Replies

6. HP-UX

To give the "unzip" permissions & "create" file permissions

Hi, I am a Unix Admin. I have to give the permissions to a user for creating new file in a directory in HP-Ux 11.11 system since he cannot able to create a new file in the directory. Thanks in advance. Mike (3 Replies)
Discussion started by: Mike1234
3 Replies

7. Shell Programming and Scripting

permissions

My /tmp is set with the following permissions (777) and a 't' at the end. My umask is set to 022. When I create a directory under /tmp (tmp/xx) it gets created as 755 as expected. Yet when I create a file within that directory (/tmp/xx/yy) the permissions are not 755 they are 644. ... (1 Reply)
Discussion started by: BeefStu
1 Replies

8. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

9. UNIX for Dummies Questions & Answers

Permissions

Hi, I have noticed that on my Linux box there is a nice feature which make it impossible for specified member (owner, group or other) to have an given access if a member from which we would expect it more don't have that access. So it is impossible to read file by all if others have set read... (3 Replies)
Discussion started by: DavidMax
3 Replies

10. Shell Programming and Scripting

Permissions

Hi guys, i write the below script to make the user get to the directory that interesting. Now what I am trying is to check the permissions of the directory and if the directory exists to check the reading options. echo "Please enter your desire folder directory ( \yourfolders) ?: \c" ... (9 Replies)
Discussion started by: mikerousse
9 Replies
install(1)						      General Commands Manual							install(1)

NAME
install - Installs a command SYNOPSIS
install [-sS] [-c targetdir] [-g group] [-m mode] [-u owner] file [searchdir...] install [-osS] [-f targetdir] [-g group] [-m mode] [-u owner] file [searchdir...] install [-g group] [-iosS] [-m mode] [-n targetdir] [-u owner] file [searchdir...] install [-g group] [-MosS] [-m mode] [-u owner] file [searchdir...] The install command installs file in a specific place within a file system. It is most often used in makefiles. OPTIONS
Installs file in targetdir only if there is not already a copy there. If there is a copy of file in targetdir, the command issues a mes- sage to that effect and exits without overwriting the file. This option can be used alone or with the -g, -m, -s, -S, or -u options. Forces installation of file in targetdir even if a copy already exists there. If there is already a copy of file in targetdir, the command sets the new copy's mode and owner to those of the old copy. If there is not already a copy of file in targetdir, the command sets the mode to 755 and the owner to bin. This option can be used alone or with the -g, -m, -o, -s, -S, or -u options. Specifies a group other than bin for the destination file. Ignores the default directory search list. Searches for the file to be installed only in the directo- ries specified on the command line (searchdir ...). This option cannot be used with the -c, -f, or -M options. Moves file to targetdir instead of copying it. This option cannot be used with the -c, -f, -i, or -n options. Specifies a mode other than 755 for the destination file. Installs file in targetdir if there is no copy in any of the searched directories (searchdir ...). Sets the mode of the file to 755 and the owner to bin. This option cannot be used with the -c, -f, or -M options. Saves the old copy of file by renaming it OLDfile and leaving it in the directory where it was found. This option cannot be used with the -c option. Specifies an owner other than bin for the destination file. Suppresses the display of all but error messages. Causes the binary to be stripped after installation; see strip(1). DESCRIPTION
The install command copies (or moves) file into the appropriate directory, retaining the owner and permissions of the existing copy, if any. A newly created file has permission code 755, owner bin, and group bin. The install command writes a message telling you which files it is replacing or creating and where they are going. If you supply no options or search directories (searchdir ...), the install command searches the /bin, /usr/bin, /etc, /lib, and /usr/lib directories in that order for a file with the same name as file. The command overwrites the first matching file with file and issues a message indicating that it has done so. If no match is found, the command tells you and exits without taking further action. If any search directories (searchdir ...) are specified on the command line, the install command searches them before it searches the default directories. EXAMPLES
To replace a command that already exists in one of the default directories, enter: install fixit This replaces the file fixit if it is found in the /bin, /usr/bin, /etc, /lib, or /usr/lib directory. Otherwise, the file fixit is not installed. For example, if /usr/bin/fixit exists, then this file is replaced by a copy of the file fixit in the current direc- tory. To replace a command that already exists in a specified or default directory while preserving the old version, enter: install -o fixit /etc /usr/games This replaces the file fixit if it is found in the /etc or /usr/games directory, or in one of the default directories. Otherwise, the file fixit is not installed. If the file is replaced, the old version is preserved by renaming it OLDfixit in the directory in which it was found. To replace a command that already exists in a specified directory, enter: install -i fixit /u/judith/bin /u/bernice/bin /usr/games This replaces the file fixit if it is found in the /u/judith/bin, /u/bernice/bin, or /usr/games directory. Otherwise, the file is not installed. To replace a command found in a default directory, or install it in a specified directory if it is not found, enter: install -n /usr/bin fixit This replaces the file fixit if it is found in one of the default directories. If the file is not found, it is installed as /usr/bin/fixit. To install a new command, enter: install -c /usr/bin fixit This creates a new command by installing a copy of the fixit file as /usr/bin/fixit, but only if this file does not already exist. To install a command in a specified directory whether or not it already exists, enter: install -f /usr/bin -o -s fixit This forces the fixit file to be installed as /usr/bin/fixit whether or not /usr/bin/fixit already exists. The old version, if any, is preserved by renaming it to /usr/bin/OLDfixit (a result of the -o option). The messages that tell where the new command was installed are suppressed (a result of the -s option). SEE ALSO
Commands: chgrp(1), chmod(1), chown(1), cp(1), installbsd(1), make(1), mv(1), strip(1) install(1)
All times are GMT -4. The time now is 07:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy