cpe001l lab exercise # 8 - using linux system and basic shell commands

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 GRADE 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)

Upload: louie

Post on 13-Apr-2015

89 views

Category:

Documents


0 download

DESCRIPTION

CpE001L Lab Exercise # 8 - Using Linux System and Basic Shell Commands

TRANSCRIPT

Page 1: CpE001L Lab Exercise # 8 - Using Linux System and Basic Shell Commands

Colegio de San Juan de LetranBo. Bucal Calamba City, Laguna

School of Engineering

CpE001L: PC Hardware Fundamentals

Using Linux System and Basic Shell Commands

Laboratory Exercise No. 8

GRADE

SURNAME, First Name Middle InitialStudent Number

Subject Code / SectionTime / Day /Room

Date Performed: Day Month YearDate Submitted: Day Month Year

Engr. Ricrey E. Marquez, CpE, MSCS(Lab Instructor)

Page 2: CpE001L Lab Exercise # 8 - Using Linux System and Basic Shell Commands

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 AND MATERIALS

Objectives:

At the end of the lab, student should be able to:

1. switch between Linux virtual terminals;2. log in to a Linux system and change passwords;3. execute basic Linux command;4. use keyboard control keys to control command line output5. use the mouse to copy and paste commands6. lock a Linux system, and7. log out of a Linux system

Materials:

Quantity Part Number Description1 - PC with Ubuntu Linux OS

PROCEDURES

Direction: Write the step–by-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?

Page 3: CpE001L Lab Exercise # 8 - Using Linux System and Basic Shell Commands

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 system’s 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.

Page 4: CpE001L Lab Exercise # 8 - Using Linux System and Basic Shell Commands

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 won’t work in a text terminal when you’re 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.

DATA RESULTS

<Specific commands to accomplish each procedure>

DATA ANALYSIS

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

QUESTIONS AND ANSWERS

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?

Page 5: CpE001L Lab Exercise # 8 - Using Linux System and Basic Shell Commands

$ 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

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

REFERENCES

Books:

Online: