A project for Unix/Linux Programming by Corey Forman during the Fall 2011.
This project was begun on DATE and is anticipated(but not limmited) to take 1 week.
The purpose of this project is to explore the files found throught the server. To understand what is in each file. Finally to describe the file.
In order to successfully accomplish/perform this project, the listed resources/experiences need to be consulted/achieved:
The idea i wish to pursue is the exploration of the fact that everything is a file. Files can be seen and moved to using UNIX. I wish to check the following list of locations and see what types of files they contain along with if most are available to us as students or not by looking at the permissions.
To get a better understanding of the layout and structure of the UNIX filesystem, an exploration is in order. Using your observation skills and references, explore the various major directories on the system (starting with '/') and describing the intended purpose of each directory:
Some of the directories you will want to explore are:
State and justify the attributes you'd like to receive upon successful approval and completion of this project.
/
lab46:~$ cd / lab46:/$ ls bin boot dev etc home initrd.img lib lib32 lib64 lost+found media mnt opt proc root sbin selinux srv sys tmp usr var vmlinuz lab46:/$ ls -l total 120 drwxr-xr-x 2 root root 4096 Sep 20 15:12 bin drwxr-xr-x 2 root root 4096 Oct 10 21:13 boot drwxr-xr-x 13 root root 2540 Oct 10 21:14 dev drwxr-xr-x 102 root root 12288 Dec 15 09:05 etc drwxr-sr-t 354 root staff 12288 Sep 20 11:05 home lrwxrwxrwx 1 root root 34 Jun 14 2010 initrd.img -> boot/initrd.img-2.6.32-5-xen-amd64 drwxr-xr-x 10 root root 12288 Aug 28 10:14 lib drwxr-xr-x 4 root root 12288 Oct 10 21:13 lib32 lrwxrwxrwx 1 root root 4 Jun 14 2010 lib64 -> /lib drwx------ 2 root root 16384 Jun 14 2010 lost+found drwxr-xr-x 2 root root 4096 Jun 14 2010 media drwxr-xr-x 2 root root 4096 Jun 1 2010 mnt drwxr-xr-x 2 root root 4096 Jun 14 2010 opt dr-xr-xr-x 251 root root 0 Oct 10 21:14 proc drwx------ 12 root root 4096 Dec 15 12:17 root drwxr-xr-x 2 root root 4096 Aug 28 10:14 sbin drwxr-xr-x 2 root root 4096 Mar 28 2010 selinux drwxr-xr-x 2 root root 4096 Jun 14 2010 srv drwxr-xr-x 13 root root 0 Oct 10 21:14 sys drwxrwxrwt 16 root root 8192 Dec 15 12:33 tmp drwxr-xr-x 12 root root 4096 Aug 28 2010 usr drwxr-xr-x 15 root root 4096 Aug 19 2010 var lrwxrwxrwx 1 root root 31 Jun 14 2010 vmlinuz -> boot/vmlinuz-2.6.32-5-xen-amd64 lab46:/$
All these files are owned by root and we have permission to view them and execute them. We cannot write to them. Most of these files are directories or links with the exception of one file that is a tmp file so we can dump stuff there for others to grab and use.
/bin
lab46:/bin$ ls bash bzexe chgrp date echo gunzip ksh93 login mountpoint netstat pwd sed tailf uncompress zegrep zsh4 bsd-csh bzfgrep chmod dd ed gzexe less ls mt nisdomainname rbash setfont tar unicode_start zfgrep bunzip2 bzgrep chown df egrep gzip lessecho lsmod mt-gnu open readlink sh tcsh vdir zforce busybox bzip2 chvt dir false hostname lessfile mkdir mv openvt rm sh.distrib tempfile which zgrep bzcat bzip2recover cp dmesg fgconsole ip lesskey mknod nano pidof rmdir sleep touch ypdomainname zless bzcmp bzless cpio dnsdomainname fgrep kbd_mode lesspipe mktemp nc ping rnano stty true zcat zmore bzdiff bzmore csh domainname fuser kill ln more nc.traditional ping6 run-parts su umount zcmp znew bzegrep cat dash dumpkeys grep ksh loadkeys mount netcat ps rzsh sync uname zdiff zsh lab46:/bin$
most of these are executable programs that we run everyday. We have permission to use them. there are some links and some red files which i think means they are broken or unavailable to us.
/dev this file contains what are called “block special” files. It also has some directories and a couple symlinks. These block special files are large collection of binary data.
/etc it is a collection of directories and files with a few executable programs sprinkled throughout.
/home this contains the directories of each member of lab46. these are permissible to view at the users discretion.
/lib(/lib32 vs. /lib64)
/lib contains many links and files that are linked and uses shared libs. /lib32 contains 84 pieces form /lib while /lib64 contains all the pieces of /lib because lib64 is a symlink to /lib
/mnt contains nothing at first but when you use ls -a you see it contains two directories which i could not enter on is . and the other is ..
/proc this directory contains u guessed it directories and lots of them. it also contains some files to. All of the directories are permissible to enter and all the files are permissible to read.
/root all that can be seen is one big statement saying “permission denied.”
/sbin this contains many executable of which we can view the code of and execute.
/tmp this file contains some directories of which can all be entered and it contains some files that are readable also. many of the files here are dumped in by other users rather then the root so this is were we put files that others can cp to their directory.
/usr this contains all view able directories with the symlink lib64 and this folder contains the most special directory… the games directory YES!
/var this directory contains all readable and files for all users and one special file for all users. when we change our password it gets stored in the “lock” file which is different then the rest because it is writable to not just readable.
/var/log This file contains many previous log in records and many archived and gziped files. many of these files are not really executable by the users and some are readable but those that are readable are not really readable in their current condition.
/usr/bin this contains many user permitted executable programs that can be run by any user and are commonly run by users.
/usr/sbin different then just sbin because it contains more files and most of which are executable but most appear to e self running scripts.
/usr/src this contains no visible files
/usr/local this contains many user available directories and the link to the man pages.
/usr/local/bin this contains many user available executable but some that only the root can access.
/usr/lib this contains many files found in the normal /lib but with much more added into it. most if not all are available to average users and this file contains a few directories and a lot of symlinks.
there are many areas of lab46 that are user accessible and when we use the things in these directories we can do many things within our UNIX terminal. We need to be knowledgeable of these folders and be quick to move around in this environment making us more productive.
In performing this project, the following resources were referenced: