Identi.ca Identi.ca
  • Login
  • Public

    • Public
    • Groups
    • Featured
    • Popular

Conversation

Notices

  1. softmetz softmetz GNU's Not Unix , Linux

    How can I find all symbolic links that link to a known file? !linux !bash !gnu

    Sunday, 14-Feb-10 11:26:19 UTC from seesmic
    • Vitaliy Kulikov repeated this.
    • Alexandre Oliva Alexandre Oliva

      @softmetz get the inode number with ls -i, then use find -follow -inum <number> from the root of the filesystem

      Sunday, 14-Feb-10 11:35:29 UTC
    • Rafał Maj Rafał Maj

      @softmetz you could scan entire filesystem with find and use -exec or some flag to check if given files points to your target file

      Sunday, 14-Feb-10 11:37:28 UTC
    • softmetz softmetz Alexandre Oliva

      @lxoliva thx. #find #symbolic #link

      Sunday, 14-Feb-10 11:37:36 UTC
    • softmetz softmetz Rafał Maj

      @rmaj Wouldn´t that be slow since it would start a process on each file? #find #symbolic #link

      Sunday, 14-Feb-10 11:42:40 UTC
    • Rafał Maj Rafał Maj

      @softmetz better use with -type to check only links. Also -L option + -printf looks interesting. Write your solution when done :)

      Sunday, 14-Feb-10 11:54:31 UTC
    • softmetz softmetz Alexandre Oliva , Rafał Maj

      @rmaj @lxoliva I´ve got that beast: find -L / -inum "$(ls -di $file | cut -f1 -d' ')" -printf %p Unfortunally it prints lot of loop warnings

      Sunday, 14-Feb-10 12:00:56 UTC
    • Michał Masłowski Michał Masłowski

      @softmetz loops are common on /proc and similar filesystems, use -xdev to avoid these warnings

      Sunday, 14-Feb-10 12:09:55 UTC
    • Ty John Ty John

      @softmetz 'man find' - Look at the '-lname' option

      Sunday, 14-Feb-10 12:29:51 UTC
    • softmetz softmetz Alexandre Oliva , Ty John , Rafał Maj

      @archtynix Gosh! -lname. That was exactly what I searched for. @rmaj @lxoliva that guy is actually smarter than you. :-) #find #links

      Sunday, 14-Feb-10 14:26:27 UTC
    • ve2dmn ve2dmn

      @softmetz check the man page for 'find'. The argument you are looking for is -lname (or -ilname) (ex: "sudo find /sbin -ilname lvm" )

      Sunday, 14-Feb-10 15:52:02 UTC

Site notice

  • API
  • Status

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Identi.ca is a microblogging service brought to you by Status.net. It runs the StatusNet microblogging software, version 1.1.0-alpha1, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Identi.ca content and data are available under the Creative Commons Attribution 3.0 license.

Switch to mobile site layout.

Built in Montreal