4

I recently installed expect on my Ubuntu system and cannot find the example code that is supposed to come with it. I searched /usr/lib /usr/bin/lib /lib...no luck. I guess it's about time I learned how these things are organized.

Your help is greatly appreciated!

  • Err...you wouldn't want example code in */lib as those directories are for libraries in the "link-to-your-program" sense of the word. – dmckee --- ex-moderator kitten Jul 15 '11 at 0:25
8

Example code on Debian-based systems like Ubuntu is usually stored in /usr/share/doc/<package name>/examples.

For more information about what goes in which directory, check out the Filesystem Hierarchy Standard, which Ubuntu follows for the most part.

| improve this answer | |
6

Use this command

dpkg -L {package}

Generally there are two tools for managing packages in debian systems. apt-get and dpkg.

More information in these links :

http://www.cyberciti.biz/tips/linux-debian-package-management-cheat-sheet.html

http://www.cyberciti.biz/howto/question/linux/apt-get-cheat-sheet.php

http://www.cyberciti.biz/howto/question/linux/dpkg-cheat-sheet.php

Cheat sheet for both apt-get and dpkg: https://blog.packagecloud.io/eng/2015/03/30/apt-cheat-sheet/

| improve this answer | |
2

dpkg -L expect will list the /var/lib/dpkg/info/expect.list file for the package which lists full path of the each of the packages files. You may want to pipe it to less so you can read it.

man hier should give you a description of the file system hierarchy used by Debian. The maintainers tend to be quite religious about following it and will often create symlinks to directories to allow programs that don't follow it to work within their structure.

Documentation goes in /usr/share/doc/<package-name>, so expects documentation will be found in /usr/share/doc/expect. There may be multiple example subdirectories below that, along with other directories which may contain runnable code. man pages go elsewhere, but can be found with the command man -k expect.

For other packages just replace expect in the above commands with the package name.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.