October 16, 2018

Basic Linux Tips and Tricks, Part 2 - page 3

Finding Solutions

  • October 8, 2007
  • By A. Lizard

dmesg prints the startup boot message file onscreen. To get this info into a text file (if you're asking for help, you are likely to be asked for a copy):

$ dmesg > bootmessage.txt
  • lsmod lists the active kernel modules. (Kernel modules are software installed into the Linux kernel itself, usually drivers.)
  • lsusb lists the active USB hardware. If your problem is a USB peripheral, anyone willing to help you fix this is going to want to see this information. If you want more than a simple device listing,
  • lsusb v
  • lsusb vv (v is for verbose; v prints more information about the devices, vv prints a lot more info.)

You can search within the terminal as well. If you are using the KDE Konsole application from your desktop, just use the Edit > Find in history menu command.

You can also save your terminal session with "Save History As," and you can print or e-mail the text file as a file attachment, or simply copy/paste into your e-mail or a web forum where someone asked for it.

One thing you will need to determine is, is the application you want to run actually installed?

You can search for a package without having to become root.

alizard@terrarium:~$ aptitude search apache
$ p   apache                - versatile, high-performance HTTP server

The most important status tags (shown in the left column)

  • p--purged, no configuration files on system, totally removed or never installed
  • c--package removed, configurations files remain
  • i--installed
  • C--half installed; program install attempt failed

Finding where any given file is:

$ locate filename

If you just installed a package and can't find it:

# updatedb

and take a coffee break, updatedb takes a few minutes to run. Then enter

# cd /var/lib/dpkg/info

look for the application filename with a .list extension and open it with a text editor. Unfortunately, there is no equivalent directory for rpm.

terrarium: /var/lib/dpkg/info# ls lha*
$ nano lha.list

Usually, the entry in /bin, /sbin, /usr (in /usr or the directory tree under it), or /opt or /etc will contain the executable. /usr/share will contain docs, or there may be docs or configuration files under /programname, e.g., /etc/nut/.

Configuration files are usually in the form of programname.conf and if the program has its own directory, it will usually be there.

This will also solve the occasional problem of finding out where the installer put the files on an application you just installed and can't find as menu entry or icon. Installing a program and not being able to discover where it went can be frustrating.

Most Popular LinuxPlanet Stories