Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jul 1998 09:16:27 -0500 (CDT)
From:      Mark Tinguely <tinguely@plains.NoDak.edu>
To:        derf@netxxpress.net, freebsd-questions@FreeBSD.ORG
Subject:   Re: Hi
Message-ID:  <199807151416.JAA26105@plains.NoDak.edu>

next in thread | raw e-mail | index | archive | help

>  I'm new at FreeBSD
>  How do I tell the differance between a Program and a Directory?

program (binary executables and scripts) are stored as regular files. Programs
must have the a special execute bit enabled to execute. Directories are
special files that must have the "directory" bit set. to view these special
mode bits, use either the "long" (-l) or "special" (-F) displays in the
program "ls":

 /bin/ls -la
total 374
drwxr-xr-x   3 guest     other    512 Feb 24 16:42 .
drwxr-xr-x  11 root      wheel   3584 Jun 30 08:59 ..
-rw-r--r--   1 guest     other     88 May  8  1995 .kshrc
-rw-r--r--   1 guest     other    582 Apr 11  1996 .profile
drwxr-xr-x   2 guest     other    512 Jul 17  1995 News
-rw-rw-rw-   1 guest     other    515 Feb 24 16:58 photo.bmp
lrwxrwxrwx   1 guest     other      8 Jul 15 08:42 z -> .profile
^^^^^^^^^^     ^^^^^     ^^^^                      ^^^^^^^^^
permissions    owner     group                     filename

the "d" bit signifies that this file is a directory. the directory
"." is the current directory. the directory ".." is the parent directory.

the "l" bit signifies that this file is a symbolic link. A symbolic
link refers the name of an other file or directory and the other file
or dirctory may exist on another filesytem.

not having the "d" or "l" bits set makes the file a regular file.
the files have 3 sets of permissions. A set consists of read, write, and
execute permissions. these three permissions are given/denied for owner,
group and others, searched in that order. if you are a owner and permission
is granted/denied then you are granted/denied that permission. if you
are not the owner, then if you are in the file's group, then you are
granted/denied permission base upon the file's group permission field.
if you are niether owner nor in the group, then your granted/denied
permission is based upon the file's other permission field. The file:

-r--r--rw-   1 guest     other    515 Feb 24 16:58 silly

is readable by everyone and writable only by those that are not the
owner of the file (guest) and not in the group "other".

the file runme (below) has the proper execable flags, but may or may not
be a program. programs also must have "MAGIC" header to they are an
executable and what kind of executable (a.out, elf, linux executable,
script file, etc).

-rwxr-xr-x   1 guest     other    515 Feb 24 16:58 runme

a quick to find out if a file that has the executable bit set is a program
is to run the program "file EXECUTABLE_FILENAME":

$ file runme
runme: setgid FreeBSD/i386 compact demand paged dynamically linked executable

or:

$ file runme
runme: Bourne-Again shell script text

these are a program

>  And I how do I launch a Program?

type the program name:

$ runme			# if program is in your PATH
$ ./runme		# it is in the current directory
$ ../guest/runme	# give a relative location from current directory

>  I'm trying to launch Apache
>  Please some help I cant find where it is at

you can search your PATH for the program by doing:

$ which runme
	^^^^^
	program I searching for

$ find / -name runme
	look through whole system (that my account has permission to traverse)
	for the file runme.

FreeBSD does not ship with Apache installed. If it has not been done yet,
you will need to install Apache from the /usr/ports/www/apache* ...
directory...of course you need to install the ports files manually or
using the /stand/sysinstall facility.

--mark.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807151416.JAA26105>