Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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!

share|improve this question
    
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 Jul 15 '11 at 0:25

3 Answers 3

up vote 3 down vote accepted

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. It's a bit out of date, but a major update is in the works and should be released soon.

share|improve this answer

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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