run make
to generate the executable
run ./shell
to run the shell
run quit
to exit the shell
- The shell waits for the current process to execute
- Use '&' at the end of any command to invoke a background process
- The process will then run in the background and when exited, a message will be displayed
- ls takes arguments as flags (as -) and directories (as )
- It lists the files of the directory mentioned. If no directory is mentioned, it lists the files in the current directory
ls
- lists in alphabetical orderls -l
- long listls -a
- display hidden filesls -al/-la/-a -l/-l -a
- long list including hidden files
cd <absolute path>
- goes to absolute pathcd
- goes to ~/cd ~/<pathname>
- goes to ~/cd ..
- goes to previous directorycd .
- stays in the same directory
echo
- prints empty lineecho text
- prints textecho "text"
/echo 'text'
- prints text
pwd
- prints absolute path of current directory
pinfo
- prints process info of the shellpinfo <pid>
- prints process info of given pid
- Ouput of one command can be redirected to a file
- Similarly input can be taken from another file
- One or more commands can be piped
- Pipes and i/o redirection can be done together
- The shell inherits environment variables from the parent
setenv var value
- used to create environment variable varunsetenv var
- destroy the variable var
jobs
- prints a list of all background processes
kjob <jobnumber> <signal>
- takes the job id of a running job and sends a signal value to that process
fg <jobnumber>
- brings a running or a stopped background job with given job number to foreground
bg <jobnumber>
- changes a stopped background job to a running background job
overkill
- kills all background process at once
quit
- exit the shell. The shell exits only when quit is typed
- CTRL+C - sends a SIGINT signal to the foreground jobs of the shell and not the shell itself and neither to the background processes of the shell
- CTRL+Z - sends a SIGTTIN and SIGTSTP signal to the foreground process and makes the process a background process
- type
remindme <no of seconds> "task"
to set a reminder
- type
clock -t <interval time> -n <duration>
to display the date and time after specified interval and for the specified duration - made using hardware clock "/sys/class/rtc/rtc0"