ICT374 Lab 4.docx - ICT374 Lab 4 Shell Customization File Access Permissions Access Remote Hosts Checking Process Status C's Arrays and Pointers Dynamic

ICT374 Lab 4.docx - ICT374 Lab 4 Shell Customization File...

This preview shows page 1 - 3 out of 15 pages.

ICT374 Lab 4: Shell Customization, File Access Permissions, Access Remote Hosts, Checking Process Status, C's Arrays and Pointers, Dynamic Memory Allocations Learning Objectives: 1. Be able to customize your shell using the shell's start-up files. 2. Understand the concept of file ownership and file and directory access permissions 3. Be able to protect your files from unauthorized access using chmod and chown . 4. Be able to use command ifconfig to lookup the IP number assigned to your host.. 5. Be able to use ssh to access remote hosts. 6. Be able to use sftp to transfer files between local host and remote host. 7. Be able to use ps command to find out various information about processes. 8. Be able to use kill command to terminate processes. 9. Learn to use arrays and pointers in C. 10. Understand and be able to pass arrays to functions in C. 11. Learn to use malloc to allocated memory at run-time. Required Reading: Lecture Notes for Topic 3 Rute: Ch 9, Ch 12, and Ch 14 A mini manual for vi editor Access to Software: Internal students will use the lab machines on Murdoch Campus. You will need your Murdoch Username and Murdoch Password to log into your account on
Image of page 1
the lab machines. Once logged in to the Windows account, you will need to use VMware virtual machine to run Ubuntu Linux. You should also bring a USB flash drive with you to the lab for copying your work from the virtual machine. For external students, if you have already installed Linux, then use your own Linux installation. If you have not yet installed your own Linux, you may use our Linux server temporarily until you have installed Linux on your machine (details see Lab 2). More information on how to install Linux is available from Download Page of this website. Unix Exercises The following exercises are designed to get familiar with Unix (Linux) systems. More information about these basic Unix commands is available from the relevant chapters in Rute. See the Required Readings. 1. Shell Customization The bash shell can be invoked as a login shell or non-login, interactive, shell. When you login (by entering your username and password), a login shell is usually invoked. When you start a terminal, a non-login shell is started to run inside the terminal window. A login shell shell initializes itself by looking for files ~/.bash_profile , ~/.bash_login , and ~/.profile , in that order. The first of these files found is read and the commands in that file are executed. Check your home directory to see which one of the above files exists under your home directory. You can customize your shell by adding commands into that file. Assume that of the three files listed above, only .profile exists (If none exists, you can create one). Type in the following commands into the file: echo Today is $(date) echo Welcome to Unix and then test it by starting a new login shell with the following command: bash -login Exit the login shell by typing the command exit .
Image of page 2
Image of page 3

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture