What is a Command Line?
It's provides a way of interacting with your computer, without the need of a GUI like file explorer.
The command line varies for Windows and Mac, so for explaining, I will use a common platform called Hyper Terminal.
Installation MacOS
- Download Hyper from the above link and Unzip it.
- Move it to application folder.
Installation Windows
- Download Hyper from the above link
- Run setup.exe
- Install GitBash, to use Bash.
- While installing Git Bash make sure you have Git Bash checked in Windows Explore Integration options, and keep all default options, then restart your computer.
- Now, we have to manage the Hyper Configurations, for that please go to this site
- Copy the details.
- Now after opening preferences, replace what is in the text file with what you copied in the git gist, now save it.
- Reopen hyper.
- Now to check type the following in your hyper terminal
echo $SHELL
- It should return
/bin/bash
if it is installed correctly.
What is Bash, Understanding Command Line
Kernel is the base of the computer system on which everything operates(In Layman Language).
Shell is like a cover or shell(pun 😆), which shields or covers the kernel from the user. Shell, provides a interface between user and kernel. It provides two types of interface, GUI which is the File Explorer and Terminal or Command Line.
Bash is a type of shell. BASH = Bourne Again Shell after Mr. Bourne. Bash Shell is a CLI ( Command Line Interpreter) for the Unix System. A lot of systems run on UNIX such as Linux, a lot of servers(such as a node development server), and even MacOS. But, windows uses DOS instead of Bash. This is the reason we aren't directly using the command line provided by windows.
Command Line provides greater control over your computer hardware, it is also easier and faster. We can also view hidden folders with the help of command line.
Command Line Techniques
List
- It displays all the files at your given location
$ls
The ~
sign shows where your current location is.
Change Directory
- It helps in changing your current location, to one location down
$ls
(Shows whrere you can go)
$cd <where to go>
- We can also go a level above by using
$ cd ..
- We can also specify the full path of where to go
$cd <Superparent>/<Parent>/<Child>
Make Directory
- It is used to make a new directory or folder at the desired location
$mkdir <Directory Name>
Creating A File
- It is used to make a file.
$Touch Text.txt
Opening a file
- For Windows
$start Text.txt
- For MacOS
$open Text.txt
Delete Files and Folders(Please Use These Commands wisely, as it can delete important files)
- For Files
$rm Text.txt
$rm * (Removes all the files of the folder)
- For Folders
$rm -r AllDocs/
Clear Previous Lines
$clear
Exiting The Terminal
$exit
OR
$logout
Learn More?
If you want to learn more about command line this is what I recommend-
Top comments (0)