Search Results for "CSCI 0050"

CSCIĀ 0050. Introduction to Unix/Linux

Units: 3
Prerequisite: Completion of CSCI 0010 with grade of "C" or better
Hours: 72 (54 lecture, 18 laboratory)
An introduction to the Unix and Linux operating systems with an emphasis on system programming. Topics include the filesystem, permissions, regular expressions, processes, networking, basic system administration, and shell scripting. Extensive hands-on experience using the command line interface. (CSU, UC)

CSCI 0050 - Introduction to Unix/Linux

https://catalog.sierracollege.edu/course-outlines/csci-0050/
Catalog Description Prerequisite: Completion of CSCI 0010 with grade of "C" or better Hours: 72 (54 lecture, 18 laboratory) Description: An introduction to the Unix and Linux operating systems with an emphasis on system programming. Topics include the filesystem, permissions, regular expressions, processes, networking, basic system administration, and shell scripting. Extensive hands-on experience using the command line interface. (CSU, UC) Course Student Learning Outcomes CSLO #1: Explain the basic Linux shell commands and utilize piping and redirection to construct more complex commands. CSLO #2: Utilize regular expressions to search for, extract, and transform data from input. CSLO #3: Construct shell programs utilizing control structures. CSLO #4: Read man pages and use the man command to find Unix/Linux commands to perform a specific operation. CSLO #5: Explain basic networking commands of ssh, sftp and how to use email. Effective Term Fall 2026 Course Type Credit - Degree-applicable Contact Hours 72 Outside of Class Hours 90 Total Student Learning Hours 162 Course Objectives Lecture Objectives: 1. Identify and describe prominent figures in Unix/Linux history: Ken Thompson, Dennis Ritchie, and Linus Torvalds. 2. From a written description, analyze and calculate correct permissions to set on files and directories using both numeric and symbolic representations. 3. Specify file locations using absolute and relative paths. Laboratory Objectives: 1. Create, edit, and remove files and directories using core commands: cp, mv, mkdir, rmdir, rm, ls. 2. Construct pipelines of commands to filter data. 3. Construct correct regular expressions to match patterns in data files. 4. Create and kill processes using job control commands and signals. 5. Copy files to and from remote machines. 6. Diagnose network problems using ping, nslookup, and netstat. 7. From written descriptions, write correct shell scripts utilizing sequencing of commands, conditionals, and iteration. 8. Compile and install third-party software packages. 9. Compile and execute user-supplied programs in Java, C, or C++. General Education Information Approved College Associate Degree GE Applicability CSU GE Applicability (Recommended-requires CSU approval) Cal-GETC Applicability (Recommended - Requires External Approval) IGETC Applicability (Recommended-requires CSU/UC approval) Articulation Information CSU Transferable Methods of Evaluation Objective Examinations Example: Example objective question: 1. Which of the following are relative paths? a. /home/unix/bbrown b. ../lab1/readme.txt c. public_html/sierra.jpg d. ../jsmith/../overview e. /bin/grep Answer: b, c, and d 2. The output of the "ls -l lab2.txt" file shows this: -rwxr-xr-- 1 jsmith engineering 253 2012-3-12 lab2.txt What can the jsmith user do with this file? a. Alter its contents b. Delete it c. Make it the current working directory d. Can't tell from the information given Answer: a (Not b, because only the containing directory will dictate whether it can be deleted; not c because it's not a directory.) Problem Solving Examinations Example: Write a bash shell script to create a thumbnail of each image listed on the command line. Place each thumbnail in a directory called thumbs. Each thumbnail should be 50 pixels high and the filename should be the same as the original. The original remains unaffected. Solution: while [ $# -gt 0 ] do jpegtopnm $1 | pnmscale -height 50 | pnmtojpeg > thumbs/$1 shift done Projects Example: Find at least three sources that describe the philosophies behind open source software, free software, and proprietary software. Write a two-page essay that analyzes situations in which each would be most appropriate for a) medical diagnostic software, b) voting software, and c) web site software. Repeatable No Methods of Instruction Laboratory Lecture/Discussion Distance Learning Lab: The instructor reviews the commands that manipulate permissions: chmod, chown, chgrp, and umask. Using a computer and projector on a live Unix/Linux system, the instructor demonstrates several examples of altering permissions and their effects. The instructor puts students into groups of 3 or 4 and assigns them Unix group names. Students work in groups to share files among their group members, following written problem descriptions. The instructor monitors progress by checking answers and visually verifying the results. (Laboratory Objective 7) On a prior day, the instructor requests that students bring in a Java, C, or C++ program they have been working on in another class, or a program they have written in the past. The instructor may also provide a program for students who don't have one of their own. On the day of the assignment, the instructor describes how to compile programs using the javac or gcc compilers and how to run them on the command line. The instructor also shows how to build a Makefile or build.xml file to automate the process using make or ant. In the lab, students apply the instructions to their own project (or instructor-supplied one). The instructor determines if the program has been successfully built by having the student show the intermediate object or class files and running the final executable. (Laboratory Objective 9) Lecture: Assume the students have read the appropriate section in the textbook about permissions or they have watched supplemental videos (if available). The instructor reviews file permissions by explaining the numeric (e.g., 764) and symbolic (drwxrw-r--) representation. The students work problems of converting one representation into the other, since they are equivalent. Distance Learning The instructor will present a video lecture describing how to compile programs using the javac or gcc compilers and how to run them on the command line. The instructor also shows how to build a Makefile or build.xml file to automate the process using make or ant. Students apply the instructions to their own project (or instructor-supplied one). The instructor determines if the program has been successfully built by having the student upload the intermediate object or class files and running the final executable. Typical Out of Class Assignments Reading Assignments 1. Read the chapter on the AWK programming language. Pay attention to examples of extracting columnar data from text files based on numeric criteria, such as "display all ages over 18." Practice it extracting columnar data by creating a criteria of your own. Be prepared to discuss in class. 2. Read web sites about the history of Unix. Take note of prominent figures over the past thirty years: Ken Thompson, Dennis Ritchie, Richard Stallman, and Linus Torvalds. Be prepared to discuss in class. Writing, Problem Solving or Performance Example 1: Use awk, grep, sort, and uniq to analyze a web server log file and show how many "hits" the server received each hour of the day, over the span of a month. Solution: awk -F: '{print $2}' /var/log/httpd/access_log | sort -n | uniq -c Example 2: Calculate the correct umask so that future directories will have permission drwxr-x--x and files will be -rw-r-----. Solution: umask 026 Example 3: Write a three-page report describing the similarities and differences between open source software, free software, and proprietary software. Which would be most appropriate in these situations: a) medical diagnostic software, b) computerized voting software, c) web service software? Other (Term projects, research papers, portfolios, etc.) Hands-on experience using the command line in a shared, server environment. Required Materials Practical Guide to Linux Commands, Editors, and Shell Programming Author: Sobell, Mark Publisher: Prentice Hall Publication Date: 2014 Text Edition: 4th Classic Textbook?: Yes OER Link: OER: Your Unix/Linux: The Ultimate Guide Author: Das, Sumitabha Publisher: McGraw-Hill Publication Date: 2012 Text Edition: 3rd Classic Textbook?: Yes OER Link: OER: Modern Operating Systems Author: Andrew S. Tanenbaum (Author), Herbert Bos Publisher: Pearson Publication Date: 2022 Text Edition: 5th Classic Textbook?: No OER Link: OER: Other materials and-or supplies required of students that contribute to the cost of the course.

