Introduction to Operating Systems: Key Concepts | Concept:1. | Command Line Commands
|
Concept:2. | Special File Names/Types Some file extensions are used by the operating system to idenitfy programs that can be executed. The extensions commonly used are .bat, .com, and .exe. When entering a command (such as sort) the operating system will seach all of the directories in your PATH for the file to be executed (sort.bat, sort.com, sort.exe). |
Concept:3. | Batch Programs (scripts) A batch file, or batch program, contains a list of commands to be executed. Batch files usuall end with the .bat extension; there is support for loops and conditional processing in batch files and they can be complex. |
Concept:4. | Redirecting Program Input When a program is run, the program can receive its input from a file rather than from the keyboard (or console) using the sysbol < Example: the program echo.bas reads input from the keyboard and echos the data back to the screen. : blassic echo.bas. Any text file could be used as input rather than the console by using: blassic echo.bas < daysAway.bas will send the contents of the daysAway.bas program to the screen as if the user had typed it in. |
Concept:5. | Redirecting Program Output Output from a command can be redirected to a file - meaning that output from the command will not be displayed on the screen it will be sent to a file. If the output file does not exist it will be created; if the output file does exist, it will be overwritten. Example: dir > toc.txt this creates a text file containing the directory listing of the current directory.
Output from a command can be appended (added to the end) to an existing file using >>h; |
Concept:6. | Piping Piping refers to using the output from one command as input to another, the commands are connected using the symbol | Example: the command dir /p will show you the contents of the current directory, one page at a time. The command dir | more will show you the contents of the current directory - also one page at a time - but also provides you with the additional functions of the more command, such as just seeing the next line (instead of the next full screen). |