![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
another boring unix question
ok, you had it coming:
how do I list symbolic links and only (symbolic links) in a certain folder? can't find the paramater for it with the "ls" command. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
oh i forgot
need to show the symbolic link and the place it points to like so: King -> mykingfolder Lear -> mylearfolder anyone? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Jan 2004
Location: Vienna, Austria
Posts: 648
|
try ls -al, otherwise if you want to list only symbolic links use find command
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Apr 2003
Location: Loveland, CO
Posts: 5,526
|
ls -al | grep '^l'
?
__________________
Your post count means nothing. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Jul 2003
Posts: 5,344
|
I got this to list me the symbolic links:
find . -type -l |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
|
Just type this in your directory that you are in:
ls -la|grep ^l |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
|
Note that the ^l is ^ Ellllllll not pipe or eye or etc.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Dec 2002
Location: San Diego, CA
Posts: 3,047
|
Jesters-Computer:~ chris$ ls -la|grep ^l
lrwxr-xr-x 1 chris chris 5 2 Mar 11:05 temp -> /home |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Join Date: Oct 2004
Location: Southern California
Posts: 452
|
ls -l | grep \> | grep "lr"
this does a long listing and greps on ">" which indicates a link. As an added filter, you can pipe that output to another grep "lr" which are the first two characters of the permissions string on a symbolic link. This will insure that you have only symbolic links in the output. This will only work on the current directory, as piping 'find' to 'ls' doesn't work. To search subdirectories, try this series of commands: ------------------------------------------------- shellprompt$ ls -l|grep "drw"|awk '{print "ls -l "$9" | grep \\> | grep \"lr\""}' > linksearch shellprompt$ . linksearch ----------------------------------------------- You could put the above in an executable script and run it from anywhere. I'm sure there are even better ways to do this. find . -name "*" -l n will work so long as you know the exact number of links a given file has, and has the advantage of walking an entire hierarchy. I hope this helps. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Confirmed User
Join Date: Dec 2001
Location: NY, NY, USA
Posts: 131
|
find . -maxdepth 1 -type l
Thats 1 as in one, and the l as in Link. So I agree with Zester. |
![]() |
![]() ![]() ![]() ![]() ![]() |