LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-07-2008, 07:21 AM   #1
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Rep: Reputation: 39
Question find command displays unexpected results


Hi All,
I was trying to find all symlinks under a specific folder to do this i used:-
find /bar/foo/ -type l

This works fine on the most part and produced expected results appart from one of the results returned was very odd...output something like...
/bar/foo/bar/link
/bar/foo/foo/link
/nothing/to/do/with/bar/foo/link
/bar/foo/why/link

Get the meaning?? everything was returning from inside /bar/foo as i would expect apart from this one line which appears to have come from somewhere completely different and i've not been able to even find the location yet as there is no such place as:-
/nothing/to/do/.....

As in not possible to go "cd /nothing/to/do/......"

What is happening in this output???

Regards
 
Old 08-07-2008, 07:27 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
If possible, please copy paste the actual command and the actual results. As you describe it, it looks weird, but maybe you are missing something that a fresh pair of eyes can spot, given the original data.
 
Old 08-07-2008, 07:28 AM   #3
sleepyhomme
LQ Newbie
 
Registered: Jan 2006
Posts: 28

Rep: Reputation: 15
The default behavior of find is not following the symbolic link...so if i am not misunderstand your text, how about use -L option of find to force find utility to follow the symbolic link
Code:
find  -L /some/path/for/searching -type l
 
Old 08-07-2008, 05:04 PM   #4
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Weird looks like my reply to this was lost from earlier...hmmm

anyway, the problem was found it was to do with a directory that had been named for some reason accedently ?

don't know why naming a dir ? would cause the problem and i'd be happy for someone to tell me if they know???
 
Old 08-07-2008, 05:31 PM   #5
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,579

Rep: Reputation: 187Reputation: 187
? can be used as a wild card in a file or directory name. So maybe the directory name ? came about by somebody trying to use a wild card name inappropriately.

Similarly maybe the find command uses some other command to follow the link and the subcommand trips over the ? by treating it as a wildcard.

--------------------
Steve Stites
 
Old 08-12-2008, 03:25 AM   #6
helptonewbie
Member
 
Registered: Aug 2006
Location: England Somewhere
Distribution: Mandriva, PCLinuxOS, Karoshi, Suse, Redhat, Ubuntu
Posts: 518

Original Poster
Rep: Reputation: 39
Hi There, i think that sounds about right...it certainly looked like it was not working correctly even when trying to traverse back out of the folder to the top of the tree (so to speak). That it wasn't possible to do cd ../../

It would fail with some weird error....anyway sorted now thanks for the info
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To find Tool in QT designer which displays HTML Contents kiranbud Linux - Software 0 11-25-2005 12:35 AM
How can I find out the reason of unexpected reboot (redhat3+2.6.11)? yuzuohong Linux - General 2 05-24-2005 06:49 PM
Unexpected behaviour with the find command dazdaz Linux - General 3 12-15-2004 09:50 PM
Unexpected Behavior (passwd command) Penguin666 Linux - General 3 11-20-2003 12:34 AM
cp command problem..... unexpected result hamster Linux - General 2 04-10-2003 05:57 PM


All times are GMT -5. The time now is 05:31 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration