Sie sind auf Seite 1von 4

Laboratory Report: CS2503 Practical 1

Teodor Petrican Computer Science, University College Cork, Ireland Email: teodor.petrican@gmail.com
Abstract This report describes the rst practical session of the module CS2503 (Operating Systems 1). During this practical session, the basics of using command-line interaction with the operating systems were set. Several basic Unix commands were studied and methods for combining them were explored. These commands were applied in a series of exercises, for example the interaction with the le system (creating, deleting, modifying directories and les). Also, the eectiveness of using the command line was underlined.

Introduction
Unix is the name of a family of operating systems dating from the early 1970s. The original Unix was developed at AT&Ts Bell Labs research center by Ken Thompson, Dennis Ritchie. A teaching version, known as Minix, was written by Andrew Tanenbaum and was re-written by Linus Torvalds to become Linux. Linux is now supported by the Free Software Foundation. Linux is a Unix-like Operating System. This report presents the work done at the user command line level in Linux. Unix commands were used to modify text les, traverse the directory structure and control user interaction with the system. Further power was added by connecting commands together in various ways and by using regular expressions. The practical session was carried out on a Dell Optiplex 960 personal computer (PC) based on an Intel Core 2 Duo dual-core processor running at 1

3.33 GHz with a main memory of 3.8 GB. The networked le system provided a total user storage space of approximately 1.6 TB. The operating system was KUbuntu version 12.04, an extension of GNU Linux that provided command-line access to the underlying Linux system through a terminal application.

Procedure
Basic Unix commands were explored, all of which are listed in Appendix A. As requested and explained, the manual was used to obtain descriptions of several commands. Techniques for nding information about users and changing user password were learnt. File system operation was investigated by using commands to navigate through levels of directories and display their content, to create and delete les and directories. Two levels of directory were constructed and blank les were created at the leaf level using the touch command. The whole tree was parsed using the learnt commands to get an idea about the level structure. The power of Unix commands is amplied by the ability to combine more commands in order to accomplish larger tasks. For this purpose, the technique of using pipes and redirection was learnt. Pipes were used, for example, to combine wc and ls to count how many children were in a parent directory. Further power was then added by using wildcards and regular expressions. Some of the many ways of creating a le in Unix were studied. These include the commands touch, cat, pico. A very important aspect is for a user to be able to determine who can access the les and what rights does he have on them (read, write, execute). The commands ls, umask and chmod were combined in order to do this and to modify the rights of certain groups of users on a le. Means of navigating through the history of commands in the terminal were also briey explained.

Results and Discussion


For this practical, one task was assigned: to provide an explanation of what appears to be unusual in the calendar of the year 1752. Using the cal command, it was discovered that September was missing days from September 3rd to September 13th, inclusive. A consultation of Wikipedia revealed that this was due to the adoption of the Gregorian calendar. The 11 skipped days were necessary to deal with the accumulated time dierence over the years between this calendar (365.2425 days) and the previous one (365.25). This practical session was important in highlighting diculties encountered using the command line interface. Most of the errors made were of syntactic nature, but there may also appear errors due to attempts to use commands in inappropriate ways. This problem can be, however, easily overcame by checking the manual of any command. This practical session made clear the fact that properly using a commandline interaction with an operating system can enhance a users ability to accomplish complex tasks.

Conclusions
Command line access in Unix-type systems provides users with an extensive set of very powerful data management tools. Although using the command line might seem a little harder that directly using a GUI (graphical user interface), the process of doing this is very rewarding. The text commands have a wider range of options and the possibility to combine them in order to automate large tasks. Therefore, when having to accomplish larger tasks, the command line may prove to be the right option.

Appendix A
The 34 Unix commands explained and used during this practical are listed in Table 1 below. apropos cal cat cd chmod cmp csh date man echo mkdir nd more grep mv head passwd history pico id ps less pwd ls rm rmdir sh su tac tail touch umask wc who

Table 1: Commands used in this practical session

Das könnte Ihnen auch gefallen