This is Linux shell written in C.
- Run 'make' command.
- Run './a.out' command.
- The shell displays a prompt and is ready to take input commands.
- To quit, enter 'quit' or hit Ctrl D.
-
echo < arguments > Prints the given arguments on the screen.
-
pwd Displays the present working directory.
-
cd < argument > Argument may be address of a directory including " . ", " .. ", " ~ ", " - ". This command changes the directory based on argument provided. In addition, the "-" argument switches to the previous working directory and prints it's path. Note that in this shell, the path is printed relative to the shell's home being treated as " ~ ".
-
ls < options > < argument > Options include zero or more of " - ", " -a ", " -al ", " -la ". Argument can be either nothing or address of a directory. This command lists the contents of a directory based on arguments provided.
-
pinfo < argument > Argument can be process ID of a process, or nothing. It lists the details of a particular process. If no argument is given, process ID of current process is taken.
-
setenv < var > < value > Creates an environment variable var if it doesn't exist yet, and assigns it the given value.
-
unsetenv < var > Destroys the environment variable var.
-
kjob < jobnumber > < signalnumber > Sends the given signal to the process with the given jobnumber.
-
jobs Displays all the currently Running/Stopped/Sleeping/Defunct jobs with their current state.
-
fg < jobnumber > Resumes a running or stopped background process given by the entered job number and brings it to the foreground.
-
bg < jobnumber > Changes a stopped background job given by job number to running.
-
overkill Kills all the background processes.
-
quit Exits the shell.
-
Ctrl-D Exits the shell.
-
Ctrl-Z Pushes the currently running foregorund job to background after stopping it.
-
Ctrl-C Sends the SIGINT signal to interrupt the current foreground process.
-
Redirection and Piping Both redirection and piping can be handled with use of the " < "," > "," >> " or " | " operators.
-
Exit Codes Information about the previous command's exit code is displayed alongside the prompt as :') if the command exited successfully, or as :'( if it encountered an error. Initially, it is :').
- history < argument > Argument can be nothing or a number less than or equal to 20. If number entered is n, this prints the last n commands including the history command itself. If no n is specified, it is assumed to be 10. This can hold accross all sessions even after shell has been stopped.
- All other commands are considered to be system commands (Eg: vi, emacs).
- By default, the process is run on the foreground.
- When command is followed by ' & ' symbol, it is run in the background. (Eg: emacs &). When this background process terminates, an appropriate message regarding it's exit is displayed.
- When background processes run, the terminal is free to use.