doubleudee1
Posts: 158
Joined: Fri Nov 30, 2018 2:39 pm
Location: Wales

Finding symlinks - command to?

Wed Oct 02, 2019 8:49 am

Hi
If I use this command :-

Code: Select all

find . -type l -ls
I get results such as:-

Code: Select all

z
    662821      0 lrwxrwxrwx   1 root             root                    8 Feb 28  2019 ./usr/share/man/man1/gtbl.1.gz -> tbl.1.gz
    663259      0 lrwxrwxrwx   1 root             root                   10 Jan  5  2019 ./usr/share/man/man1/zfgrep.1.gz -> zgrep.1.gz
    664194      0 lrwxrwxrwx   1 root             root                   12 Apr 27 13:55 ./usr/share/man/man1/arm-linux-gnueabihf-ld.gold.1.gz -> l                                     d.gold.1.gz
    664011      0 lrwxrwxrwx   1 root             root                   12 Apr 27 13:55 ./usr/share/man/man1/arm-linux-gnueabihf-readelf.1.gz -> r                                     eadelf.1.gz
    663457      0 lrwxrwxrwx   1 root             root                    8 Apr 11 12:53 ./usr/share/man/man1/pip2.1.gz -> pip.1.gz
    664139      0 lrwxrwxrwx   1 root             root                    9 Mar 31  2019 ./usr/share/man/man1/perl5.28.1.1.gz -> perl.1.gz
    663369      0 lrwxrwxrwx   1 root             root                   14 May 30 16:27 ./usr/share/man/man1/openssl-errstr.1ssl.gz -> errstr.1ssl                                     .gz
    663683      0 lrwxrwxrwx   1 root             root                   17 May 30 16:27 ./usr/share/man/man1/openssl-asn1parse.1ssl.gz -> asn1pars                                     
.sh
    655188      0 lrwxrwxrwx   1 root             root                   15 Jul 10 01:09 ./etc/rc5.d/S01rsync -> ../init.d/rsync
    656447      0 lrwxrwxrwx   1 root             root                   14 Sep 25 13:03 ./etc/rc5.d/S01smbd -> ../init.d/smbd
    654363      0 lrwxrwxrwx   1 root             root                   58 Nov  5  2018 ./etc/fonts/conf.d/11-lcdfilter-default.conf -> /usr/share                                     /fontconfig/conf.avail/11-lcdfilter-default.conf
    654358      0 lrwxrwxrwx   1 root             root                   33 Aug 16  2016 ./etc/fonts/conf.d/57-dejavu-sans.conf -> ../conf.avail/57                                     -dejavu-sans.conf
    654381      0 lrwxrwxrwx   1 root             root                   50 Nov  5  2018 ./etc/fonts/conf.d/49-sansserif.conf -> /usr/share/fontcon                                     fig/conf.avail/49-sansserif.conf
    654367      0 lrwxrwxrwx   1 root             root                   42 Aug 16  2016 ./etc/fonts/conf.d/58-dejavu-lgc-sans-mono.conf -> ../conf                                     .avail/58-dejavu-lgc-sans-mono.conf
    654372      0 lrwxrwxrwx   1 root             root                   46 Aug 16  2016 ./etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf -> ../                                     conf.avail/20-unhint-small-dejavu-sans.conf
    654380      0 lrwxrwxrwx   1 root             root                   46 Nov  5  2018 ./etc/fonts/conf.d/51-local.conf -> /usr/share/fontconfig/                                     conf.avail/51-local.conf
    654387      0 lrwxrwxrwx   1 root             root                   46 Nov  5  2018 ./etc/fonts/conf.d/45-latin.conf -> /usr/share/fontconfig/                                     conf.avail/45-latin.conf
    654366      0 lrwxrwxrwx   1 root             root                   50 Nov  5  2018 ./etc/fonts/conf.d/80-delicious.conf -> /usr/share/fontcon                                     fig/conf.avail/80-delicious.conf
    656042      0 lrwxrwxrwx   1 root             root                   51 Sep  9 14:56 ./etc/fonts/conf.d/30-opensymbol.conf -> /usr/share/fontco                                     nfig/conf.avail/30-opensymbol.conf
    654388      4 lrwxrwxrwx   1 root             root                   62 Nov 30  2017 ./etc/fonts/conf.d/90-fonts-linux-libertine.conf -> /usr/s                                     hare/fontconfig/conf.avail/90-fonts-linux-libertine.conf
    654374      0 lrwxrwxrwx   1 root             root                   48 Nov  5  2018 ./etc/fonts/conf.d/69-unifont.conf -> /usr/share/fontconfi                                     g/conf.avail/69-unifont.conf
    654360      0 lrwxrwxrwx   1 root             root                   55 Jul 10 01:11 ./etc/fonts/conf.d/10-hinting-slight.conf -> /usr/share/fo                                     ntconfig/conf.avail/10-hinting-slight.conf
    654377      0 lrwxrwxrwx   1 root             root                   49 Nov  5  2018 ./etc/fonts/conf.d/40-nonlatin.conf -> /usr/share/fontconf                                     ig/conf.avail/40-nonlatin.conf
    654356      0 lrwxrwxrwx   1 root             root                   58 Nov  5  2018 ./etc/fonts/conf.d/20-unhint-small-vera.conf -> /usr/share                                     /fontconfig/conf.avail/20-unhint-small-vera.conf
    654386      0 lrwxrwxrwx   1 root             root                   50 Nov  5  2018 ./etc/fonts/conf.d/90-synthetic.conf -> /usr/share/fontcon                                     fig/conf.avail/90-synthetic.conf
    654361      0 lrwxrwxrwx   1 root             root                   55 Nov  5  2018 ./etc/fonts/conf.d/30-metric-aliases.conf -> /usr/share/fo                                     ntconfig/conf.avail/30-metric-aliases.conf
    654390      0 lrwxrwxrwx   1 root             root                   38 Aug 16  2016 ./etc/fonts/conf.d/57-dejavu-sans-mono.conf -> ../conf.ava                                     il/57-dejavu-sans-mono.conf
    654359      0 lrwxrwxrwx   1 root             root                   51 Aug 16  2016 ./etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf -                                     > ../conf.avail/20-unhint-small-dejavu-sans-mono.conf
    654389      0 lrwxrwxrwx   1 root             root                   50 Aug 16  2016 ./etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans.conf ->                                      ../conf.avail/20-unhint-small-dejavu-lgc-sans.conf
    654379      0 lrwxrwxrwx   1 root             root                   46 Nov  5  2018 ./etc/fonts/conf.d/60-latin.conf -> /usr/share/fontconfig/                                     conf.avail/60-latin.conf
    654383      0 lrwxrwxrwx   1 root             root                   47 Aug 16  2016 ./etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf -> ..                                     /conf.avail/20-unhint-small-dejavu-serif.conf
    654369      0 lrwxrwxrwx   1 root             root                   48 Nov  5  2018 ./etc/fonts/conf.d/45-generic.conf -> /usr/share/fontconfi                                     g/conf.avail/45-generic.conf
    654368      0 lrwxrwxrwx   1 root             root                   55 Aug 16  2016 ./etc/fonts/conf.d/20-unhint-small-dejavu-lgc-sans-mono.co                                     nf -> ../conf.avail/20-unhint-small-dejavu-lgc-sans-mono.conf
    654378      0 lrwxrwxrwx   1 root             root                   51 Aug 16  2016 ./etc/fonts/conf.d/20-unhint-small-dejavu-lgc-serif.conf -                                     > ../conf.avail/20-unhint-small-dejavu-lgc-serif.conf
    654391      0 lrwxrwxrwx   1 root             root                   49 Nov  5  2018 ./etc/fonts/conf.d/65-nonlatin.conf -> /usr/share/fontconf                                     ig/conf.avail/65-nonlatin.conf
    654385      0 lrwxrwxrwx   1 root             root                   34 Aug 16  2016 ./etc/fonts/conf.d/57-dejavu-serif.conf -> ../conf.avail/5                                     7-dejavu-serif.conf
    654362      0 lrwxrwxrwx   1 root             root                   59 Jan  9  2014 ./etc/fonts/conf.d/30-0-google-crosextra-carlito-fontconfi                                     g.conf -> ../conf.avail/30-0-google-crosextra-carlito-fontconfig.conf
    654371      0 lrwxrwxrwx   1 root             root                   45 Nov  5  2018 ./etc/fonts/conf.d/50-user.conf -> /usr/share/fontconfig/c                                     onf.avail/50-user.conf
    654376      0 lrwxrwxrwx   1 root             root                   48 Nov  5  2018 ./etc/fonts/conf.d/60-generic.conf -> /usr/share/fontconfi                                     g/conf.avail/60-generic.conf
    654357      0 lrwxrwxrwx   1 root             root                   59 Nov  5  2018 ./etc/fonts/conf.d/10-scale-bitmap-fonts.conf -> /usr/shar                                        
    
