Jump to content
Sign in to follow this  
antifanboy

Awk pipe to detect linked files?

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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 ?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

How about:

 

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

 

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...