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


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

17 comments, leave yours

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   fraternal said

    Excellent tutorial.

    1.    FranciscoRuizAntequera said

      Thank you

  2.   Dani A. Daz said

    very good tutorial, but I have a question, any way that the rmdir command lets you delete folders that have content? the other day I had to delete the folders one by one, and it was from a 4 »touch screen and the truth is that it was an ordeal!

  3.   Caesarivs said

    rm is not only for deleting files, it also deletes folders with the -r parameter, that is, "rm -r" allows deleting "recursively"

    1.    Caesarivs said

      It also applies to the cp command, if what we are going to copy is a folder, we must pass the -r parameter so that it copies recursively

      1.    Francisco Ruiz said

        Thanks for your annotations

  4.   dani and javi said

    I did not hear about naa ijo de putaaaa

  5.   diegal said

    you are very right ioputa boluo

  6.   negredo seville fc said

    I loved you guey, these two are very right

  7.   negredo seville fc said

    what a bitch shit

  8.   NA said

    Hello, Daniel Jimenez, I'm gay, I like guys and they give me hard while they take my hair and eat eggs and swallow everything they throw at me.

  9.   NA said

    k kabrones are we not? hahahahahahaha

  10.   antonio angel gay said

    eat my buttonhole hahaha LONG LIVE THE PENIS

  11.   diegal said

    this is shit asiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

  12.   dani said

    how can I delete the content of a file from the terminal. with cp I tried what it did was copy and with mv what it did was change its name and place but what I am trying to do is erase the information from a file and keep it in the same place and with the same name.

  13.   Javier Renteria said

    thanks for the input

  14.   Erick Ricardo Camberos Cerecer said

    Hello