You are on page 1of 5

Colegio de San Juan de Letran

Bo. Bucal Calamba City, Laguna

School of Engineering

CpE001L: PC Hardware Fundamentals

Using Linux System and Basic Shell Commands

Laboratory Exercise No. 8


SURNAME, First Name Middle Initial Student Number Subject Code / Section Time / Day /Room Date Performed: Day Month Year Date Submitted: Day Month Year Engr. Ricrey E. Marquez, CpE, MSCS (Lab Instructor)

The purpose of this exercise is to become familiar with Linux, the command syntax and some basic commands. The exercise also serves to show some multi-user concepts.


Objectives: At the end of the lab, student should be able to: 1. 2. 3. 4. 5. 6. 7. switch between Linux virtual terminals; log in to a Linux system and change passwords; execute basic Linux command; use keyboard control keys to control command line output use the mouse to copy and paste commands lock a Linux system, and log out of a Linux system

Materials: Quantity 1 Part Number Description PC with Ubuntu Linux OS

Direction: Write the stepby-step command to accomplish each statement in your data result. Part I - Logging in Linux Virtual Terminals In this section you are going to log in to the system using both text and graphical virtual terminals. 1. Verify that you really have seven different virtual terminals. Cycle through them by pressing ALT + Fn, where n is the terminal number you want to access. Use CTRL + ALT + Fn when you are in graphical terminal. 2. In your first virtual terminal (tty1), log in to the system with your own surname which also configured when installing the system. 3. In your second virtual terminal (tty2), log in to the system as root. After having logged in, look at the command prompt. Do you notice any thing different from the command prompt in the other virtual terminals?

4. In your seventh virtual terminal (tty7), log on to the system with your own username and password. 5. Open a terminal window. Take a look at the command prompt. Does it differ from the command prompt on tty1? Why or why not? Part II - Basic Commands In this section we are going to execute some basic Linux command, in order to familiarize yourself in the command syntax of Linux, and the fact that you are currently on a multi user, multi tasking system. All commands in this section are executed on virtual terminal seven, using the terminal window you just open, unless specified otherwise. 8. Change your password. Memorize this password because no one can find out your password if you forget it. 9. Display the systems date. 10. Display the whole calendar for the year 2004. 11. Display the month of January for the year 1999 and 99, Are 1999 and 99 the same? 12. Generate a list of all users present on your system. 13. Display your login name. 14. Display the login information of your user account, and of root. 15. Clear your screen. 16. Print the text out to lunch on your display. Part III - Keyboard and Mouse Tips 17. The bash shell has a command history function. View some of the command you have entered. Try to alter one of these commands, and then run the command again. 18. Your terminal has a buffer that keeps track of the output of your commands. View the output of the previous commands. 19. Bash supports command and file name completion with the TAB character. Try to use this feature, both on commands and on filenames.

20. Both in text terminal and an emulated terminal in the graphical desktop, try to re-execute commands by scrolling up a little, selecting command with the left mouse button, and then pasting it into the same terminal again with the middle mouse button. Also try this across different text and graphical terminals. Note: SuSE does not enable gpm by default so your mouse wont work in a text terminal when youre using SuSE. Part IV - Using the History Command 21. Use the history command to view the last 20 commands you typed. 22. Execute one of the commands from the history list. 23. Execute the echo command again, this time changing the word lunch to dinner. 24. Bash also supports searching in the history. Try this feature as well.

<Specific commands to accomplish each procedure>

<Discussion of all commands including some options used in the lab exercises, minimum of 2 pages>


Questions: 1. Classify each of the following as simple, complex, or compound commands: $ $ $ $ ls date ; uptime ls -l echo "hello world"

2. What is the effect of putting a semicolon at the end of a single simple command or a complex command? For example, will the output of the following commands be different?

$ who am i $ who am i ; 3. What are the two major types of shells? Give an example of a shell that falls into each type. Answers:

<Conclusion what have you learned from this experiment, minimum of 2 pages>

Books: Online: