[plug] more basic linux stuff

James Devenish devenish at guild.uwa.edu.au
Thu Jan 8 09:38:30 WST 2004


In message <005d01c3d534$9f97fea0$7100000a at DRIFTA>
on Wed, Jan 07, 2004 at 11:40:48PM +0800, Paul Stone wrote:
> sorry for the newbie questions, but where are the program directorys in
> linux? eg.. if i wanted to goto the "mysql" directory and type "mysql" to do
> some work, where would i find it?

One trick that hasn't been mentioned in this e-mail thread, yet, is
"locate"-style databases. For example, GNU fileutils includes a set of
programmes that build a nightly (or weekly or monthly, depending) list
of files on your computer. You can then use `locate bin/mysql`, for
instace, to find all files containing the path "bin/mysql". For an
ext2/ext3 filesystem, this is much more efficient than actually
traversing the filesystem with the `find` command. The disadvantage is
that the database is only built "periodically", meaning it can become
out of date.

> I did the apt-get install ftpd thing but im not sure if its running (
> I tried ftp'ing to localhost but it didnt work )

Just a further point about "daemons" (e.g. servers, like ftpd): You will
normally find a list of files in the /etc/init.d directory. For example,
I have a file called /etc/init.d/proftpd (which is installed by the
proftpd package). If I run this command:

% /etc/init.d/proftpd
Usage: /etc/init.d/proftpd {start|force-start|stop|reload|restart|force-reload}

You can see that there are a number of commands that can be run, such as
'stop', 'start', 'reload' and 'restart'. Although proftpd will normally
be stopped and started when your computer is turned on or off, you may
need to reload or restart a server after changing its configuration. If
you want to see if a daemon is running, you can normally run a command
such as `pgrep`. For instance:

% pgrep -lf proftpd
684 proftpd (accepting connections)

You can also check a network daemon for its use of a specific TCP or UDP
port. For example:

% netstat -l | grep ftp
tcp        0      0 *:ftp         *:*      LISTEN

This indicates that the daemon is "listening on all interaces" and would
word even if you didn't know the name of your FTP server software.





More information about the plug mailing list