Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Awk pipe to detect linked files?
#1

Hi.

I need to pipe ls -l | awk' STUFF TO DETECT LINKED & SYMLINKED FILES ' > 1 { print }'

any help with the ' STUFF TO DETECT part is highly appreciated.

Thx. Kpratt out.

Reply
#2

Quote:Hi.I need to pipe ls -l | awk' STUFF TO DETECT LINKED & SYMLINKED FILES ' > 1 { print }'

any help with the ' STUFF TO DETECT part is highly appreciated.

Thx. Kpratt out.
 

Do you think you could be a little less vague ?

Reply
#3

I don't get your question, if you want to see all the link files, you can make something like

example

1.

find /bin -type l

 

./dnsdomainname

./ex

./red

./nisdomainname

 

2.

ls -la `find /bin -type l`

 

lrwxrwxrwx 1 root root 4 Jan 29 2007 /bin/awk -> gawk

lrwxrwxrwx 1 root root 4 Jan 29 2007 /bin/csh -> tcsh

lrwxrwxrwx 1 root root 8 Jan 29 2007 /bin/dnsdomainname -> hostname

lrwxrwxrwx 1 root root 8 Jan 29 2007 /bin/domainname -> hostname

 

3.

ls -la `find /bin -type l` | awk {' print $9 " " $10 " " $11'}

 

/bin/awk -> gawk

/bin/csh -> tcsh

/bin/dnsdomainname -> hostname

/bin/domainname -> hostname

/bin/egrep -> grep

 

 

and you can do more than this, just ask your question, so we or I can understand it.

Reply
#4

How about:

 



Code:
ls -l | awk -F"> " '/ -> /{ print $2 }'




 

Not sure exactly what you are looking for but there you go.

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)