Sponsored Content
Full Discussion: Symlinks
Top Forums UNIX for Dummies Questions & Answers Symlinks Post 302169610 by jim mcnamara on Thursday 21st of February 2008 05:15:33 PM
Old 02-21-2008
You have to use
Code:
find / -type l

which is expensive.
And if a filesystem with symlinks is not mounted at the time you don't see it.

See Perderabo's post:
Symbolic Links
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

search and replace symlinks

Hello All, Assuming i have a thousand symlinks under directory /mydir (and its sub-dir) such as: mysymlink1 -> ../../../myfoo/mysymlink1 mysymlink2 -> ../../../myfoo/mysymlink2 How can I search the string "myfoo" and replaced with "yourfoo" such that after the operation is complete the... (2 Replies)
Discussion started by: nixrock
2 Replies

2. Shell Programming and Scripting

Nested Symlinks?

Please don't laugh or call me a fool... I'm trying to set up a script that will go through my Music File directory and generate a set of symbolic links in a directory called "What's New". Within that directory there will be a "30 Days", "3 Months", "6 Months" and "A Year" directories. Within... (0 Replies)
Discussion started by: deckard
0 Replies

3. Shell Programming and Scripting

preserve timestamp of symlinks using rsync

Hi, In my shell programming, When i copy sym links from one server to another server using rsync it does not preserve time stamp . it showing current time after copying in destination server.the command i used is rsync -vaR -- How can i preserve sym links time stamp using rsync. Thanx (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

4. UNIX for Dummies Questions & Answers

tar symlinks: relative vs absolute

I create the tar file from / like so: tar cEhf name.tar usr/us And this creates the tar with the links intact. The problem is that this tar is going to be used for testing, so we want the links to point to the files in the tar. But when I extract the tar into /tmp, I get /tmp/usr/us/... as I... (2 Replies)
Discussion started by: TreeMan
2 Replies

5. Shell Programming and Scripting

Following Symlinks to Actual Script

I need to have my script know what directory it's in, even if it's run from a symlink located elsewhere. Here's what I've come up with, for the benefit of anyone with a similar need, but I'm also interested to know if there's a more elegant solution. I'd rather not get into awk-land, but I couldn't... (2 Replies)
Discussion started by: jeffclough
2 Replies

6. UNIX for Dummies Questions & Answers

Problems using RCP with symlinks. Trying to use CPIO instead

Hello, I have inherited an old Solaris box and I have to copy all of its files onto another machine, a Centos Box. The Solaris box it so ancient is does not have rsync, scp or any other useful copy functions. I tried using RCP but it handles symlinks terribly: Extraneous data is written to my... (1 Reply)
Discussion started by: mojoman
1 Replies

7. Slackware

Context dependent symlinks

Ive got multiple PCs, sharing an NFS mounted home dir. For certain apps I would like to keep the config files host specific. Easy solution is to create symlinks to local folders for configs. Ideally I would still want the .config files to reside in the user home folder. Is it possible to... (2 Replies)
Discussion started by: agentrnge
2 Replies

8. Shell Programming and Scripting

Look for, backup and delete symlinks

Hi, My first post here: Was looking if someone can help enhancing my code. I am limited to sh or ash shell (android / busybox) I made a script to look for busybox symlinks, backup them and delete them I have these questions about the below code: - busybox tar do not has the options... (2 Replies)
Discussion started by: Phil3759
2 Replies

9. Shell Programming and Scripting

Find + Symlinks = me confused

So i have read the man pages a few time. Searched google but I am not quite sure i understand all the lingo. What i want to do is list all files on / except i dont want any symlinks (because if I am searching / I will find the "true" file...correct?) So there is the -P, -H, and '-type l'... (2 Replies)
Discussion started by: nitrobass24
2 Replies

10. Shell Programming and Scripting

Rsync move with symlinks

Hi, I use rsync to move from source to target, but there are cases that I need to exclude: Suppose in my file system, I have a soft link ~/data -> /media/volgrp/data. Under data folder, there is a file hello.txt. After moving command "rsync --remove-source-files -aH --force ~/data/... (3 Replies)
Discussion started by: huangyingw
3 Replies
Paranoid::Glob(3pm)					User Contributed Perl Documentation				       Paranoid::Glob(3pm)

NAME
Paranoid::Glob - Paranoid Glob objects VERSION
$Id: Glob.pm,v 0.2 2010/04/21 09:07:30 acorliss Exp $ SYNOPSIS
$obj = Paranoid::Glob->new( globs => [ qw(/lib/* /sbin/* /etc/foo.conf) ], literals => [ qw(/tmp/{sadssde-asdfak}) ], ); print "Expanded globs: ", join(" ", @$obj); $rv = $obj->addGlobs(qw(/etc/* /bin/*)); $rv = $obj->addLiterals(qw(/etc/foo.conf)); $obj->consolidate; @existing = $obj->exists; @readable = $obj->readable; @writable = $obj->writable; @executable = $obj->executable; @owned = $obj->owned; @directories = $obj->directories; @files = $obj->files; @symlinks = $obj->symlinks; @pipes = $obj->pipes; @sockets = $obj->sockets; @blockDevs = $obj->blockDevs; @charDevs = $obj->charDevs; $obj->recurse(1, 1); DESCRIPTION
The primary purpose of these objects is to allow an easy way to detaint a list of files and/or directories while performing shell expansion of names. It does this with a caveat, however. If a given file or directory name exists on the file system as a literal string (regardless of whether it has shell expansion characters in it) it will be added as such. It is only filtered through bsd_glob if it does not exist on the file system. The objects can also be created with instructions to explicitly treat all names as literal strings. Any undef or zero-length strings passed in the files array are silently removed. As a convenience subsets of the expanded files can be returned based on the common stat/lstat tests. Please note the obvious caveats, however: asking for a list of directories will fail to list directories if the effective user does not have privileges to read the parent directory, etc. This is no different than performing '-d', etc., directly. If you care about privilege/permission issues you shouldn't use these methods. An additional method (recurse) falls outside of what a globbing construct should do, but it seemed too useful to leave out. SUBROUTINES
/METHODS new $obj = Paranoid::Glob->new( globs => [ qw(/lib/* /sbin/* /etc/foo.conf) ], literals => [ qw(/tmp/{sadssde-asdfak}) ], ); This class method creates a Paranoid::Glob object. It can be constructed with optional literal strings and/or globs to expand. All are filtered through a [[:print:]] regex for detainting. Any undefined or zero-length strings are silently removed from the arrays. The object reference is a blessed array reference, which is populated with the expanded (or literal) globs, making it easy to iterate over the final list. If any entry in the globs array fails to detaint this method will return undef instead of an object reference. addGlobs $rv = $obj->addGlobs(qw(/etc/* /bin/*)); Adds more globs to the object that are detainted and filtered through bsd_glob. Returns false if any strings fail to detaint. All undefined or zero-length strings are silently removed. addLiterals $rv = $obj->addLiterals(qw(/etc/foo.conf)); Adds more literal strings to the object that are detainted. Returns false if any strings fail to detaint. All undefined or zero-length strings are silently removed. consolidate $obj->consolidate; This method removes redundant entries and lexically sorts the contents of the glob. exists @existing = $obj->exists; This object method returns a list of all entries that currently exist on the filesystem. In the case of a symlink that exists but links to a nonexistent file it returns the symlink as well. readable @readable = $obj->readable; This method returns a list of all entries that are currently readable by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is readable, just as a normal stat or -r function would. writable @writable = $obj->writable; This method returns a list of all entries that are currently writable by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is writable, just as a normal stat or -w function would. executable @executable = $obj->executable; This method returns a list of all entries that are currently executable by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is executable, just as a normal stat or -x function would. owned @owned = $obj->owned; This method returns a list of all entries that are currently owned by the effective user. In the case of a symlink it returns the symlink only if the target of the symlink is owned, just as a normal stat or -o function would. directories @directories = $obj->directories; This method returns a list of all the directories. In the case of a symlink it returns the symlink if the target of the symlink is a directory, just as a normal stat or -d function would. files @files = $obj->files; This method returns a list of all the files. In the case of a symlink it returns the symlink if the target of the symlink is a file, just as a normal stat or -f function would. symlinks @symlinks = $obj->symlinks; This method returns a list of all the symlinks. pipes @pipes = $obj->pipes; This method returns a list of all the pipes. In the case of a symlink it returns the symlink if the target of the symlink is a pipe, just as a normal stat or -p function would. sockets @sockets = $obj->sockets; This method returns a list of all the sockets. In the case of a symlink it returns the symlink if the target of the symlink is a socket, just as a normal stat or -S function would. blockDevs @blockDevs = $obj->blockDevs; This method returns a list of all the block device nodes. In the case of a symlink it returns the symlink if the target of the symlink is a block device node, just as a normal stat or -b function would. charDevs @charDevs = $obj->charDevs; This method returns a list of all the character device nodes. In the case of a symlink it returns the symlink if the target of the symlink is a character device node, just as a normal stat or -c function would. recurse $obj->recurse; $obj->recurse(1); $obj->recurse(1, 1); This method with recursively load all filesystem entries underneath any directories already listed in the object. It returns true upon completion, or false if any errors occured (such as Permission Denied). Two optional boolean arguments can be passed to it: Option1: Follow Symlinks Option2: Include "Hidden" directories Both options are false by default. If Option1 (Follow Symlinks) is true any symlinks pointing to directories will be recursed into as well. Option2 in its default false setting excludes dot files or directories just as normal shell expansion would. Setting it to true causes it to include (and recurse into) hidden files and directories. DEPENDENCIES
o Carp o Errno o Fcntl o File::Glob o Paranoid o Paranoid::Debug BUGS AND LIMITATIONS
AUTHOR
Arthur Corliss (corliss@digitalmages.com) LICENSE AND COPYRIGHT
This software is licensed under the same terms as Perl, itself. Please see http://dev.perl.org/licenses/ for more information. (c) 2009, Arthur Corliss (corliss@digitalmages.com) perl v5.14.2 2010-05-03 Paranoid::Glob(3pm)
All times are GMT -4. The time now is 11:15 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy