-
Notifications
You must be signed in to change notification settings - Fork 3
Bash (Terminal) Tutorial
Open your command-line. If on Windows, we expect you to use Git Bash since it's packaged alongside git. For mac users, use the Terminal application. This guide will use Git Bash. You will type commands directly into a console or terminal to perform tasks, rather than clicking buttons in a GUI-based application.
Since a terminal is purely text-based, assume case-sensitivity and don't put extra spaces. These can make invalid commands!
-
Use the tab key to auto-complete after typing part of a directory or file name. If it doesn't work, there's either more than one option, or you typed wrong. Double tapping tab will list out the options if you're lost!
-
Adding a
--help
after a command likerm --help
will give you a quick manual on how to use it. -
You can open a directory from your file explorer using the "Open GIT Bash here" option after right-clicking!
Notice that the yellow text is the directory you opened with GIT Bash
The green text is your device and username.
The yellow ~
is your current working directory, the "~" specifically being shorthand for the "home" directory, which will typically be the root directory (highest-level folder, usually a hard drive). This will change to a full filepath as you move around.
The $
is the line you can type a command or option on. If it isn't there, your computer is probably busy with a previous command.
This is also visible above your active typing line in the terminal, the yellow text.
Any filepath you type is relative to your current one (this applies to other commands too), unless you start the filepath with a ~
to note your root directory. cd ~/Documents/Kicad/8.0/projects
will be where your project files are located.
A
..
means one directory above
Double tap tab to have it list options if you're lost
Will list the subdirectories and files. Can do ls <filepath/directory>
to list a different directory, or add -l
or -a
to make it a detailed format or show hidden files respectively.
Make sure to also type the file extension, as you don't choose a file type. Typing out multiple names will create multiple files.
Typing multiple names makes multiple directories.
Moves a directory or file. Can also be used to rename a file by doing mv <old.ext> <new.ext>
Works the same as mv
, except copies the file/directory.
A
.
means current directory
This is a VERY dangerous command as it instantly deletes the file with no recovery. There is no recycle bin, so make sure you are deleting exactly what you want!
Delete a directory and everything in it with
rm -r <path/dir>
. Usingrm -rf
with the extra f will force remove everything.
Have any burning questions? Feel free to contact cheebri or breezyjoe on Discord!