stevepedwards.com/DebianAdmin linux mint IT admin tips info

Linux Commands + Packages – How Many, and What For?

Linux has thousands of applications and programmes available to it, some are fundamental to its operation as part of the base system, and most are optional additions that can be added as required by the user. So how many are there and how can you find out what each does or what it depends on etc?

There are projects such as the Linux Documentation Project:

http://wiki.tldp.org/FrontPage

whose aim is to provide info on the system and many Apps etc. but you can find info on your own system using the man command, e.g.

man a2enmod

A2ENMOD(8) A2ENMOD(8)

NAME
a2enmod, a2dismod - enable or disable an apache2 module

SYNOPSIS
a2enmod [module]

a2dismod [module]

DESCRIPTION
This manual page documents briefly the a2enmod and a2dismod commands.

a2enmod is a script that enables the specified module within the apache2 conâ
figuration....

or by:

stevee@raspberrypi ~ $ apt-cache
apt 0.9.7.9 for armhf compiled on Oct 28 2014 23:08:37
Usage: apt-cache [options] command
apt-cache [options] showpkg pkg1 [pkg2 ...]
apt-cache [options] showsrc pkg1 [pkg2 ...]

apt-cache is a low-level tool used to query information
from APT's binary cache files

Commands:
gencaches - Build both the package and source cache
showpkg - Show some general information for a single package
showsrc - Show source records
stats - Show some basic statistics
dump - Show the entire file in a terse form
dumpavail - Print an available file to stdout
unmet - Show unmet dependencies
search - Search the package list for a regex pattern
show - Show a readable record for the package
depends - Show raw dependency information for a package
rdepends - Show reverse dependency information for a package
pkgnames - List the names of all packages in the system
dotty - Generate package graphs for GraphViz
xvcg - Generate package graphs for xvcg
policy - Show policy settings

Options:
-h This help text.
-p=? The package cache.
-s=? The source cache.
-q Disable progress indicator.
-i Show only important deps for the unmet command.
-c=? Read this configuration file
-o=? Set an arbitrary configuration option, eg -o dir::cache=/tmp
See the apt-cache(8) and apt.conf(5) manual pages for more information.

For example:

stevee@raspberrypi ~ $ apt-cache showpkg ntop
Package: ntop
Versions:
3:4.99.3+ndpi5517+dfsg3-1 (/var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages) (/var/lib/dpkg/status)
Description Language:
File: /var/lib/apt/lists/mirrordirector.raspbian.org_raspbian_dists_wheezy_main_binary-armhf_Packages
MD5: 8d7e6637c6b740b203a76421995fd582

Reverse Depends:
ntop-dbg,ntop 3:4.99.3+ndpi5517+dfsg3-1
ntop-data,ntop 3:4.0
ntop-data,ntop 3:4.0
ntop-data,ntop 3:4.99.3+ndpi5517+dfsg3-1
harden-nids,ntop
Dependencies:
3:4.99.3+ndpi5517+dfsg3-1 - libc6 (2 2.13-28) libgcc1 (2 1:4.4.0) libgdbm3 (2 1.8.3) libgeoip1 (2 1.4.8+dfsg) libpcap0.8 (2 0.9.8) libpython2.7 (2 2.7) librrd4 (2 1.3.0) zlib1g (2 1:1.1.4) debconf (18 0.5) debconf-2.0 (0 (null)) ntop-data (5 3:4.99.3+ndpi5517+dfsg3-1) python-mako (0 (null)) net-tools (0 (null)) adduser (0 (null)) passwd (0 (null)) graphviz (0 (null)) gsfonts (0 (null))
Provides:
3:4.99.3+ndpi5517+dfsg3-1 -
Reverse Provides:

or by using the "--help" switch appended to many commands to give a summarised list of switch options, in many cases:

stevee@raspberrypi ~ $ htop --help
htop 1.0.1 - (C) 2004-2011 Hisham Muhammad
Released under the GNU GPL.

-C --no-color Use a monochrome color scheme
-d --delay=DELAY Set the delay between updates, in tenths of seconds
-h --help Print this help screen
-s --sort-key=COLUMN Sort by COLUMN (try --sort-key=help for a list)
-u --user=USERNAME Show only processes of a given user
-v --version Print version info

Long options may be passed with a single dash.

Press F1 inside htop for online help.
See 'man htop' for more information.

So how many binaries are there and what are they?

A list of programs can be output, sorted alphabetically and read page by page using the compgen -c command:

compgen -c | sort | less

:
!
.
[
[
[[
]]
{
}
2to3
2to3-2.7
2to3-3.2
411toppm
a2dismod
a2dissite
a2enmod
a2ensite
a2p
ab
accept
accessdb
aconnect
addftinfo
addgroup
addpart
addr2line
add-shell
adduser

You could then try the man cmd against these to find what they do - if there is a man page written for it e.g.

man [

TEST(1) User Commands TEST(1)

NAME
test - check file types and compare values

SYNOPSIS
test EXPRESSION
test

[ EXPRESSION ]
[ ]
[ OPTION.....

To find how many there are, use the line listing of word count, wc:

root@raspberrypi:/home/stevee# compgen -c | sort | wc -l
1922

About 2000 base function system type binary commands for this Linux flavour and release version.

What about the packages available for this flavour? The can be listed from a-z using:

dpkg --list

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================-=======================================-============-============================================================================
ii adduser 3.113+nmu3 all add and remove users and groups
ii alsa-base 1.0.25+3~deb7u1 all ALSA driver configuration files
ii alsa-utils 1.0.25-4 armhf Utilities for configuring and using ALSA...

I assume the total packages installed so far must be:

root@raspberrypi:/home/stevee# dpkg -l | wc -l
903

Why? Well, the total packages available for this flavour is given by:

apt-cache -h

pkgnames - List the names of all packages in the system

apt-cache pkgnames

This gives a scrolling list about 40,000 lines long, so may take some seconds, but counted with wc -l, gives:

root@raspberrypi:/home/stevee# apt-cache pkgnames | wc -l
37503

 

Comments are closed.

Post Navigation