The first module Introduction to Computers and Programming aims to define and introduce the fundamental keywords in computer science and programming. The learning objectives of this module are getting acquainted with the common terminology related to computers and having a first structural perspective to their functioning.
Introduction to Computer Science: Terminology
We are all very much familiar with computers, but how are they designed and constructed? This short lecture introduces the fundamental building blocks of the modern digital computer.
Operating Systems
The operating system provides the foundation for accessing and utilizing the computer’s functionalities. This section introduces the main concepts of how the operating system works.
File Management
Developed in the 70s to replace the manual archiving in the workplace, the commercial computer has a structured file system to store and process information in the long term. The following section introduces basic terms and concepts related to the computer’s file management system.
Command-line and Unix shell
In this module, we have covered the terminology used in computer architecture, operating systems and the Unix shell.
Exercise
We will proceed with a programming exercise using the Bash scripting language in order to also gain some practical understanding on the operating system and the Unix shell.
Note: Before moving on, please make sure your shell application is set up to allow interaction with your operating system. Mac users can directly use the Terminal application, whereas Windows users are recommended to install the Unix emulator application Cygwin (for instructions on how to install the Cygwin, please follow the link).
Use your computer’s shell to :
- Go to your home directory in the file system
- Create a directory named “cs101”
- Go inside the directory “cs101”
- Print the path to the current working directory
- Use vim to open a new text file called “myfirstfile.txt”
- Write “hello” in the file, exit by saving the file inside the vim prompt
- Making sure you are back in the “cs101” folder, list all file properties
- Delete the file “myfirstfile.txt”
- Go back to the home directory
- Delete the directory “cs101”
Solution
You can use the following commands for accomplishing each task:
- cd
- mkdir cs101
- cd cs101
- pwd
- vi myfirstfile.txt
- :wq
- ls
- rm myfirstfile.txt
- cd
- rm -r cs101
In order to study the details of different commands and alternative methods for doing file management on the Unix shell, you can take a look at the following cheat sheets listing commonly used commands in Unix and vim text editor:
- Unix Cheat Sheet
- Vim Cheat Sheet (Windows users: you can refer to this link to install vim)
Quiz
Please follow the link to the self-assessment quiz to make sure your understanding of the theoretical concepts covered in this module are complete.