Sponsored Content
Full Discussion: tar the symbolic link
Top Forums Shell Programming and Scripting tar the symbolic link Post 302198548 by ganga.dharan on Friday 23rd of May 2008 07:04:40 AM
Old 05-23-2008
tar the symbolic link

Hi Experts!!

Can anyone help me out to know how can we tar the symbolic links. I would need to find the symbolic links present in the directory and then tar them out. I can find the links by find . -type l, but i need to know how to tar the symboilc link. Any help would be much appreciated..

Many thanks !!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

symbolic Link

question abt symbolic link ... i'm doing the following ... ln -s x.sh ./scripts/y.sh and cat ./scripts/y.sh it is giving following error cat: cannot open y.sh Any reason u an think of ? But it is working fine when i goto scripts directory and cretae the symbolic link. ... (1 Reply)
Discussion started by: bhargav
1 Replies

2. UNIX for Dummies Questions & Answers

Create Symbolic Link

I am Solaris korn shell. I want to create a symbolic link. I have a directory /u01/ftp01/db I want to reference it as /u05/swe/my (this is not a real directory) I tried a symbolic link but it does not work ln -s /u01/ftp01/db /u05/swe/my ln: cannot create //u05/swe/my: No such... (2 Replies)
Discussion started by: lesstjm
2 Replies

3. UNIX for Dummies Questions & Answers

need some info about symbolic link and hard link

hello folks how y'all doin well i have some questions about symbolic link and hard link hope some one answer me i open terminal and join as root and i wrote ln -s blah blah then i wrote ls i see red file called blah blah but didn't understand what is this can some one explain and... (2 Replies)
Discussion started by: detective linux
2 Replies

4. Solaris

How to copy a symbolic link

Hi I am trying to find a copy command that will copy a symbolic link itself and not what the link is actually pointing to. I am trying to copy a directory that has some symbolic links within it in IBM AIX unix this is achieved using cp -prh <source dir> <target> the 'h' flag is a hard copy... (3 Replies)
Discussion started by: jimthompson
3 Replies

5. Shell Programming and Scripting

symbolic link

Hi, i am trying to create sym links on sles 11 , but it seems i am doing something wrong. oracle@tests:/u01/app/oracle/oradata/ACIS> pwd /u01/app/oracle/oradata/ACIS oracle@tests:/u01/app/oracle/oradata/ACIS> ln -s /db/ACIS/dbase/dbf/ /u01/app/oracle/oradata/ACIS/... (2 Replies)
Discussion started by: tonijel
2 Replies

6. Shell Programming and Scripting

Symbolic Link Help

Hello All, This may be a silly question to some but I am really stuck. Is there a way to reverse the following; sudo rm /bin/sh sudo ln -s /bin/bash /bin/sh It was part of a driver compile/installation procedure by Digi for Ubuntu stating that dash isn't supported and a symbolic link... (2 Replies)
Discussion started by: LAVco
2 Replies

7. Shell Programming and Scripting

ls on a symbolic link

Hi all, Can anyone please confirm if the command below is the only way that I can get what the symbolic link is set to? mnlxd110(oracle)/db/posd2/dba$: ls -l | grep "^l" lrwxrwxrwx 1 oracle dba 28 Aug 9 2011 bdump -> diag/rdbms/posp1/posp1/trace mnlxd110(oracle)/db/posd2/dba$:... (7 Replies)
Discussion started by: newbie_01
7 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Symbolic link not allowed or link target not accessible

Hi everybody, I read about treads realted to this issue but they did not resovle issue given below. Please help me resolve issue given below I have html file under /srv/www/htdocs/actual_folder ls actual_folder/ test.html and following link works... (0 Replies)
Discussion started by: newbielgn
0 Replies

9. How to Post in the The UNIX and Linux Forums

How to list all symbolic link?

how to list all symbolic link, can i use find / path -type l (2 Replies)
Discussion started by: avtalan
2 Replies

10. UNIX for Dummies Questions & Answers

Symbolic link

Hi, trying to understand more about symblic link, when I compiled a program called "match" in one folder ~/downloadsoftware/I want this program to be accessible like a system command by putting a symbolic link in /usr/bin/ Not by setting the $PATH method in .bashrc at this time. What I did is:... (4 Replies)
Discussion started by: yifangt
4 Replies
SYMLINK(7)					       BSD Miscellaneous Information Manual						SYMLINK(7)

