cs393lab1

cs393lab1 - CS 393 Lab 1 Zhou, HuanXian 0225418 1.0...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 393 Lab 1 Zhou, HuanXian 0225418 1.0 Introduction to Linux In this section you will learn about basic Linux operation, commands, their function and proper usage. 1. What is the first process a typical Linux kernel starts? The first program that Linux kernel starts is the init process. 2. Explore and report your Linux box’s startup procedure in detail. You should read and explain what each startup script does and what executable files they execute. Linux startup procedures: 1. BIOS 2. MBR links to the boot loader, such as GRUB or LILO 3. Boot loader (GRUB or LILO) 4. Kernel executes the first program init process 5. The init process executes startup script /sbin/init /etc/inittab /etc/init.d 6. startup scripts /etc/rc.d/rc5.d The init process looks in the /etc/rc.d/rc5.d directory to determine which processes to start and stop. Ex: S04readahead_early -> . ./init.d/readahead_early S05kudzu -> . ./init.d/kudzu S06cpuspeed -> . ./init.d/cpuspeed S08ip6tables -> . ./init.d/ip6tables S08iptables -> . ./init.d/iptables S09isdn -> . ./init.d/isdn S10network -> . ./init.d/network S12syslog -> . ./init.d/syslog S13irqbalance -> . ./init.d/irqbalance S13portmap -> . ./init.d/portmap S15mdmonitor -> . ./init.d/mdmonitor S15zebra -> . ./init.d/zebra S16bgpd -> . ./init.d/bgpd . . . . . . . . . . . . . . . . . . 3. Find a file in the Linux box assign to you in ISIS that contains the string Hello CS6823 and report the command you used to find this file.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Use grep command to read all the files under directory that contains “Hello CS CS6823” grep –r “Hello CS6823” 4. Write a shell script to execute all executable files in the current directory and capture their output to the file “out.lab1” #!/bin/bash for file in $(ls); do If [ -x $file ] ./$file >>out.lab1 Done 5. Modify you Linux box’s startup such that it appends the current time and date to a file in the root’s directory. date >> filename 6. What command would you use to see the processes that are running currently on your Linux system? Explain how you can kill (stop) a process. To show current processes, use command: ps To kill a process, use command: kill PID 7. How do you setup variables in bash? How would you remove them without loggin out? To create a variable: !#/bin/bash VAR="Some value" To remove the variable: unset VAR 8. What the the command that outputs the last bootup time of the system? last boot or uptime 9. What is meant by real and effective user-IDs Real UID: This is the UID that THIS user/process created. Effective UID: This is the UID that is used to evaluate privileges of user/process. 10. Categorize the following commands (see Section 1.2) in Linux as one of: File and Directory Management grep find slocate ls chmod chown rmdir whereis
Background image of page 2
ln rm cp mv more less cat gunzip patch bzcat bunzip mkdir User Management chgrp passwd useradd and adduser su last Process Management man top ps kill Compiler and Linker gcc gdb make ld patch Communication ssh sftp ftp Editing Vi Misc commands strace lsmod
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 13

cs393lab1 - CS 393 Lab 1 Zhou, HuanXian 0225418 1.0...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online