A terminal is one of the command lines and is a tool for giving commands to a PC. You will need it to execute the file of the code you wrote. Command line is an abbreviation for command line interface (CLI), which is a method of operating by typing the characters "command" from the keyboard to a PC. In contrast, the method of operating a PC using graphics is called a graphical user interface (GUI).
Here are some commands that are often used in the terminal.
cd
command
This is a command to move the directory.
ls
command
Shows files and folders directly </ strong> in your current directory.
--A directory is like a container for files and is a folder. The directory has a hierarchical structure The directory at the top level is called the root directory </ strong>. The directory you are currently in is called the current directory </ strong>. Also, the directory that is displayed when you open the terminal is called the home directory </ strong>. The default home directory on Mac is / Users / username </ strong>.
There are two ways to write in that path. ・ Absolute pass ・ Relative path
--The absolute path is the path described from the root directory.
It is a rule to write from /
.
Terminal.
$ cd /
###Now you can go to the root directory
I think the default root directory for Mac is Macintosh HD, so use cd /
to change to Macintosh HD.
If you check the directory directly under it with the ls
command, you can check and move even if you do not know the path.
Relative paths do not start with /
.
You can move it by writing from the directory directly under the current directory.
Thank you for reading this article.
Recommended Posts