LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 02-02-2014, 11:33 AM   #1
Chickentree
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Rep: Reputation: Disabled
find with patterns.


I am running Debian Linux 3.2.51 x86_64 and findutils 4.42. I have been writing a script but have run into a problem. My question is am I doing something wrong, or is this a bug?
In general I am trying to step through the /etc/rcX.d (where X is 1-6) and dump the name of the Start and Kill links but the -lname pattern does not work the same as the -name pattern. For example:

Code:
find  /etc/rc6.d -name "*[KS][0-9][0-9]*" -print
The prints out the name of all the matching names.
/etc/rc6.d/K07hwclock.sh
/etc/rc6.d/K01restorecond
.
.
.
Code:
find  /etc/rc6.d -lname "*[KS][0-9][0-9]*" -print
Does not return anything.
I know there are a couple of ways around this but I would really like to know what I might be missing.

Thanks in Advance,
Mark
 
Old 02-02-2014, 12:01 PM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,104

Rep: Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267Reputation: 2267
find -name will look in the dir /etc/rc6.d but -lname will follow symbolic links and check the target names (instead of the link entries)
 
1 members found this post helpful.
Old 02-02-2014, 12:07 PM   #3
Chickentree
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Wink Solved

Quote:
Originally Posted by pan64 View Post
find -name will look in the dir /etc/rc6.d but -lname will follow symbolic links and check the target names (instead of the link entries)
Thanks! I will put away the brick I have been beating my head against, for now at least.
 
  


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
linux find to find files with multiple patterns subu_s Programming 6 12-15-2010 01:15 AM
SED how to find multiple patterns on a single line yaazz Programming 9 07-31-2009 05:20 AM
tough one: how do you find patterns/sequences in file names? BrianK Programming 5 10-18-2007 01:33 PM
Find patterns programatically ... Four Programming 1 02-16-2007 10:41 PM
Help, help! How to find lines in between searched patterns? wujee Linux - Software 1 01-06-2005 03:52 PM


All times are GMT -5. The time now is 04:25 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration