https://github.com/ohn0/shell
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/ohn0/shell
- Owner: ohn0
- Created: 2017-02-25T00:35:21.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-06T12:14:01.000Z (over 9 years ago)
- Last Synced: 2025-01-15T08:51:35.844Z (over 1 year ago)
- Language: C
- Size: 95.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme
Awesome Lists containing this project
README
Shell User Manual
General Information:
This is a simple shell designed for basic interaction with the linux system. There are a set of built-in functions designed for interacting with the shell as well as the ability to execute your own programs alongwith the programs the system provides. Don't expect much.
Basic usage:
Command -args1...-argsN file1..fileN
Enter a command with any of it's arguments. If you also have to specify a file, it must be specified after the arguments are specified.
The length of the command cannot be greater than 200 characters.
Any command typed into the shell will:
First be checked to see if it is an internal command.
If not, check if it is an executable program within the current directory.
If not, check if it is in /bin or /usr/bin.
If none of these conditions trigger, the command will not be executed.
Internal commands:
cd - Enter , this will also change your shell's default environment to . If is not specified, the current active directory will be printed.
clr - Clears the terminal screen.
dir - List all the contents of
If is not specified, the contents of the current directory will be printed. can be relative or absolute.
:
-l: List the contents as one list
-a: List hidden entries
-r: list the contents of any folders within
environ - List all environment strings.
echo - Prints
help - Display this document.
pause - Pauses shell execution until enter is pressed.
quit - Quit the shell.
External commands:
Programs that exist in /bin or /usr/bin can be executed by typing their name(like ls, wc). You can also use man or help followed by the command to learn about the command's purpose.
User programs:
Executable programs in the current directory can also be run by typing their name.
I/O redirection:
This shell also supports I/O redirection and pipes if the user wishes to use them. The specified I/O files need to have their proper r/w permissions or the command will not execute properly.
command args < INPUT_FILE - The command will read from INPUT_FILE instead of expecting input from the keyboard.
command args > OUTPUT_FILE - The command will write any output to OUTPUT_FILE instead of the terminal. You will not be able to see what is being output until you read OUTPUT_FILE.
command args < INPUT_FILE > OUTPUT_FILE - Input and output can both be redirected for one command.
commanda | commandb - Redirect the output of commanda as the input of commandb. commandb will read whatever commanda writes.
Background process:
command args & - Typing & at the end of a command will execute that command in the background. The shell will start the program and come back to the user for the next command. If output is not redirected, the any output from the background command will be written to output_file.