How To Find Symlink on Linux server

[Total: 5    Average: 5/5]

How To Find Symlink on Linux server Now, a days sym/root hacking is famous and hacker can create a sym/root folder by using script.This is major security issues. how to find all the symbolic links under a particular directory using the “find” command.

What is symlink ?

In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution

Use the below command to find symlink

[root ~ ]# find /home -type l

The above command will show the Symlink under the /home folder.
OR
If you want to search sym/root folder under users account on server then run the below command in /home

[root ~ ]#  cd /home

[root ~ ]# find -lname /root

The above command will find sym/root folder under all the users but it will take time. There is another method which is described below.

Install mlocate on server using yum.

[root ~ ]# yum install mlocate -y

Once it is installed then run below command to update locate database.

[root ~ ]# updatedb

then run below command to search the server

[root ~ ]#locate sym/root

Above command will locate all the folder which is having symlink of root.