CSCI 0046 - System Programming with C

https://catalog.sierracollege.edu/course-outlines/csci-0046/
Catalog Description Prerequisite: Completion of CSCI 0012 with grade of "C" or better Advisory: Completion of CSCI 0050 with grade of "C" or better Hours: 72 (54 lecture, 18 laboratory) Description: Introduction to the C language and system programming on a Unix-like operating system. Topics include the standard C library, memory allocation, file I/O, permissions, system calls, networking, and process management. Development in a Unix environment will cover editors, shell scripting, makefiles, source code control, and debugging. (CSU, UC) Course Student Learning Outcomes CSLO #1: Use the standard C libraries for input/output, memory management, and networking. CSLO #2: Construct multi-file programs using appropriate software engineering tools. CSLO #3: Construct programs utilizing arrays, structures, loops, and/or subroutines. CSLO #4: Debug and add features to existing programs. Effective Term Fall 2026 Course Type Credit - Degree-applicable Contact Hours 72 Outside of Class Hours 90 Total Student Learning Hours 162 Course Objectives Lecture Objectives: 1. Identify the phases of compiling a C program. 2. Interpret a written program specification and decompose it into psuedocode. 3. Analyze the dependency graph for building a multi-file project. Construct a Makefile to automate the build process. 4. Describe the primitive C data types. 5. Interpret documentation of library functions and use the functions in working programs. Laboratory Objectives: Interpret written program specifications and write C programs conforming to the ANSI standard incorporating the following language and library features: 1. Standard I/O using printf, scanf, fputs, and fgets; 2. String manipulation using strcmp, arrays, and pointer arithmetic; 3. Structs and unions; 4. Multiple source and header files; 5. Stream-based and record-based file I/O; 6. Dynamic memory management; 7. Process management system calls including fork, exec, and wait, and their variants; 8. Command-line arguments; 9. Control structures: if/else, while, do/while, for; 10. Functions that accept and return primitive types, arrays, and structs; 11. Standard mathematical functions from the libm library; 12. Client socket programming; 13. Recursive functions. 14. Writing makefiles to automate the compilation process; 15. Coordinating development among two or more persons using a version control system; 16. Compiling and linking programs requiring multiple source files. General Education Information Approved College Associate Degree GE Applicability CSU GE Applicability (Recommended-requires CSU approval) Cal-GETC Applicability (Recommended - Requires External Approval) IGETC Applicability (Recommended-requires CSU/UC approval) Articulation Information CSU Transferable UC Transferable Methods of Evaluation Classroom Discussions Example: Why is fgets preferred over gets? Answer: The gets function doesn't do bounds-checking on the string array. It is possible to overrun the array by simply inputting more characters than the array allows for. The fgets functions, by contrast, is passed the length of the array and will not accept more characters than the given limit. Buffer overruns and a myriad of security vulnerabilities can be prevented by using fgets instead of gets. Objective Examinations Example: Sample test question: The following statements are executed: int x, y; x = 5; y = 8; y = ++x * y; What are the values of x and y? Answer: x = 6, y = 40 Problem Solving Examinations Example: Sample assignment: Write a recursive function to implement the quicksort algorithm. Write a driver program to accept a list of numbers from the user, sort them, and display the results to standard output. Test your function on integer arrays of size zero, one, two, and ten, and sixteen. Rubric: - Does the program accept numeric input and display correct results? - Is the function recursive? - Does the function work on inputs of size zero, one, two, ten, and sixteen? - Does the function choose a suitable pivot element? - Is the relative ordering of elements retained as they are copied around the pivot? - Is the program well-documented? - Does the program include a Makefile? - Does the program compile without warnings or errors? Projects Example: Sample assignment: Write a recursive function to implement the quicksort algorithm. Write a driver program to accept a list of numbers from the user, sort them, and display the results to standard output. Test your function on integer arrays of size zero, one, two, and ten, and sixteen. Rubric: - Does the program accept numeric input and display correct results? - Is the function recursive? - Does the function work on inputs of size zero, one, two, ten, and sixteen? - Does the function choose a suitable pivot element? - Is the relative ordering of elements retained as they are copied around the pivot? - Is the program well-documented? - Does the program include a Makefile? - Does the program compile without warnings or errors? Repeatable No Methods of Instruction Laboratory Lecture/Discussion Distance Learning Lab: Following an instructor discussion on Makefile, the students will construct a Makefile for their own assignments. Lecture: Building a multi-file project is a complex process. The instructor will lecture and present a project consisting of at least three C files, three headers files, and a library (such as libm). The project can be built "by hand" using four compilation and link commands. From this information, a dependency graph can be illustrated. This dependency graph forms the basis of constructing a Makefile -- a file that describes the sequence of events needed to build a project and automatically re-build only the affected files when changes are made. The instructor will walk the students through writing and testing a Makefile for the example project. Distance Learning In the distance learning format, the instructor prepares a video demonstration using screencasting software of writing a C program that uses the printf and scanf functions to get input from the user, do a calculation, and present the results. Students watch this video to prepare for the week's lab assignment. Example: the student writes a program to calculate the area of a circle given the diameter. Typical Out of Class Assignments Reading Assignments 1. Read the textbook chapter about the primitive data types. Pay attention to how each has a different formatting code in the printf function. Be prepared to discuss in class. 2. Read the description of the programming assignment for this week. Prepare to discuss in class how to decompose the problem into functions and what variables will be needed. Writing, Problem Solving or Performance 1. Write a recursive function to implement the quicksort algorithm. Test your function on integer arrays of size zero, one, two, and ten, and sixteen. 2. Compare and contrast the Java and C programming languages in the following areas: performance, memory usage, portability, ease of readability. Other (Term projects, research papers, portfolios, etc.) Numerous hands-on programming assignments. Required Materials C for Programmers with an Introduction to C11 Author: Deitel, Paul and Harvey Deitel Publisher: Deitel Developer Series Publication Date: 2013 Text Edition: 1st Classic Textbook?: Yes OER Link: OER: Understanding and Using C Pointers Author: Reese, Richard Publisher: O'Reilley Publication Date: 2013 Text Edition: 1st Classic Textbook?: Yes OER Link: OER: Practical System Programming with C: Pragmatic Example Applications in Linux and Unix-Based Operating Systems Author: Sri Manikanta Palakollu Publisher: Apress Publication Date: 2020 Text Edition: 1st Classic Textbook?: Yes OER Link: OER: Effective C, An Introduction to Professional C Programming Author: Robert C. Seacord Publisher: No Starch PressĀ®, Inc Publication Date: September 2024, Text Edition: 2nd Classic Textbook?: No OER Link: OER: Other materials and-or supplies required of students that contribute to the cost of the course.