CS333 - Introduction to Operating Systems | Ho Chi Minh University of Science - VNU.
Spring 2020 Course
PROJECT #2: Build a simple shell on Linux: Simple commands with child processes, IO redirect & pipe.
(Checkout the #1 project here)
- 1751064 - Nguyen Hoang Gia
- 1751063 - Pham Bao Duy
- Ubuntu / Linux. (Recommended Ubuntu 18.04)
- Download or clone the project.
- Install essential components by running:
sudo apt-get install build-essential
- Change directory to the project folder.
- Compile through Makefile, run
make
- Run the shell
./simple-shell
- List sub-folder & sub-item
ls
- Current directory
pwd
- Ping website
ping -i 5 -w 10 -W 10 google.com
- ...
- Using double exclamation mark "!!" for checking history
!!
- Add an ampersand mark after the command with whitespace required.
ping -i 5 -w 10 -W 10 google.com &
- Redirect the output of a command to a file and input from a file to a command.
ls > myFile.txt
cat < myFile.txt
- Output of one command to serve as input to another using a pipe.
- For example: list sub-folder and sub-item in current directory, just display which has character "a" in the name.
ls | grep a