| Current Path : /var/www/html/bibhas.ghoshal/lab_files/ |
| Current File : /var/www/html/bibhas.ghoshal/lab_files/lab1.tex |
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{color}
%opening
\title{Lab 1 : Working with Linux}
%\author{}
\begin{document}
\maketitle
\underline{\textbf{Objective : }}
\begin{itemize}
\item Lab 1 is intended to provide an introduction to Linux. The lab consists of performing basic system operations such as file management, text editing, permission management. The objective of this lab is to make students familiar with the Linux command-line environment and develop the skills of shell scripting. This lab serves as a platform for the subsequent labs related to system calls, process management, file management and memory management.
\end{itemize}
\underline{\textbf{Recommended Systems/Software Requirements}}:\\
\begin{itemize}
\item Any flavour of Linux
\end{itemize}
\underline{\textbf{References:}}
\begin{enumerate}
\item \emph{Unix concepts and applications}, Fourth Edition, Sumitabha Das, TMH.
\item \emph{Unix and shell Programming}, B.A. Forouzan \& R.F. Giberg, Thomson.
\item \emph{Beginning shell scripting}, E. Foster, Johnson \& other, Wile Y- India
\end{enumerate}
\underline{\textbf{Experiment 1 : Basic Unix commands}}\\
\begin{enumerate}
\item Study of Unix/Linux general purpose utility command list : \emph{man, who,cat, cd, cp, ps, ls, mv,rm,
mkdir, rmdir, echo, more, date, time, kill, history, chmod, chown, finger, pwd, cal, logout, shutdown} commands
\item Login to the system and do the following:
\begin{enumerate}
\item Use the appropriate command to determine your login shell
\item Use the \emph{/etc/passwd} file to verify the result of previous step
\item Use the \emph{who} command and redirect the result to a file called \textbf{myfile1}. Use the \emph{more} command to see the contents of \textbf{myfile1}.
\item Use the \emph{date} and \emph{who} commands in sequence (in one line) such that the output of date will display on the screen and the output of who will be redirected to a file called \textbf{myfile2}. Use the \emph{more} command to check the contents of \textbf{myfile2}
\item Write a \emph{sed} command that deletes the first character in each line in a file.
\item Write a \emph{sed} command that deletes the character before the last character in each line in a file.
\item Write a \emph{sed} command that swaps the first and second words in each line in a file.
\end{enumerate}
\item \begin{enumerate}
\item pipe your \textbf{/etc/passwd} file to \emph{awk}, and print out the \textbf{home} directory of each user.
\item Develop an interactive \emph{grep} script that asks for a word and a file name and then tells how many lines contain that word.
\end{enumerate}
\end{enumerate}
\underline{\textbf{Experiment 2 : Shell Scripting}}\\
\begin{enumerate}
\item Write a shell script program to display list of user currently logged in.
\item Write a (i) shell script program an (ii) \emph{C} program to display “HELLO WORLD”
\begin{itemize}
\item Compare the running time of both the programs using \emph{time} command
\end{itemize}
\item \begin{enumerate}
\item Write a shell script that takes a command –line argument and reports on whether it is directory, a file, or something
else.
\item Write a shell script that accepts one or more file name as arguments and converts all of them to uppercase, provided they exist in the current directory.
\item Write a shell script that determines the period for which a specified user is working on the system.
\end{enumerate}
\item \begin{enumerate}
\item Write a shell script that accepts a file name, starting and ending line numbers as arguments and displays all the lines between the given line numbers.
\item Write a shell script that deletes all lines containing a specified word in one or more files supplied as arguments to
it.
\end{enumerate}
\item Write a shell Script program to check whether the given number is even or odd
\item Write a shell script Program to search whether element is present is in the list or not
\item Write a shell script which receives two file names as arguments. It should check whether the two file contents are same or not. If they are same then second file should be deleted.
\item Develop an interactive script that ask for a word and a file name and then tells how many times that word occurred in the file
\item Write a shell script to perform the following string operations:
\begin{enumerate}
\item To extract a sub-string from a given string
\item To find the length of a given string
\end{enumerate}
\item Write a shell script program to display the process attributes
\item Write a shell script to change the ownership of processes
\end{enumerate}
\end{document}