Download presentation
Presentation is loading. Please wait.
Published byBryce Hodges Modified over 9 years ago
1
CS 6560 Operating System Design Lecture 3:Tour of GNU/Linux
2
More on Kernel Compiling Configuration: –make defconfig –make menuconf –Looking at.conf Making the initrd –Documentation on initrd and mkinitrd –Dealing with incompatibilities
3
Some references An introduction to Linux: –http://tldp.org/LDP/intro-linux/html/http://tldp.org/LDP/intro-linux/html/ An introduction to the Bash shell –http://tldp.org/LDP/Bash-Beginners- Guide/html/index.htmlhttp://tldp.org/LDP/Bash-Beginners- Guide/html/index.html
4
Tour of Linux Accounts Logging in and out Getting help Shells: bash Common commands Editors Compiler: gcc Make Services
5
Getting Help man info Documents directory of the source google
6
Shells Why have shells? –Giving commands (requests) to the system What is a shell? –Command interpreter –Basic commands: internal and external Internal: –Control structures (if, while, for, break, continue, exit) –Job control (fg, jobs) –Current status (cd, pwd, ) –I/O (read, echo, printf) External – loaded into new process What shells are available? –sh, csh, tcsh, zsh, bash, rc, etc.
7
Bash Shell Syntax See “info bash” Everything is broken into words first Shell variables –variables are stored as strings –variables can be assigned values –use of $ to get value –export: shell -> environmental variable Parameters –$1, $2, $* –set, unset, shift Quoting and expanding –Several types of expansions: Brace Expansion: Expansion of expressions within braces. Tilde Expansion: Expansion of the ~ character. Shell Parameter Expansion: Expansion of variables to their values. Command Substitution: Using the output of a command as an argument. Arithmetic Expansion: Using arithmetic in shell expansions. Filename Expansion: wild cards and square brackets –single and double quotes, escaping with backslash Pipes, filters, redirection to form pipelines –| > > Control structures: while, for, until
8
The Shell as a programming environment Creating a script #! notation Executing the script –sourcing with. or source –invoking by name (must set the permissions)
9
External Commands File and directory manipulation –cp, rm, chmod, mkdir, rmdir, ls Filters –grep, sort, cat, head, tail, cut, paste, od, tr, pr, wc Program development –Gcc, make Text processing System administration
10
Some Common External Commands: file and directory manipulation lsList directory entries cdChange directory pwdPrint path of current directory chmodChange permissions mkdirCreate a new directory rmdirRemove a directory mvMove a directory entry rmRemove a directory entry
11
Some Common External Commands: text manipulation (filters) catConcatenate multiple files to standard output morePaged output to standard output lessFancier version of more headShow the first few lines of a file tailShow the last few lines of a file grepSearch files for a pattern cutCut columns of text from a file odOctal dump a file (also: hex,char,binary) sortSort a file trTranslate a file character by character prFormat a file for printing wcCount words, lines, characters
12
Unix Permissions Each file and directory has an owner and a group membership Permissions are organized by user (owner), group, and others –u = user, g = group, o = others Permissions consists of read, write, and execute for each type of user –r = read, w = write, x = execute Permissions can be viewed with the ls command and changed with the chmod command. Permissions meanings are different for regular files than for directories (see man page for ls and chmod). Examples in class
13
Editors vi (now vim) emacs pico
14
Getting Organized Use permissions for privacy Organize your work in directories
15
Program Development Shells Perl C: gcc Use of make (see info make)
16
The proc file system Shows a view of the kernel in terms of files For details see – man proc –/usr/src/linux/Documentation/filesystems/proc.txt Assignment #2 - using proc to get information about a machine
17
Services Many processes run in the background taking care of things such as printing and logging people in. Vmware-tools is an example service. Centos has a GUI interface to its service through the system configuration menu. Services can be controlled directly from command lines and scripts located in /etc/init.d and referenced from /etc/rc.d according to runtime level. - see the scripts for vmware-tools
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.