- command line > terminal > console > shell
- **command line **- txt-based UI, way to talk w shell (windows)
- terminal - Wrapper that runs the shell. Typically ran by the CLI. (the command prompt)
- console - Refers to a physical terminal with I/O's (xbox, playstation, wii)
- shell - Permits executing operating system level commands. (bash-unix, powershell, cmd-windows)
- bash > cmd - more expressive and supporting. geekforgeeks
The Command Prompt is a command line interpreter application available in most Windows operating systems. It's used to execute entered commands. Most of those commands automate tasks via scripts and batch files - Lifewire
Bash is a Unix shell. A bash file is a batch file, but not the other way around. A batch file is a text file containing a series of commands. - tkalve
Scripting allows you to use programming functions – such as ‘for’ loops, if/then/else statements, and so forth – directly within your operating system’s interface...
It allow us to program commands in chains and have the system execute them as a scripted event, just like batch files.
They allow for command substitution: invoke a command, like date, and use it’s output as part of a file-naming scheme.
Types of “batch” files in windows
- `INI` (*.ini) – Initialization file. These set the default variables for the system and programs. - `CFG` (*.cfg) – These are the configuration files. - `SYS` (*.sys) – System files, can sometimes be edited, mostly compiled machine code in new versions. - `COM` (*.com) – Command files. These are the executable files for all the DOS commands. In early versions there was a separate file for each command. Now, most are inside COMMAND.COM. - `CDM` (*.cmd) – These were the batch files used in NT operating systems.
And some basic commands of batch file
- `echo` – Prints out the input string. It can be ON or OFF, for ECHO to turn the echoing feature on or off. If ECHO is ON, the command prompt will display the command it is executing. - `cls` – Clears the command prompt screen. - `title` Changes the title text displayed on top of prompt window. - `EXIT` – To exit the Command Prompt. - `pause` – Used to stop the execution of Windows batch file. - `::` – Add a comment in the batch file. - `COPY` – Copy a file or files - `CAT` - Displays inner content of a file
- A ; B: Run A and then B, regardless of the success or failure of A
- A && B: Run B only if A succeeded
- A || B: Run B only if A failed