Você está na página 1de 4

Software Development

Practices

Lab 1: Introduction to Unix

Dang Tran Luc MAI

Student Id: 6601545


Abstract – This lab report is about process and result for lab1 (Introduction to Unix). It focuses on the
syntax of command and figuring out how to use the commands.

I.INTRODUCTION
Lab 1 is just an overview of Unix OS. In these activities, students will learn how to connect to the server
via PuTTY or Winscp. Furthermore, they will get familiar with commands and their parameters. The most
important thing is how to use man command effectively.

II.BACKGROUND
Software
1.1 PuTTY program is used for creating the connection to server using SSH protocol (port 22). Unix
server for this lab does not accept Telnet protocol due to security issues. Filling the name of server
“rule89.caia.swin.edu.au” with the port of 22, the next step is login with user name and password.
This program interface is mainly command line.
1.2 Using the Winscp, the file can be moved back and forward very easily and similar to Windows
Explorer. In this program, the user name and password need to be filled. Otherwise, they will be
prompted later. This interface is GUI.

Command syntax
2.1 Navigating the command and its options.
 date shows the data and time of system. The output is Tue Aug 24 19:35:14 EST 2010.
 date “+DATE: %Y-%m-%d TIME: %H:%M:%S” formats the presentation of day and time. The
output is DATE: 2010-08-24 TIME 19:38:25

2.2 Explore the commands.


 ls shows the directories and files which are the contents of that current directory.
Using ls –a shows the files starting with “.”
 ls –al shows more information of the files. File mode is about the permission of file (r means read
permission, w means write permission, x means execute), number of links to that file, owner
name, group name, MAC label, number of bytes in the file, abbreviated month, last modified time
point.
 pwd (printing working directory) shows the current directory.
 cd / moves to root
 cd .. moves to the upper directory
 cd thisDirectory moves into thisDirectory.
 Relative path cares about the relationship between the current directory and wanted directory.
Ex : cd .. or cd / or cd myDirectory
 Absolute path does not care about the relationship between them. It is the clear and has sufficient
meaning about the wanted directory.
Ex: cd /home/user/..
2.3 man command for instructing how to use the command correctly and comprehensively.

Unix for Telecommunication (Lab 1) i


Prepared by: Dang Tran Luc MAI
Wednesday, August 25, 2010
 ls –a: show file which starts by „.‟ in its name.
 ls –al: show the file properties in more details.

File manipulation
3.1 Creating a test directory in /home/user/ by these steps:
 cd /home/user: go directly to user directory.
 pwd to check the currently standing directory.
 mkdir test to create the directory with the name test
 ls to check the content of user directory.

Text file editing


4.1 cat /usr/local/www/apachee22/data/index.html prints (or concatenate) the file line by line.
4.2 less /usr/local/www/apachee22/data/index.html navigates the text file by moving up and down.
Quit this by pressing „q‟.
4.3 ee test.txt to create a text file with the name “test.txt”. Typing into this file and ending by pressing
Ctrl+[. The content will be saved to that text file. We need to check the current directory beforehand by
issuing the command pwd. Afterward, cat command can be used for checking the content. The
instructions are on the top the screen.

Moving and deleting files


5.1 rm (remove) fileName to delete a file. I use ls to check if it is successful.
5.2 rm –d directoryName to delete a directory. rm –d –f to force the directory to be deleted.
5.3 mv fileName1 fileName2 to change the fileName1 to the name fileName2.

Output redirection
6.1 sysctl –a show the kernel state.
6.2 sysctl –a | grep “net” shows the variables starting by “net”.
6.3 cat filename1 >> filename2 to append the content of filename1 to filename2. For example: file1 has
“UNIX” and file2 has “TELECOMMUNICATION”. The result of file2 in the aftermath of this command is
“TELECOMUNICATION UNIX”.
6.4 cat filename1 >> filename2 to replace the content of filename2 by that of filename1. For example:
file1 has “UNIX” and file2 has “TELECOMMUNICATION”. The result of file2 is “UNIX”.

Becoming the super user


7.1 su to change to super user. In my case, I change from user to rule89 with the higher privilege.
7.2 Edit the “motd”. Firstly, I move to /etc and use ee to modify the banner. I put my name in the bottom of
the file.

8. After login back, I realized that the banner of the day has been changed.

Unix for Telecommunication (Lab 1) ii


Prepared by: Dang Tran Luc MAI
Wednesday, August 25, 2010
Setting the time zone
9. As a super user, run sysinstall to change the time zone. A menu appears with many choices. I did
choose these characters to change the time zone to AEST. Configure/Timezone/ 7 for Australia/ 4 for
Victoria.

Logging out
10. Type exit to logout.

III.CONCLUSION
This lab provides very comprehensive practices for people who are new to Unix. By exploring the
commands, students can have more understanding of the system. The next lecture will continue
explaining more about the kernel insightfully.

References:

1. http://www.linux.com/archive/articles/146599

Unix for Telecommunication (Lab 1) iii


Prepared by: Dang Tran Luc MAI
Wednesday, August 25, 2010

Você também pode gostar