Experiment1: Linux installation
Ubuntu can be installed with the graphical CD. Make sure that your computer is set to boot from a CD before a hard drive. 1. Insert the Ubuntu disc into your CD drive. 2. Start or restart your computer. The Language screen appears
3. Select your desired language and click Install Ubuntu 10.04 LTS. The Where are you? Window appears.
4. Select the location closest to your location and click forward. The Keyboard layout window appears.
5. If the Suggested option is not correct, select the correct keyboard layout. Click Forward. The Prepare disk space window appears.
6. If you want to install Ubuntu over your entire hard drive, then Select Erase and use the entire disk and select the hard drive that you want to install Ubuntu.
WARNING: Installing Ubuntu on your entire hard disk will erase all data that is currently on the drive. OR 6. If you want to install Ubuntu on a single partition Dual Booting, Select Guided resize. In the New partition size area, drag the area between the two partitions to create your desired partition sizes. Click Forward.
7. The Who are you? window appears.
8. Enter the requested information, and click Forward. The Ready to install window appears.
9. Verify that the language, layout, location, and personal information are correct and click Install. The installation wizard begins.
10. When the installation wizard finishes, the Installation complete window appears.
Click Restart now to restart your computer. Ubuntu is now installed.
Experiment2: Linux shell and Basic shell commands
Objective:To introduce the student to Linux most popular command line shell, the BASH. This lab will cover basic commands used in Unix/Linux.
Scope:On the completion of this lab, you will be able to: Describe the bash and its features. Understand the bash environment. Use some frequently-used command in UNIX/ Linux environment.
Useful Concepts:Shell A piece of software that provides an interface for users. Typically, an operating system shell which provides access to the services of a kernel. Generally fall into one of two categories: i. Command-line ii. Graphical Bash (Bourne-again shell) is the default shell on most systems built on top of the Linux kernel as well as on Mac OS X and it can be run on most Unix-like operating systems.
Terminal An instant of a shell that provide an editor for the user to enter commands and run processes Shell Prompt Location in the terminal where you can enter commands. Represented by $ or > Root directory / is the primary directory where all other directories reside. Mount point The location in the operating system's directory structure where a mounted file system appears Package Computer software packaged in an archive format to be installed by a package management system or a self-sufficient installer Boot loader
The small program that starts loading OS into RAM, also known as a bootstrap loader, or bootstrap or boot loader
Exercise:- This exercise illustrates how to view content of a directory and move around the file systemTo get a listing of the directory contents, type: ls For a long view of the listing with time stamps, file permissions and file ownerships type: ls -l To move to directory-name directory type: cd directory-name To go to the /etc directory you simply type cd /etc To go one step back type: cd .. To go to user's home directory, type: cd ~ To display the path to the directory you r currently working in, type: pwd At any point using the TAB key after typing a few characters in at the bash prompt will make bash fill in the rest of the file or directory name that matches what you have typed. If there is more than one match, tap the tab key twice and it will list all the matches.
Experiment3: Command Line File Manipulation
Objective:To familiarize the students with basic file and directory management using shell.
Scope:Student will be able to perform the following tasks at the end of this lab: The Working Directory Listing Directory Contents Viewing Files Copying Files Moving and Renaming Files Searching for Files by File Name & by Content Creating & Creating Subdirectories Creating Symbolic Links
Useful Concepts:Working Directory A special directory remembered by the shell, and is interpreted to be the directory you are currently in. Important for situation where relative paths are in use. Symbolic link A symbolic (or soft) link is an indirect reference to a file, similar to an alias in Mac OS or a shortcut in Windows. Meta characters Characters having special meaning to the terminal Wildcards are Meta characters that can represent different characters in a string. Following are some Special Characters with a brief description: Character \ / . .. ~ Function Escape character. If you want to reference a special character, you must escape it with a backslash first. Directory separator, used to separate a string of directory names. Current directory. Can also hide files when it is the first character in a filename. Parent directory User's home directory Examples touch /tmp/filename\* /usr/src/linux .htaccess cd.. cd~
Represents 0 or more characters in a filename, or by itself, all files in a directory. Represents a single character in a filename. hello?.txt can represent hello1.txt, helloz.txt, but not hello22.txt Can be used to represent a range of values, e.g. [0-9], hello[0-2].txt represents the [AZ], Etc. names hello0.txt, hello1.txt, and hello2.txt Command separator. Allows you to execute multiple cd /var/log ; less messages Commands on a single line.
Exercise:- This exercise illustrates how to View contents of a file.To view file contents on shell console, type: cat filename To merge contents of two or more files and display it on screen, type cat file1 file2 file3 ... To display display a screenful text of file on the terminal, type: more filename To display file contents screenful at a time with page-up and page-down options, type: less filename To view first k lines of the file, type: head -n k filename e.g, to display first 5 lines of the file myfile on the terminal, type; head -n 5 myfile To display last 5 lines of the file myfile on the terminal, type; tail -n 5 myfile
Experiment4: Command Line File processingObjective:To familiarize students with the directory level and file level security, compressing and archiving techniques.
Scope: On the completion of this lab, students will be able to: Understand file types used in LINUX system. View and modify file access permission. Change the ownership of files and directories Create backup for critical files using archives
Useful Concepts:Access Permissions The ability of a user to access a file or directory. Three general types of permissions are read permission, write permission and execute permission. File owner The user of the system to whom the file belongs. Archive A collection of contents (files or directories) for backup purpose. Compression A technique used for reducing the size of a file or a directory without effecting contents.
Exercise:- This exercise shows which types of files are used in linux and how to know about file typesLinux considers each device as file. There are many types of file that are used in Linux. Use ls l command to find the type of file. For example:javidali@JLaptop:/dev$ ls -l crw-rw----+ 1 root audio 14, 4 2009-04-28 07:01 audio drwxr-xr-x 3 root root 60 2009-04-28 12:01 bus crw------- 1 root dialout 5, 1 2009-04-28 07:01 console lrwxrwxrwx 1 root root 11 2009-04-28 07:01 core -> /proc/kcore srw-rw-rw- 1 root root 0 2009-04-28 07:01 log
brw-rw---- 1 root disk 8, 1 2009-04-28 12:01 sda1 javidali@JLaptop:/dev$
In this example, first character in each row, I.e. the first colom represent the file type. The following table shows file types, representation symbols with short description.
Symbol d b
File type Regular files Directories Block files
Description text file, Postscript, graphics files, Hypertext (HTML), video file etc Files that act as containers to other files Files that are used for block (parallel) devices. Data from such devices are read or written to in blocks. Files that are used for character (serial) devices. Data from such devices are read or written to character by character Shortcut to other files or directories Files that are used in communication
Symbolic links socket files
Regular files other than text files can be explored by using an appropriate program, as indicated in the table below. Follow the command with the name of the file to view it or omit the file name and select the file from the menu once the program is running.File Type Application Name Command for the application gv acroread xv gimp xdvi Netscape gtv
Postscript gv (based on GhostView) Portable Document Format (PDF) Adobe Acrobat Reader Image files XV Image files The Gimp LaTeX ouput (DVI) xdvi Hypertext (HTML) Netscape MP3 and MPEG gtv
Experiment5: Command line Text Editors (Vim)
Objective:To enable students to use command line editors for editing text files. Completing this lab, students will give sufficient knowledge about vim / vi and its features for their daily tasks.
Scope:On the completion of this lab, you will be able to: Start the editor, moving cursor around and exiting the editor. Work in command mode. Copy, Cut and past the text format program and check source code Search Character/string. Recover Your Work.
Useful Concepts:vi A screen-based editor used by many UNIX users. Has a powerful feature to aid programmers.
Editing modes There are two editing modes that the editor can be executed in. Inse