Linux-Noob Forums

Full Version: Awk pipe to detect linked files?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

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.


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 ?


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.


How about:

 



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




 

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