NAME
symlink -- symbolic link handling SYMBOLIC LINK HANDLING
Symbolic links are files that act as pointers to other files. To understand their behavior, you must first understand how hard links work. A hard link to a file is indistinguishable from the original file because it is a reference to the object underlying the original file name. Changes to a file are independent of the name used to reference the file. Hard links may not refer to directories and may not reference files on different file systems. A symbolic link contains the name of the file to which it is linked, i.e., it is a pointer to another name, and not to an underlying object. For this reason, symbolic links may reference directories and may span file systems. Because a symbolic link and its referenced object coexist in the file system name space, confusion can arise in distinguishing between the link itself and the referenced object. Historically, commands and system calls have adopted their own link following conventions in a some- what ad-hoc fashion. Rules for more a uniform approach, as they are implemented in this system, are outlined here. It is important that local applications conform to these rules, too, so that the user interface can be as consistent as possible. Symbolic links are handled either by operating on the link itself, or by operating on the object referenced by the link. In the latter case, an application or system call is said to ``follow'' the link. Symbolic links may reference other symbolic links, in which case the links are dereferenced until an object that is not a symbolic link is found, a symbolic link which references a file which does not exist is found, or a loop is detected. (Loop detection is done by placing an upper limit on the number of links that may be followed, and an error results if this limit is exceeded.) There are three separate areas that need to be discussed. They are as follows: 1. Symbolic links used as file name arguments for system calls. 2. Symbolic links specified as command line arguments to utilities that are not traversing a file tree. 3. Symbolic links encountered by utilities that are traversing a file tree (either specified on the command line or encountered as part of the file hierarchy walk). System calls. The first area is symbolic links used as file name arguments for system calls. Except as noted below, all system calls follow symbolic links. For example, if there were a symbolic link ``slink'' which pointed to a file named ``afile'', the system call ``open("slink" ...)'' would return a file descriptor to the file ``afile''. There are nine system calls that do not follow links, and which operate on the symbolic link itself. They are: lchflags(2), lchmod(2), lchown(2), lstat(2), lutimes(3), readlink(2), rename(2), rmdir(2), and unlink(2). Because remove(3) is an alias for unlink(2), it also does not follow symbolic links. When rmdir(2) is applied to a symbolic link, it fails with the error ENOTDIR. The owner and group of an existing symbolic link can be changed by means of the lchown(2) system call. The flags, access permissions, owner/group and modification time of an existing symbolic link can be changed by means of the lchflags(2), lchmod(2), lchown(2), and lutimes(3) system calls, respectively. Of these, only the flags are used by the system; the access permissions and ownership are ignored. The 4.4BSD system differs from historical 4BSD systems in that the system call chown(2) has been changed to follow symbolic links. The lchown(2) system call was added later when the limitations of the new chown(2) became apparent. Commands not traversing a file tree. The second area is symbolic links, specified as command line file name arguments, to commands which are not traversing a file tree. Except as noted below, commands follow symbolic links named as command line arguments. For example, if there were a symbolic link ``slink'' which pointed to a file named ``afile'', the command ``cat slink'' would display the contents of the file ``afile''. It is important to realize that this rule includes commands which may optionally traverse file trees, e.g. the command ``chown file'' is included in this rule, while the command ``chown -R file'' is not. (The latter is described in the third area, below.) If it is explicitly intended that the command operate on the symbolic link instead of following the symbolic link, e.g., it is desired that ``chown slink'' change the ownership of the file that ``slink'' is, whether it is a symbolic link or not, the -h option should be used. In the above example, ``chown root slink'' would change the ownership of the file referenced by ``slink'', while ``chown -h root slink'' would change the ownership of ``slink'' itself. There are four exceptions to this rule. The mv(1) and rm(1) commands do not follow symbolic links named as arguments, but respectively attempt to rename and delete them. (Note, if the symbolic link references a file via a relative path, moving it to another directory may very well cause it to stop working, since the path may no longer be correct.) The ls(1) command is also an exception to this rule. For compatibility with historic systems (when ls is not doing a tree walk, i.e., the -R option is not specified), the ls command follows symbolic links named as arguments if the -H or -L option is specified, or if the -F, -d or -l options are not specified. (The ls command is the only command where the -H and -L options affect its behavior even though it is not doing a walk of a file tree.) The file(1) command is also an exception to this rule. The file(1) command does not follow symbolic links named as argument by default. The file(1) command does follow symbolic links named as argument if -L option is specified. The 4.4BSD system differs from historical 4BSD systems in that the chown and chgrp commands follow symbolic links specified on the command line. Commands traversing a file tree. The following commands either optionally or always traverse file trees: chflags(1), chgrp(1), chmod(1), cp(1), du(1), find(1), ls(1), pax(1), rm(1), tar(1) and chown(8). It is important to realize that the following rules apply equally to symbolic links encountered during the file tree traversal and symbolic links listed as command line arguments. The first rule applies to symbolic links that reference files that are not of type directory. Operations that apply to symbolic links are performed on the links themselves, but otherwise the links are ignored. The command ``rm -r slink directory'' will remove ``slink'', as well as any symbolic links encountered in the tree traversal of ``directory'', because symbolic links may be removed. In no case will rm affect the file which ``slink'' references in any way. The second rule applies to symbolic links that reference files of type directory. Symbolic links which reference files of type directory are never ``followed'' by default. This is often referred to as a ``physical'' walk, as opposed to a ``logical'' walk (where symbolic links ref- erencing directories are followed). As consistently as possible, you can make commands doing a file tree walk follow any symbolic links named on the command line, regardless of the type of file they reference, by specifying the -H (for ``half-logical'') flag. This flag is intended to make the command line name space look like the logical name space. (Note, for commands that do not always do file tree traversals, the -H flag will be ignored if the -R flag is not also specified.) For example, the command ``chown -HR user slink'' will traverse the file hierarchy rooted in the file pointed to by ``slink''. Note, the -H is not the same as the previously discussed -h flag. The -H flag causes symbolic links specified on the command line to be dereferenced both for the purposes of the action to be performed and the tree walk, and it is as if the user had specified the name of the file to which the symbolic link pointed. As consistently as possible, you can make commands doing a file tree walk follow any symbolic links named on the command line, as well as any symbolic links encountered during the traversal, regardless of the type of file they reference, by specifying the -L (for ``logical'') flag. This flag is intended to make the entire name space look like the logical name space. (Note, for commands that do not always do file tree traversals, the -L flag will be ignored if the -R flag is not also specified.) For example, the command ``chown -LR user slink'' will change the owner of the file referenced by ``slink''. If ``slink'' references a directory, chown will traverse the file hierarchy rooted in the directory that it references. In addition, if any symbolic links are encoun- tered in any file tree that chown traverses, they will be treated in the same fashion as ``slink''. As consistently as possible, you can specify the default behavior by specifying the -P (for ``physical'') flag. This flag is intended to make the entire name space look like the physical name space. For commands that do not by default do file tree traversals, the -H, -L and -P flags are ignored if the -R flag is not also specified. In addition, you may specify the -H, -L and -P options more than once; the last one specified determines the command's behavior. This is intended to permit you to alias commands to behave one way or the other, and then override that behavior on the command line. The ls(1) and rm(1) commands have exceptions to these rules. The rm command operates on the symbolic link, and not the file it references, and therefore never follows a symbolic link. The rm command does not support the -H, -L or -P options. To maintain compatibility with historic systems, the ls command acts a little differently. If you do not specify the -F, -d or -l options, ls will follow symbolic links specified on the command line. If the -L flag is specified, ls follows all symbolic links, regardless of their type, whether specified on the command line or encountered in the tree walk. SEE ALSO
chflags(1), chgrp(1), chmod(1), cp(1), du(1), find(1), ln(1), ls(1), mv(1), pax(1), rm(1), tar(1), lchflags(2), lchmod(2), lchown(2), lstat(2), lutimes(3), readlink(2), rename(2), symlink(2), unlink(2), fts(3), remove(3), chown(8) BSD
March 31, 1994 BSD
All times are GMT -4. The time now is 06:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy