How to find all the links in a folder in UNIX or Linux?

DWQA QuestionsCategory: LinuxHow to find all the links in a folder in UNIX or Linux?
Editor Staff asked 2 months ago

How to find all the links in a folder in UNIX or Linux?

1 Answers
Editor Staff answered 2 months ago

You have ln command for creating and updating soft links but nothing which gives you all the links in a directory. You need to use the ls command which lists everything in the directory and then you need to list all the links, as they start with “l” as first characters, as shown in the above article.
here is the actual UNIX command to find all links in a directory :
linux@user12:~ ls -lrt
total 2.0K
-rw-r–r– 1 Linux Domain Users 0 Dec 6 2011 a
drwxr-xr-x+ 1 Linux Domain Users 0 Sep 19 12:30 java/
lrwxrwxrwx 1 Linux Domain Users 4 Sep 19 12:31 version_1.0 -> java/
linux@user12:~ ls -lrt | grep ‘^l’
lrwxrwxrwx 1 Linux Domain Users 4 Sep 19 12:31 version_1.0 -> java/