How to bin/find w/ -follow without searching both link and target


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to bin/find w/ -follow without searching both link and target
# 1  
Old 10-13-2011
How to bin/find w/ -follow without searching both link and target

I am interested in searching links to files not found within a directory, so I use the -follow option. However, the dir may contain links to files that are also found within the dir. That means if I bin/find a bunch of files then search their contents using grep, I get redundant information. An easy way to ignore links to files that are found in the same tree that I'm searching? Thanks in advance.
# 2  
Old 10-14-2011
try this one...
Code:
find -follow -ls | sort -nk1 -u


Last edited by Franklin52; 10-14-2011 at 03:38 AM.. Reason: Please use code tags, thank you
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Moving the target of a symbolic link

Hello all, On a Solaris box, I am trying to move the target of a symbolic link. Let's say the symbolic link looks like the following: /dir1/dir2/link -> /some/dir/target I would like to know of a simple way to move the target of the symbolic link and not the link itself. I'd like to move... (4 Replies)
Discussion started by: ejianu
4 Replies

2. Solaris

How to link sed from /usr/bin/sed to /usr/local/bin/sed?

Hi Guys, OS:- Solaris 10 64Bit I have a small query. On one server a user is facing sed command issue. He gets error regarding sed for this location /users/hoy/2999/batch5/bin/internal.sh: /usr/local/bin/sed: not found How ever the sed is actually present at this location on server:-... (13 Replies)
Discussion started by: manalisharmabe
13 Replies

3. 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

4. Shell Programming and Scripting

how to remove the target of the symbol link in a shell script

I have a target directory, there are some files and directories in "target_dir". I have a symbol link: my_link -> <target_dir> The target directory name is NOT known to the script (because it is varying), while the link name is always fixed. In a shell script, how to remove both the... (1 Reply)
Discussion started by: princelinux
1 Replies

5. Red Hat

/usr/bin/find && -exec /bin/rm never work as expected

hi there, Would you able to advise that why the syntax or statement below couldn't work as expected ? /usr/bin/find /backup -name "*tar*" -mtime +2 -exec /bin/rm -f {} \; 1> /dev/null 2>&1 In fact, I was initially located it as in crontab job, but it doesn't work at all. So, I was... (9 Replies)
Discussion started by: rauphelhunter
9 Replies

6. UNIX for Dummies Questions & Answers

Perl searching and printing multiple target in the same line

Hello, I'm trying to create a program in perl called myfind.pl; To use the program: (at the command line)$ program.pl keyword filename note: the keyword is any word or regular expression and it should display the result just like when you 'cat' the file name but with the keyword in... (2 Replies)
Discussion started by: Horizon666
2 Replies

7. UNIX for Dummies Questions & Answers

change target of a symbolic link

Hi, Is it possible to change the target of a symbolic link? What I currently have is: /home/Data1 /home/Data2 /home/Stores In the Stores directory, I did: ln -s /home/Data1 /home/Stores/abc $ pwd /home/Stores $ ls -latr lrwxrwxrwx 1 dandy dandy 46 Feb 12 16:38 abc ->... (5 Replies)
Discussion started by: dandyrandy
5 Replies

8. UNIX for Dummies Questions & Answers

ZIP a soft / symbolic link target

Hey, How can one ZIP the target of a soft/symbolic link in unix (if dodag@ is a symbolic link for the path car/reno/*.*, how can I zip car/reno/*.*, with using only dodag as my reference)? Thxnk you. (1 Reply)
Discussion started by: galz
1 Replies

9. Shell Programming and Scripting

searching string in unix bin ( executable)

Hi, I want to search a string in unix binary execuateble. I know one command available : strings Can anyone tell me the other commands available to search in unix bin. (1 Reply)
Discussion started by: senthil_is
1 Replies

10. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies
Login or Register to Ask a Question