Searching for soft-links

Posted on 2001-06-05
Medium Priority
Last Modified: 2010-04-21
Hi.  Can someone show me how to search my directory and all subdirectories for soft-links?

Question by:Alex_Tong
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 38

Accepted Solution

yuzh earned 40 total points
ID: 6158243
Hi  Alex_Tong,

   You cd to you home directory, then type in the following

   find . -type l -print

   this will print all the soft-links file on your screen,
you can save this list to a file use:
   find .

   . stand for the current dir. If you login as ROOT, you
can print all the soft-links in your system use:

   find / -type l -print


Expert Comment

ID: 6158941
hi ,

in addition :

try :
ls -l | grep lrwx at each directory :

ls -l * | grep lrwx
ls -l */* | grep lrwx
ls -l */*/* | grep lrwx
ls -l */*/*/* | grep lrwx
ls -l */*/*/*/* | grep lrwx


but this for certain deep tree .


Expert Comment

ID: 6160202
... or ls -lR | grep '^lrwx'

using find is the best way.

Regards, Nisus.

Expert Comment

ID: 6165123
if you searching soft links in all the dirs the u can use

find / -type l -ls | more

if u are searching for a particular file  the
find / -type l -ls | grep filename

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question