10 More Discussions You Might Find Interesting
1. Solaris
Soft link,Hard link brief explanation (1 Reply)
Discussion started by: RAJU KAVATI
1 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have a file with more than 1 layers of soft links for it. For ex.
ls -la .profile
.profile@ -> /home/act/.profile_abc
ls -la
/home/act/.profile_abc@ -> .profile_final
I want to get the name of the last file (i.e. .profile_final) when I refer to .profile using shell script. I... (2 Replies)
Discussion started by: deo_kaustubh
2 Replies
3. UNIX for Dummies Questions & Answers
I've just started using UNIX in a Linux vmplayer. I'm trying to run the command:
ln -s `pwd`/$1 `python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"`/$1
in a script from an online tutorial, but I keep getting an error message:
ln: creating symbolic link... (1 Reply)
Discussion started by: ChipT
1 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
I have scoured the entire forum for this but to no avail unfortunately. Basically, I would like to remove my symbolic link from my folder name i.e.
foldername -> /a/b/c/d/f
where f is indeed a folder. I have tried rmdir but this does not work and in actual fact deletes the... (4 Replies)
Discussion started by: cyberfrog
4 Replies
5. Solaris
Hi Guys...
I want to create a link using ln -s for a directory that does not exist on the box.
How do I do that?
I had some files from Box A directory /d1/u01 and I copied the files across to another Box lets say Box B on directory /d2/u02.
Now I want a link so that this path /d1/u01... (2 Replies)
Discussion started by: Phuti
2 Replies
6. UNIX for Dummies Questions & Answers
Hi all,
lets consider 2 directories test1 and test2. I want to link test2 to point to test1, how do u do this? (4 Replies)
Discussion started by: Mr. Zer0
4 Replies
7. AIX
I am linking a directory as follows:
ln -sf /home/xxx/userid/real_files/* /home/xxx/userid/linked_files
This gives me symbolic links for all the files in the real_files directory in the linked_files directory. My question is, if I go and remove a file in the real_files directory and then go... (1 Reply)
Discussion started by: rcarnesiii
1 Replies
8. UNIX for Dummies Questions & Answers
Hi,
Is there a limit to the number of symbolic links you can have?
I tried to vi the symbolic link relating to a file and got the following error:
"filename" Too many levels of symbolic links
There is only one symbolic link to one file in this case, but there are >2000 other links to... (2 Replies)
Discussion started by: Bab00shka
2 Replies
9. UNIX for Dummies Questions & Answers
how do i get the list of symbolic link names for a particular file programatically (4 Replies)
Discussion started by: b_u_n_1234
4 Replies
10. UNIX for Dummies Questions & Answers
How can I find all symbolic links across the network to a directory (2 Replies)
Discussion started by: mehtad
2 Replies
CP(1) BSD General Commands Manual CP(1)
NAME
cp -- copy files
SYNOPSIS
cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] source_file target_file
cp [-R [-H | -L | -P]] [-f | -i | -n] [-pv] source_file ... target_directory
DESCRIPTION
In the first synopsis form, the cp utility copies the contents of the source_file to the target_file. In the second synopsis form, the con-
tents of each named source_file is copied to the destination target_directory. The names of the files themselves are not changed. If cp
detects an attempt to copy a file to itself, the copy will fail.
The following options are available:
-H If the -R option is specified, symbolic links on the command line are followed. (Symbolic links encountered in the tree traversal are
not followed.)
-L If the -R option is specified, all symbolic links are followed.
-P If the -R option is specified, no symbolic links are followed. This is the default.
-R If source_file designates a directory, cp copies the directory and the entire subtree connected at that point. This option also causes
symbolic links to be copied, rather than indirected through, and for cp to create special files rather than copying them as normal
files. Created directories have the same mode as the corresponding source directory, unmodified by the process' umask.
Note that cp copies hard linked files as separate files. If you need to preserve hard links, consider using tar(1), cpio(1), or pax(1)
instead.
-f For each existing destination pathname, remove it and create a new file, without prompting for confirmation regardless of its permis-
sions. (The -f option overrides any previous -i or -n options.)
-i Cause cp to write a prompt to the standard error output before copying a file that would overwrite an existing file. If the response
from the standard input begins with the character 'y' or 'Y', the file copy is attempted. (The -i option overrides any previous -f or
-n options.)
-n Do not overwrite an existing file. (The -n option overrides any previous -f or -i options.)
-p Cause cp to preserve in the copy as many of the modification time, access time, file flags, file mode, user ID, and group ID as allowed
by permissions.
If the user ID and group ID cannot be preserved, no error message is displayed and the exit value is not altered.
If the source file has its set user ID bit on and the user ID cannot be preserved, the set user ID bit is not preserved in the copy's
permissions. If the source file has its set group ID bit on and the group ID cannot be preserved, the set group ID bit is not pre-
served in the copy's permissions. If the source file has both its set user ID and set group ID bits on, and either the user ID or
group ID cannot be preserved, neither the set user ID nor set group ID bits are preserved in the copy's permissions.
-v Cause cp to be verbose, showing files as they are copied.
For each destination file that already exists, its contents are overwritten if permissions allow. Its mode, user ID, and group ID are
unchanged unless the -p option was specified.
In the second synopsis form, target_directory must exist unless there is only one named source_file which is a directory and the -R flag is
specified.
If the destination file does not exist, the mode of the source file is used as modified by the file mode creation mask (umask, see csh(1)).
If the source file has its set user ID bit on, that bit is removed unless both the source file and the destination file are owned by the same
user. If the source file has its set group ID bit on, that bit is removed unless both the source file and the destination file are in the
same group and the user is a member of that group. If both the set user ID and set group ID bits are set, all of the above conditions must
be fulfilled or both bits are removed.
Appropriate permissions are required for file creation or overwriting.
Symbolic links are always followed unless the -R flag is set, in which case symbolic links are not followed, by default. The -H or -L flags
(in conjunction with the -R flag) cause symbolic links to be followed as described above. The -H, -L and -P options are ignored unless the
-R option is specified. In addition, these options override each other and the command's actions are determined by the last one specified.
DIAGNOSTICS
The cp utility exits 0 on success, and >0 if an error occurs.
COMPATIBILITY
Historic versions of the cp utility had a -r option. This implementation supports that option, however, its use is strongly discouraged, as
it does not correctly copy special files, symbolic links or fifo's.
The -v and -n options are non-standard and their use in scripts is not recommended.
SEE ALSO
mv(1), rcp(1), umask(2), fts(3), symlink(7)
STANDARDS
The cp command is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
HISTORY
A cp command appeared in Version 1 AT&T UNIX.
BSD
July 23, 2002 BSD