Linux-Noob Forums
Awk pipe to detect linked files? - Printable Version

+- Linux-Noob Forums (https://www.linux-noob.com/forums)
+-- Forum: Linux Noob (https://www.linux-noob.com/forums/forum-3.html)
+--- Forum: How Do I? (https://www.linux-noob.com/forums/forum-60.html)
+--- Thread: Awk pipe to detect linked files? (/thread-1112.html)



Awk pipe to detect linked files? - antifanboy - 2007-11-01


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.




Awk pipe to detect linked files? - magikman - 2007-11-07


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 ?




Awk pipe to detect linked files? - KobrAs - 2007-11-19


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.




Awk pipe to detect linked files? - znx - 2007-12-04


How about:

 



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




 

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