Tech Junkie Blog - Real World Tutorials, Happy Coding!: Linux Package Management: Viewing Shared Libraries With ldd And pmap

Monday, June 6, 2022

Linux Package Management: Viewing Shared Libraries With ldd And pmap

 As a Linux administrator you will eventually have to deal with libraries.  Libraries are the building blocks of applications and most applications uses shared libraries among them.  I could be beneficial to load the shared libraries from a centralized location.  For example if you want to load shared libraries for developers in a particular location, you can do that.

To load the libraries from a cached location we first need to view the shared libraries in the application/process.  Let's work with the currently running process.  First let's get the processes that are running with the ps -l command.  The first way you can view the shared libraries information is by running the ldd command, the ldd command needs the path to the process.  





As you can see bash is one of the processes that is currently running that is a good candidate to run the ldd command on, but we don't know the path to the process.  We can get more information about the process with the command ps aux | grep bash







From the ps aux command we found out the the path of the process is /bin/bash for root so we can finally view the libraries for bash with the command ldd /bin/bash

As you can see that was quite a lot of work to get to the path.  There's another way to get the libraries for bash and that is the pmap command.  For the pmap command you will need the pid of the process so to see the bash process libraries you can type pmap 870




5 comments:

  1. Very informative and intriguing blog. I am very happy to visit your blog. Now I am found what I want. I check your blog every day and try to learn something from your blog. Thank you and waiting for your new post. Also, Visit my website.Assignment Help Services

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. Very helpful blog. I am very happy to visit your blog. Now I am found what I want. I check your blog every day and try to learn something from your blog. Thank you and waiting for your new post. Also, Visit my website too. Thank you.

    ReplyDelete
  5. very nice Content. Visit now: https://www.avashutters.ca/

    ReplyDelete

Search This Blog