CST8177 W15 Pre-SBA Name: _______________________________________ Student ID: __________________________________ Lab section: __________________________________ The full mark for the SBA is 10. Fresh install CentOS and set up the testing directory sba under your home directory before SBA. Use Putty to log in your CentOS. Keep the result of each task on the window of Putty until you demoed to the lab teacher. You can open another Putty window to do the following task. Task(s) Mark In-lab signoff 0 Record the command (bonus) 1 1 Use basic regular expressions to print out from a text file the following lines: 1 (choose start with optional whitespace then the string first. one) Use extended regular expressions to print out from a text file the following lines: 1 consist of a single non-negative integer less than 24, for a valid hour in 24-hour times. Demo: use the command wc to count your results. 2 Create a script file called myscript. Only one argument will be needed for the 3 (choose script. If the argument is A or a, the script should display the name of current one) login user. If B or b is chosen, the current date information should be displayed. If Q or q is chosen, the script should end. If less or more than one argument is provided by users, good error messages should be produced. Demo: show the content of the script with the command "cat myscript", then run the script and try all possible arguments including not correct number of arguments. Write a script proc-kill to find a process and kill the process with TERM 3 signal. The name of the process will be passed to the script as an argument. If less or more than one argument is provided by users, good error messages should be produced. Demo: show the content of the script with the command "cat proc-kill", then run the command "service ntpd start" before running your script. Run your script with the argument "ntpd". 3 Create a user account as follows. 3 Username: netuser1 home directory: /home/netuser1 Then, create a group with the name project and add the account netuser1 into this group. Demo: read the content of the file /etc/passwd and /etc/group using the following commands. #grep 'netuser1' /etc/passwd #grep 'netuser1' /etc/shadow #grep 'project' /etc/group 4 In your second hard disk sdb, create a new swap partition of size 300 MB. Be 3 (choose sure it is mounted every time you boot up one) In your second hard disk sdb, create a new ext4 partition of size 400 MB. Be 3 sure it is mounted every time you boot up Demo: #fdisk -cul #cat /etc/fstab