CE-303 SYSTEM PROGRAMMING SSUET/QR/114
LAB # 1 Introduction to Linux Operating System Theory of Linux
Operating system for several types of computer platforms, primarily INTEL based PC’s.
Goal has been to create a UNIX clone.
Free of any commercially copy righted software.
It has all the features of a modern fully fledged UNIX, like;
Multitasking
Multi-user
Programmable Shells
Device independence
Open system portability
Virtual memory
Shared libraries
Demand loading
Proper memory management
TCP/IP networking
Hardware Support
For Redhat Linux
Processor: Intel / AMD, i386 and x86_64, Pentium IV, 2.4 Ghz, 512K cache or Pentium IV, 2.4 Ghz dual processor, 512K cache recommended. Or above.
Hard Disk: 5GB.
Memory: 2 GB (minimum), 4 GB (recommended).
For Fedora (A Red Hat Community Project).
Processor: Intel / AMD, i386 and x86_64, Pentium IV, 2.4 Ghz, 512K cache or Pentium IV, 2.4 Ghz dual processor, 512K cache recommended. Or above.
Hard Disk: 10GB.
Memory: 512 GB (minimum), 1 GB (recommended).
Software Support
Every Linux based OS has GCC, Emacs, X—Windows all standards Unix Utilities, TCP/IP, IPX/SPX, including SLIP and PPP
Copyright
Linux Kernel Copyright belongs to Linux Torvalds
Placed under GNU(General Public License) means that you may freely, copy, change and distribute it.
Linux File System
Linux is committed to the Filesystem Hierarchy Standard (FHS) a collaborative document that defines the names and locations of many files and directories.
Inverted tree structure, with the root at the top. The top directory, /, known as Root Directory.
Linux operating system resides on two file system: the root file system known as /, and a file system mounted under /usr.
/

       /var /bin /sbin /usr /etc /lib

   
adam gwenl
 
        
mail news text data temp
Inverted Tree structure /var (variable data files)
Any program that write log files or need spool or lock directories probably should write them to the /var directory."…. This includes spool directories and files, administrative and logging data, and transient and temporary files."
The /var/spool directory hold data that is of transitory nature, such as mail and news that is recently received from or queued for transmission to another site.
/bin
The /bin directory contains executable programs, know as binaries. Many Linux commands such as ls, arch, cat, cpio etc are actually programs found in this directory.
/sbin
The /sbin directory is also used to store system binary files. Most files (fdisk, halt, hdparm, shutdown etc.) These files are used for system administration purpose.
/usr
The /usr directory and its sub-directories are very important to the operation of your Linux system contains several directories with some of the most important programs.
Sub-directories of /usr contains large software packages.
The /usr directory usually has its own partition, and it should be mountable read-only.
/etc
The /etc directory is reserved for configuration files that are local to your machine.
The password file, startup scripts for Linux, list of IP addresses and many other types of configuration information stored in this directory.
/lib
The /lib directory should contain only those libraries that are needed to execute the binaries in /bin and /sbin.
/home
The /home directory is the base for user home directories.
/dev
The /dev directory contains filesystem entries which represent devices that are attached to the system. These files are essential for the system to function properly. The dev/mouse file is for reading input for mouse.
Logging on to Linux
To use the Linux operating system, you must first gain access to it by logging in. when you are log in; you are placed in your home directory.
Enter your Login Name and press ENTER.
LOGIN:
Enter your PASSWORD and press ENTER.
Login:
Password:
Once you have entered all the correct information, the “prompt character” appears on the screen. This is a dollar sign($) for Bourne shell users and a percent sign(%) for C-shell users.
man [option] [section] [title] Displays information from the online reference manuals. man locates and prints the named title from the designated reference section. Example
man date (display the usage and syntax of date command)
Creating Directories A directory is a collection of files. It can be thought of as a “folder” that contains many different files. Directories are given names, with which you can identify them. Furthermore, directories are maintained in a tree-like structure; that is, directories may contain other directories. Use mkdir command to create new directories and thereby organize files in a filing cabanet. This is an incredibly simple command. You specify the name of the directory to create.
Example:
$ mkdir lab1
$ ls ---- Command for listing
Deleting Directories Directories are deleted with rmdir command. This command deletes only empty directories. If the directory contains any file or directory, first that file or directory must be deleted.
rmdir
cd (Change Directory)
Use the cd command to open your new created Directory. Example:
$ cd ssuet
/ssuet/ $ ls
/ssuet/ $ Note: If you want to go one step back use cd .. Command you are now at your previous location.
You need a way to determine your current directory location. The pwd command, for print working directory, can do this for you.
Example:
$ pwd
/ssuet /Labs
Lab Task:
Create multiple directories and subdirectories.
Search different options of rmdir command using man command.
 Linux Operating System of 80 |