- 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
Shell scripts
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