Lab 2
(Chapters 1 and 2)
Learning Objectives
- To practice the use of a few commonly used UNIX commands
- To learn about the history UNIX and a few other operating systems
- To learn about the popularity of UNIX and other contemporary operating systems
Lab Work
- Log on to your UNIX system
- Use the who command to display the names of users currently using your UNIX system.
- How many users are currently using your UNIX system? Show your session.
- Who has been logged on for the longest period of time and for how long? Write down the time and date since when this user has been logged on.
- Are any users logging on by using telnet? How could you tell? Write down the names of the computers from which these users are logged on.
- Use the date command to display the current time. Show your session.
- Use the cal command to display the calendar for the following years: 4, 52, 1752, 1952, 2004, and 2005.
- Write down the commands you used to display the calendar years.
- Does the command work fine both leap and non-leap years? How could you tell?
- How many days does the year 1752 have? Are you surprised? If so, what surprised you? Search for “Gregorian calendar”. How many hits did Google show for your search? Read one of the top sites and write down the reason for your surprise. Why is our calendar called the Gregorian calendar? Write down the URL of the Webpage that you read for your answer.
- Use the pwd command to display the name of your home directory. Show your session.
- Use the following commands to display information about your computer system: uname (to display the name of the operating system), uname –n (to display the domain name of your system), and uname –p (to display the name of the CPU in your system). Show your sessions in your answers.
- What is the name of your operating system?
- What is the domain name of your computer system?
- What CPU is in your computer system?
- Search for the RSTS operating system.
- Which operating system does the operating system run on?
- Who owns the rights of RSTS?
- How old is RSTS?
- What does RSTS stand for?
- When was RSTS operating system written?
- Where was RSTS written?
- Use and search for the following operating systems: UNIX, LINUX, FreeBSD, NetBSD, Solaris, Windows XP, Windows 2000, Windows NT, Windows 98, Windows 95, Windows 3.1, and MacOS. Write down the names of the three most popular operating systems on the Web. Write down the number of hits found for each by What is the combined total for all Windows operating systems?
- What is the name of world’s first time-sharing operating system? Hint: Browse the Webpage at
- The following are the names of some operating systems? What do these (acronyms) stand for? Write down the name of world’s first operating system. When and where was it written?
BOS
BOSS
DOS
JOSS
MOS
POS
TSOS
- Name of world’s first operating system, its date of birth, and its birthplace.
- The following questions are about UNIX. Hint: Webpages at the following URLs will be of great help.
- When did the first version of UNIX come out and what was its name?
- Who were the authors of UNIX?
- Where (organization) was UNIX designed and written?
- When (year) was UNIX rewritten in C?
- When did BSD UNIX come out?
- When did FreeBSD come out?
- Who said this and when: "...the number of UNIX installations has grown to 10, with more expected..."
- When was TCP/IP implemented in the UNIX kernel and in which UNIX flavor?
- When did Solaris 9.0E come out?
- Who created the B language and when?
- Who created the C language and when?
- Log out.
Lab 3
(Chapter 3)
Learning Objectives
- To learn about the various components of a contemporary computer system
- To learn about the structure of UNIX
- To learn about some important system setups
Lab Work
- Log on to your UNIX system
- UNIX manual is divided into eight sections. Section 1 is for shell commands, section 2 is for system calls, and section 3 is for library calls (3C for C language library calls). Use the man command to get information about the following commands, system calls, and library calls: touch, cp, mv, rm, mkdir, rmdir, ls, lpr, cd, pwd, open, read, write, close, pipe, socket, mkfifo (command and C language library call), system, and printf. Complete the following table by adding a short description for each, including one or two typically used options for each command.
Command /
Short Description
/ Example Usetouch
cp
mv
rm
mkdir
rmdir
ls
lpr
cd
pwd
open
read
write
close
pipe
socket
mkfifo
system
printf
- Display the message that is displayed when you log on. Hint: this message is stored in the /etc/motd file. Show your session.
- Read through the following files, if they exist on your system: /etc/profile, ~/.profile, ~/.bashrc, ~/.bash_profile, ~/.login, and ~/.cshrc. What are the values of the following shell environment variables: PATH, path, LINES, HOME, and home. If you don’t find any of these variables in the above files, use the echo $variable command to display the value of a variable, where variable may be PATH, path, LINES, HOME, pr home. Show your session.
- Use the man ls command to display the manual page for the ls command. How many lines are displayed at a time, before you are prompted to hit <Spacebar> for displaying the next page? Now execute the following commands (in this order) and rerun the man ls command:
LINES=15
Export LINES
How many lines per page are displayed now?