Introduction to Terminal Commands

Sumit Kumar
3 min readJan 8, 2023

--

First open the terminal. You can find it in your computer(Mac and Windows).

It should look like this.

The above image can be called as Terminal Emulator and the idea to use this is to use the terminal in a graphical way. There are also many open-source terminal emulators on the internet.

Shell : A command line Interface that interprets our commands and tell the operating systems what to do. you can see the above picture, the interface in that picture is called shell.

So you have learnt enough. Let’s Start with writing some useful commands.

Make a folder

use the command mkdir followed by the name you would like to give the new directory.

So we have successfully created a folder.

List

The ls command stands for List. let’s use this.

It’s showing nothing because our folder named ‘Sumit’ is empty.

Let’s just use list command in a new shell.

It listed all the folders in my home directory.

Change Directory

To change this current working directory, you can use the “cd” command.

You can see the above image, the directory was changed. You can get into any folder by using this command.

If you want to go back, use “..” command.

If you want to go into home directory, just use “cd” command.

Display

To display something, you can use “echo” command.

So there are many more useful commands you can use.

List of useful Terminal commands

Open files : command “open

Copy a file to another Directory : command “cp

Move a file : command “mv

Create a text file : command “touch

(Use .txt while creating a text file)

Remove an empty Directory : command “rmdir

Remove nested Directories : command “rm -R

(When you want to remove an entire directory that might contain other directories or files)

Execute commands with Super user privileges : command “sudo

Quit Sub-screen and return to Terminal : command “q

(Alternatively you can press Control + C)

Clear the Terminal screen of all previous commands : command “clear

Copy contents of a folder to a new folder : command “ditto

Get one-line description of a command : command “whatis

The Exit command : command “exit

Thank you for visiting. The next article will be based on Git and Github.

Make sure you practice these commands on your computer and you can always search for more commands on Google.

ciao

--

--