https://github.com/adaros92/tinysh
A basic Unix shell written in C for my OS class.
https://github.com/adaros92/tinysh
c operating-system os shell terminal unix
Last synced: 2 months ago
JSON representation
A basic Unix shell written in C for my OS class.
- Host: GitHub
- URL: https://github.com/adaros92/tinysh
- Owner: adaros92
- License: mit
- Created: 2020-07-31T02:17:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-31T02:33:59.000Z (over 5 years ago)
- Last Synced: 2025-02-28T22:13:28.829Z (11 months ago)
- Topics: c, operating-system, os, shell, terminal, unix
- Language: C
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tinysh
A basic unix shell
## Build and run
```
make all
./smallsh
```
## Examples
### Basics
```
: # this is comment
:
: # list directory contents
: ls
: # redirect to file
: ls > some_file.txt
:
: # go home
: cd
: # travel somewhere
: cd [some directory]
:
: # print working directory
: pwd
:
```
Supports most other basic commands (cp, mv, cat, etc.)
### Signals and background processes
```
: # run some process
: sleep 10
: # CTRL + C sends SIGINT signal to kill bg process
terminated by signal 2
:
: # run same process but in the background
: sleep 10 &
background pid is [SOME PID]
: # get running processes
: ps
: # kill some background process
: kill -15 [SOME PID]
background pid [SOME PID] is done: terminated by signal 15
:
: # CTRL + Z enters foreground only mode
Entering foreground-only mode (& is now ignored)
```