- Uses GNU Readline for interactive input and history navigation.
- History Management
- History is persisted to disk in ~/.oslab_history
- History expansions and shell builtins.
- Job Management:
- Running multiple jobs in background.
- Killing Jobs based on job numbers
- Common shell builtins found in bash.
- Redirecting standard streams to files.
gcc main.c -lreadline -Wall -o shell
- exit - quit shell
exit
- cd - Change directory
cd [directory]
- jobs - List active jobs
jobs
- kill - Kill active Job/Process
kill %[jobid]
kill [pid]
- pwd - Display current directory
pwd
- type - Check type of command - builtin/executable
type [command]
- echo
echo Hello World
- history - List history
history
!! # run previous command
!n # run nth command in history.
!-n # run nth command from end in history.
- debug - Toggle debug output.
debug
Redirect stdin/stdout using >
and <
operators.
command < infiletxt > outfile.txt