Getting into the terminal: basic commands

Penguin Linux

The Linux terminal It is a powerful tool from which we can do whatever we want; in the following article, I am going to introduce you to this tool, explaining to the newest the main commands to defend ourselves and move correctly through the different directories of our operating system.

The commands or orders that I show you below, they are the most basic that a user of Linux should know.

Commands for handling files

  • cd - change directory, to return to the previous directory we will use cd followed by a space
  • ls - list the contents of the current directory
  • cp - copy
  • chmod - change the permissions of a directory or file
  • chown - change the owner of a file or directory
  • df - shows us the free space on our disk
  • du - shows us the used disk space
  • find - helps us to search for a certain file
  • gzip - decompress a file in this format
  • mkdir - create a new directory for us
  • more - show the content of a file
  • mount - mount a drive or partition on the file system
  • mv - move or rename a file
  • rm - delete a file
  • rmdir - delete a directory or folder
  • tar - to pack or unpack tar files
  • umount - to unmount a drive or partition from the filesystem.
Whenever we use the terminal, we must respect the spelling, and place the commands and directories or files respecting their names, with the accents the capital letters and lowercase.

Practical exercise: create a new folder on the Desktop, rename it, move it to another directory and delete it

The first thing to do will be to open a new terminal and type ls, with this we will report the content of the directory home:

Ls command

Then we will type cd Desk to enter the Desktop, and mkdir test to create a folder called test:

Creating a new directory from the terminal

Now we will rename it to nueva, for this we will type mv test new:

Renaming the directory

Now we will move it for example to the Downloads directory, for this we will type new mv / home / pakomola / Downloads:

Moving the directory

Now to finish we will delete the directory with the command rmdir new:

deleting the directory

How you can check is a very simple process and with it we will go familiarizing with the terminal of our Linux, as well as we will understand, for example, what actually happens when cwe read, copy or move a folder or directory from the comfort of the graphical interface.

More information - Introducing basic commands in the terminal