Hacks on how to use the terminal in vs code

Introduction
visual studio has been one of the rated code editors used by developers today for building and developing modern web, version control, debugging, and cloud applications. due to its unique features, it is widely accepted and has several navigations inputted such as a file, edit, selection, view, Go, Debug, terminal, help etc. Knowing this fact visual studio has enhanced extensions which is user friendly and also a big plus in the sense that the code editor runs code both online and offline which is free.
My attention is based on one of its navigations called terminal due to its unique format and function.
Coding with visual studio editor I discover and understand some functions of the terminal which make my work faster and also easy.
The terminal allows the user to send simple text commands to our computer to do things way faster and easier.
This article will provide you with some knowledge about the terminal, hack on the terminal, some shortcuts available in vs code terminal and also how to use the terminal to upload files on GitHub.

Image of a terminal
What is terminal
A terminal is a text-based interface to the computer which can be used to type commands, execute programs, manipulate files, and open documents. It is normally located at the root of the editor.
Visual studio terminal loads conveniently and starts at the bottom of your screen workspace which provides integration with the code editor to support features such as link and error detection.
basic steps in using the terminal in Visual Studio Code
Open Visual Studio Code.
Click on the View menu at the top of the window.
Select Terminal from the drop-down menu.
The terminal will appear at the bottom of the window.
To run a command in the terminal, type the command and hit Enter. For example, you can type "ls" to list the files in the current directory.
You can also open a new terminal window by clicking on the plus (+) icon on the right side of the terminal tab.
You can customize the terminal settings by clicking on the gear icon on the top-right corner of the terminal tab. You can change the terminal shell, font size, color, and more.
Let's talk about some ways of using the keyboard/command line shortcut in vs code terminal
Ctrl + C: This shortcut is used to terminate the current command that is running in the terminal.Ctrl + D: This shortcut is used to close the current terminal window.Ctrl + L: This shortcut is used to clear the terminal screen.Ctrl + Shift + T: This shortcut is used to open a new terminal tab.Ctrl + Shift + P: This shortcut is used to open the VS Code command palette, which allows you to execute various VS Code commands.Tab: This shortcut is used for auto-completion of commands and file/directory names.
Up Arrow and Down Arrow: These shortcuts are used to navigate through the command history in the terminal.
Ctrl + K: This shortcut is used to clear the terminal buffer and history.Ctrl + Shift + V: This shortcut is used to open the Markdown preview for the currently open file in the terminalCtrl + A: This shortcut is used to move the cursor to the beginning of the command line.Ctrl + E: This shortcut is used to move the cursor to the end of the command line.Ctrl + K: This shortcut is used to delete all text from the cursor position to the end of the command line.Ctrl + U: This shortcut is used to delete all text from the cursor position to the beginning of the command line.Ctrl + W: This shortcut is used to delete the word to the left of the cursor.Ctrl + R: This shortcut is used to search through the command history.Ctrl + Z: This shortcut is used to suspend the current command and put it in the background.Ctrl + Shift + C: This shortcut is used to copy the selected text in the terminal.Ctrl + Shift + V: This shortcut is used to paste the copied text into the terminal.Ctrl + Shift + Arrow keys: This shortcut is used to select text in the terminal.
How to open a terminal
There are four basic ways by which terminals can be open in vs code which are.
Use the Ctrl+` which is the keyboard shortcut to toggle the terminal panel.
Use the Ctrl+Shift+ keyboard shortcut to create a new terminal.
Use the View > New Terminal menu commands.
Use the Command power shortcut (Ctrl+Shift+P), click the View: Toggle Termina Command
Command on how to create a folder using a terminal.
use the command ( mkdir) followed by the name you would like to give the folder.
# mkdir
For example:

command on how to open the folder with a terminal.
Open terminal ( which can be done by the about command)
navigate on the terminal using the cd command to the folder you want to open
Code .
Steps to write and execute a script on terminal
Open the terminal. Go to the directory where you want to create your script.
Create a file with a .sh extension.
Write the script in the file using an editor.
Make the script executable with the command chmod +x <fileName>.
Run the script using ./<fileName>.
Steps on how to use terminal to upload files on GitHub
First, make sure you have Git installed on your computer and that you have created a GitHub account.
Open VS Code and open the folder containing the files you want to upload to Github.
Open the VS Code integrated terminal by pressing the Ctrl+ (Windows) or Command+ (macOS) keys.
Navigate to the folder containing your project using the terminal. You can use the cd command to change the directory. For example, if your project is in the folder named my-codes, you can navigate to it using the following command.
cd my-codes
Initialize a new Git repository by running the following command:
git initAdd the files you want to upload to the Git repository by running the following command:
git add .
This will add all the files in the current directory to the Git repository.
Commit the changes by running the following command:
git commit -m "Initial commit"Replace "Initial commit" with a brief description of the changes you made.
Create a new Github repository or use an existing one to upload your files. Make sure the GitHub repository is created with the same name as your local Git repository.
Connect your local Git repository to the Github repository by running the following command:
git remote add origin https://github.com/<username>/<repository-name>.gitReplace <username> with your GitHub username and <repository-name> with the name of the Github repository.
Push your local Git repository to Github by running the following command:
git push -u origin masterThis will upload all the files in your local Git repository to GitHub.
That's it! Your files should now be uploaded to Github.
some key features of the vs code terminal
The VS Code terminal is an integrated terminal within the VS Code editor that allows you to execute commands directly within the editor. Here are some key features of the VS Code terminal:
The terminal can be opened using the Ctrl+ (Windows) or Command+ (macOS) keys.
It supports different types of shells such as Bash, PowerShell, and Command Prompt.
You can customize the terminal settings to change the font size, color, and other preferences.
You can navigate between different terminal instances using the dropdown menu.
You can execute commands within the terminal by typing them in and pressing enter.
You can use the terminal to execute Git commands to manage your code repositories.
You can split the terminal window into multiple panes to work on different tasks simultaneously
Overall, the VS Code terminal provides a powerful and flexible way to work with command-line tools and manage code repositories within the editor.
conclusion
In summary, these are the basic command you need to be able to navigate through the vs code terminal
cd: This command allows you to change directories.
ls: This command lists the contents of the current directory. It's useful for seeing what files and folders are in your current location.
mkdir: This command allows you to create a new directory. For example, if you want to create a new folder called "my_folder", you would type mkdir my_folder.
touch: This command allows you to create a new file. For example, if you want to create a new text file called "my_file.txt", you would type touch my_file.txt.
rm: This command allows you to delete a file or directory.
