Lab 2

(Chapters 1 and 2)

Learning Objectives

  1. To practice the use of a few commonly used UNIX commands
  2. To learn about the history UNIX and a few other operating systems
  3. To learn about the popularity of UNIX and other contemporary operating systems

Lab Work

  1. Log on to your UNIX system
  2. Use the who command to display the names of users currently using your UNIX system.
  3. How many users are currently using your UNIX system? Show your session.
  1. 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.
  1. 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.
  1. Use the date command to display the current time. Show your session.
  1. Use the cal command to display the calendar for the following years: 4, 52, 1752, 1952, 2004, and 2005.
  2. Write down the commands you used to display the calendar years.
  1. Does the command work fine both leap and non-leap years? How could you tell?
  1. 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.
  1. Use the pwd command to display the name of your home directory. Show your session.
  1. 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.
  2. What is the name of your operating system?
  1. What is the domain name of your computer system?
  1. What CPU is in your computer system?
  1. Search for the RSTS operating system.
  2. Which operating system does the operating system run on?
  1. Who owns the rights of RSTS?
  1. How old is RSTS?
  1. What does RSTS stand for?
  1. When was RSTS operating system written?
  1. Where was RSTS written?
  1. 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?
  1. What is the name of world’s first time-sharing operating system? Hint: Browse the Webpage at
  1. 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

  1. Name of world’s first operating system, its date of birth, and its birthplace.
  1. The following questions are about UNIX. Hint: Webpages at the following URLs will be of great help.
  1. When did the first version of UNIX come out and what was its name?
  1. Who were the authors of UNIX?
  1. Where (organization) was UNIX designed and written?
  1. When (year) was UNIX rewritten in C?
  1. When did BSD UNIX come out?
  1. When did FreeBSD come out?
  1. Who said this and when: "...the number of UNIX installations has grown to 10, with more expected..."
  1. When was TCP/IP implemented in the UNIX kernel and in which UNIX flavor?
  1. When did Solaris 9.0E come out?
  1. Who created the B language and when?
  1. Who created the C language and when?
  1. Log out.

Lab 3

(Chapter 3)

Learning Objectives

  1. To learn about the various components of a contemporary computer system
  2. To learn about the structure of UNIX
  3. To learn about some important system setups

Lab Work

  1. Log on to your UNIX system
  1. 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 Use
touch
cp
mv
rm
mkdir
rmdir
ls
lpr
cd
pwd
open
read
write
close
pipe
socket
mkfifo
system
printf
  1. Display the message that is displayed when you log on. Hint: this message is stored in the /etc/motd file. Show your session.
  1. 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.
  1. 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?