What would be the code to be able to find all symlinks that were made in a certain month (e.g September)?

Thanks
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. :)

tpyo kingg
Posts: 640
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Finding symlinks - command to?

Wed Oct 02, 2019 9:06 am

The find utility kind of can do that, but some of it depends on your file system. Take a look at -newerXY and use the m and t options there, if the B option is not supported.

Code: Select all

find . -type l  -not -newermt 2019-10-01 -newermt 2019-09-01 -ls
However, that gets the modification times. Would that be close enough? Not all file systems support Bt insted of mt.

Edit: off-by-one correction

doubleudee1
Posts: 158
Joined: Fri Nov 30, 2018 2:39 pm
Location: Wales

Re: Finding symlinks - command to?

Wed Oct 02, 2019 9:26 am

tpyo kingg wrote:
Wed Oct 02, 2019 9:06 am
The find utility kind of can do that, but some of it depends on your file system. Take a look at -newerXY and use the m and t options there, if the B option is not supported.

Code: Select all

find . -type l  -not -newermt 2019-10-01 -newermt 2019-09-01 -ls
However, that gets the modification times. Would that be close enough? Not all file systems support Bt insted of mt.

Edit: off-by-one correction
Thanks I've run them all into a txt file using :-

Code: Select all

 sudo find . -type l -ls >> /home/pi/symlinks_all.txt 2>&1
But searching it is a nightmare!
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. :)

doubleudee1
Posts: 158
Joined: Fri Nov 30, 2018 2:39 pm
Location: Wales

Re: Finding symlinks - command to?

Wed Oct 02, 2019 9:30 am

Sorry, no output with that command.
Make the most of your family and friends , your children grow up too quickly and you don't notice yourself ageing, friends dissapearing, moving on. You make plans for your future, but they can all be smashed in an instant, live life and enjoy. :)

tpyo kingg
Posts: 640
Joined: Mon Apr 09, 2018 5:26 pm
Location: N. Finland

Re: Finding symlinks - command to?

Wed Oct 02, 2019 12:19 pm

Are you in the right directory? It might help to use an absolute path instead of a relative path.

Return to “Troubleshooting”