Close ad

In the last part of our series, we got acquainted with the Terminal for Mac and explained how you can customize its appearance. Now let's look at the first commands - specifically, those that allow you to work with files and folders.

Orientation in folders

Unlike the Finder, the terminal does not have a classic graphical user interface, so it can sometimes be difficult for beginners and less experienced users to find out which folder they are in at any given moment. To find out what folder you're currently in, type in the Terminal command line on your Mac pwd and press Enter. If you want the Terminal to list the contents of the current folder, type ls in the command line and press Enter.

Move between folders

A while ago, we had a list of folders and files in the current folder written out in the Terminal. Obviously, unlike the Finder, you can't click to go to the next folder in the Terminal. Use the command to navigate to the selected folder cd [folder], followed by pressing Enter - you can see on the left that you have moved to the current folder. You can have its contents written out again using the command ls, which we have already mentioned. Didn't find what you were looking for in the current folder and would like to move up one level, i.e. to a parent folder? Just enter the command Cd .. and press Enter.

Working with files

In the final paragraph of this article, we will take a closer look at the basic work with files. As we have already said, you work in the Terminal with the help of commands, so classic clicking or the usual keyboard shortcuts such as Ctrl + C, Ctrl + X or Ctrl + V do not work. So, for example, if you want to create a new directory in the current folder, you use the command mkdir [directory name]. You can access the newly created folder with the command we have already described, i.e cd [directory name]. To copy a file, use the command in Terminal on Mac cp [filename] [destination folder]. If you just want to move the selected file, use the command mv [filename] [destination folder]. And in case you decide to permanently delete the file, the command will help you rm [file or folder name].

Topics: , ,
.