The 5 Commands Every Linux User Should Know

commands in ubuntu

Mastering Linux is not a matter of hours or days. Understanding its operation, structures and commands requires, as a rule, practice during many sessions to get to assimilate the concepts that underlie it. The great power of Linux is in the shell, from which to operate with the commands and to be able to deploy complex scripts to perform all kinds of functions.

Although each distribution includes different programs and some of its own functions, in this news we will present you The 5 Commands Every Linux User Should Know.

1. SUDO

Perhaps the most important of the whole system It is one that allows us to acquire administrator privileges to carry out certain special tasks. The command sudo o Superuser do It allows, from installing a program on the computer to modifying aspects of the hardware or restarting the computer. This command results indispensable for any task requiring elevation of privilege and what the user would typically do root.

If you have ever executed a command or performed a task in which the system has informed you that in order to execute it or carry it out you need to be root (NEED TO BE ROOT), then you must execute it with this function, such as: sudo apt-get update.

On some occasions, when you run graphical applications such as Nautilus or you launch the text editor gedit, it is preferable that you do not use this command for two reasons. The first is that there is a specific one for these cases which is gksudo, and secondly that it is avoided in this way some crashes in the graphical interface during the execution of these applications.

sudo

2.ls

The function that allows us to view the contents of a directory could not be missing among our favorites. Whether we just created it or it already existed, ls is one of the most versatile commands in all of Linux, since it includes a vast amount of attributes to allow us to visualize all the properties of files and directories. If the command ls allows us to list the content of a directory, with ls-la we can also list the attributes of all the objects found in the directory, including those that have the hidden modifier.

ls

3. zip

And continuing with our list of favorite commands we find the copy command or, which is the same, cp. There are many ways to invoke this command but the underlying idea is always to copy a file to another directory. That is why it is executed through cp file-name directory-name and, unless we are in the root directory of the site where we want to copy, we must enter the entire path or specifying each of the levels with ../.

This command supports the use of wildcards, facilitating the copying of many files at the same time as for example, cp * .txt / home / Luis / Documents.

linux pc

4.grep

Another command that every Linux user should know is grep. The main function of this command is find the matches of a string that we specify or, what is the same, filter the information based on a pattern that we introduce. Thus, we can use it directly against an existing file, such as grep text myfile.txt or by concatenating with pipes. The use of pipelines gives great versatility to this command, since it allows us to debug the outputs that we obtain from other programs if we launch an execution similar to this: cat myfile.txt | grep text.

This command also allows you to use a large number of wildcards that return one of the most complex to master thoroughly. I said, a very useful command and difficult to control deeply.

Linux GREP

5.rm

And to finish with this news, knowing that I left many other important commands along the way, I believed that it was necessary not to forget the instruction that allows us to delete a file or directory from our system. We must not confuse rm with rmdir, since this last command only allows us to delete directories from the system that are empty.

To delete a file, it is enough that we enter the sentence in the terminal rm file-name o rm * .txt if we want to delete multiple files. Be very careful if you are going to use the parameters -RF, since you can inadvertently delete all the information on your computer. You are warned.

rm

We hope that this review of the main Linux commands has been instructive for you. If you already knew them, maybe you want to share with us What other commands do you consider essential to know for every Linux user?. Of course, we only admit 5 😉


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  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.   Jimmy olano said

    So to keep up to date with the Ubuntu world we are watching your entries. Reading this one that concerns us today, that although we use the "console" daily, because we did NOT know the gksudo, command with which we can use gedit, for example, but of course with superuser rights. I AM VERY HAPPY to learn something new, so much so that I added that option to my own blog, and I make my appreciation known and public by means of a message on Twitter:

    https://twitter.com/ks7000/status/704295055524233216