The command to start the linux terminal. Change of priorities - nice and renice. Man and getting help.

Terminal

Working with the command line is not such a daunting task as you might think. To use the command line, you do not need special knowledge, since this is the same program as all the others. Most of the tasks in Linux can be performed on the command line. And although for most programs there are graphical utilities, sometimes they are just not enough. This is where the command line is used.

You can play with arguments as long as you want. You should know that there is also the possibility to get something like this without creating any files in this folder. I hope this is useful. But for its use, you need to know how to access the terminal in your distribution. When you type the word "Terminal", an icon for this application appears. Inside, we will see an invitation and a flickering cursor in which we can write. An invitation is a string of text that appears in the terminal right after typing and every time we execute a command.

A terminal is often called a command line or a shell. In the distant days, users communicated with the computer in this way; and yet Linux users find that using the terminal can be faster than the graphical method. Now you will learn how to use the terminal.

Initially, the terminal was used as a file browser and it is still used in this role. You can use the terminal as a file browser, get to your files and cancel the changes made.

Configuring the Ubuntu Shell

It has the following structure. User: This is the user name that uses the console. Run commands on the console. To see the commands that we wrote earlier, we can give the arrow up on the keyboard and navigate with the arrows on the command, if we want to change something.

We hope you enjoy it and you can be of use. Working with the command line is not such a difficult task, as many might think. To use the command line does not require special knowledge, this is a program, like any other. Although for most programs there are graphic tools, sometimes this is not enough.

  Starting the Terminal

application Konsole    You can start by selecting K-menu->System->Konsole (Terminal Program)   from the desktop menu.

  Key Commands

Browse directories and files: - ls

Command ls    (LiSt) shows a list of files in different colors with full text formatting.

Creating directories is mkdir (directory name)

application mkdir    (MaKeDIRectory) creates a directory.

This is when the command line becomes useful. A terminal is often called a command line, a "hint" or a "shell". Here you will learn how to use the terminal. The initial use of the terminal was as a file manager and in fact is still used for this purpose. You can use the terminal as a file browser to manage your files and undo the changes you have made.

File-handling commands

There are six consoles available. For ordinary users, this access is not available for security reasons. This ensures that uncontrolled applications can not harm your system and serve as a reminder that you are going to perform administrative actions that require you to carefully study. The ship will remember your password for a certain period of time. This feature is designed to allow users to perform several administrative tasks without having to enter their password each time.

Change directory: - cd (/ address / directory)

application cd    (Change Directory - change directory) changes your current directory to the one you specified.

Copying a file and / or directory: - cp (file or directory name) (in: directory or file name)

Command cp    (CoPy) copies any selected file. Command cp -r    copies any selected directory with all the contents.

Deleting files and / or directories: - rm (file or directory name)

Command rm    (ReMove) deletes any file you specify. Command rm -r    removes any directory you specify with all the content.

Run the program manually with superuser privileges

Be careful when performing administrative tasks. This can damage your system! Sometimes you need to run the program with superuser privileges. This is easy to do with the "Start" command. Be careful when running applications with superuser privileges, as this can damage your system.

Set the option in 2 minutes

We are already the superuser. From this moment it's very cautious that the loaded bullets are already real. Tell us your advice or recommendations that you usually use. This is our experience of using this feature. Run at least the console, because there is no natural access to the GUI. We check how you can install several common packages. Obviously, these tests are very simple and only allow us to verify that the console that we have in front of us is functional.

Move / Rename Files / Directories: - mv (file or directory name)

Command mv    (MoVe) moves / renames any file or directory you specify

Search for files / directories: - locate (file or directory name)

Command locate    searches for files by the name you specify. It uses the index of files on your system to work quickly. To update this index, run the command sudo updatedb   . This command runs automatically every day if you leave your computer on. It must be performed with administrative privileges.

Yes, you can use graphical applications

There are applications that give problems or that are not performed directly. One with surprises, like the next. In fact, we do not have support here, but we can use a "trick". This is an installation of some type of application that accurately creates a windows server in the background, to which these graphical applications can be directed.

Who would have thought a few years ago, right? Before downloading the file, check its size in bytes specified on the download page of the website. Once the download is complete, compare this size with the downloaded file to make sure they are the same. From the terminal we can do almost everything, but in many cases it is necessary to know a lot of commands, so many of them do it all with the help of a GUI application.

Just in case, I will touch a little more on one topic. It happens that you have started something in the terminal and want to interrupt the work of this something. Usually it is very easy to do this, just press Ctrl + C on the keyboard.

There are other control combinations, for example Ctrl + D sends the end-of-file signal to the running application, and without running utilities does the same as the terminal exit command. Well, if you want to manage operating programs in more detail, then look at the system monitor htop, which, however, you need to install separately.

$ command option1 parameter2 ...

An excellent example could be the use of a calculator, but it would not be curious to expect directly from what many terminals were afraid of? The result will appear on the new line and will not disappear if we do not close the window. For me, the best way to install any software that knows the name is through the terminal, for which we will need to open a window and write the following command. For those who have never used a calculator of this type, it is worth remembering which keys to use for performing some of the most common operations.

History of entered commands

Finally, I just want to say that the terminal stores the history of user-entered commands, which you can scroll in real mode with the up and down arrows on the keyboard. This is very convenient for re-executing the commands entered earlier. And you can see the whole story with a team

Each team in history has a number, you can execute a command with a certain number again by typing in the terminal an exclamation point and the number of the required command:

For example, 2 ^ 3 will give us the result. . If you have no experience using the console, a good way to get started is to learn how to navigate through the file system and manage files and folders from the command line. In this sense, there are really many teams, so it's better to divide them into three groups in order to have a mental scheme and better remember all of them.

Commands for scrolling different directories

Starting with the first group, here you will see everything you need to learn to find yourself at the starting point and navigate through various catalogs. If you are interested, in this post you explained the details. Its function is just informative, but very useful at times. This is the only syntax that you really need to know about this command. Any command for processing files and folders will be applied to this directory. This will be the equivalent of entering or entering a folder, but from the console. Basically this requires the name of the directory in which you want to move.


And to repeat the previous typed command it is possible simply having written two exclamation marks !! .

It seems to me that with the habit of everything already described may seem like a dense forest, but in fact it is only the very tip of the iceberg, there are thousands of useful commands and interesting methods of work in the terminal. With the help of the terminal, you can edit files, listen to music, watch videos and perform many more everyday operations, but the description of all this goes far beyond the scope of this article.

It takes absolute and relative paths. This command takes you to the Documents folder inside the user's personal folder1. Very interesting when we want to return to the starting point. As in the first example, with this statement you will be placed in the "Documents" directory, which should be inside the current working directory.

You can use this operator to skip the reverse directory relative to the one in which you are located. This option is similar to the previous one, but now will allow you to abandon the two directories back. Until now, you have several simple applications to move you through different folders.

On this I will probably finish a brief introduction to the richest world of console Linux commands and continue to talk about the remaining key features of this versatile operating system:

Or you will be informed that there is no help page for this team. Though basically the information is on all commands, except for the built in terminal, like cd.

Commands for displaying directory contents, searching for files, etc.

If you do not specify an option, you will list all the files and directories that are in the current working folder, regardless of the hidden files. With this option, the command will show you in the form of a list all the content inside the working directory, including hidden files and folders.

Man and getting help

This parameter is similar to the first case, but displays the content as a list and includes information about each element. It is used a lot and is especially useful during each file. The difference is that by applying filters, you can use to more accurately find elements. The most basic operator will enumerate all the contents of the current working directory in a recursive way.

If you suddenly do not know - almost any console command is actually a separate program, and not any built-in terminal capability. In fact, only cd is part of the terminal, and for all other commands it is possible to easily find the main executable file by typing in the terminal which command And even which is also a separate program. If you get into all this - then, I hope, start to understand Linux in general and the terminal in particular. But if you think all this is too complicated, then you can just use the terminal when you need it and do not think about anything.

If you want to start filtering by name, you can add a parameter name. You can even make more specific filters by using wildcards. Here are a few examples that can be very useful. In this case, you have a clear example of how to perform a simple search for an archive file directly by its name. This is useful only if you know the exact name of the item you are looking for.

Create, delete, copy, and move files and directories

In this part, you will learn all the commands necessary to perform such actions as: create a zero directory, copy a file and paste it to another location, move files from one place to another, etc. If you do not specify a path, by default it will create a folder in the working directory in which you are located. To use this command, the directory to be deleted must be empty. Otherwise, it is indicated that the directory does not exist. If you want to skip the step of confirming a file by the file that you really want to delete, you use this command to delete the entire contents of the directory without warning.

As I mentioned in the previous footnote - each team is essentially a separate program. So, help on --help is always built into the program itself, and man and info take information from separate documentation files that are not always shipped with the application. Often, however, you can put them separately using the appropriate package with the -doc add-in, but I have not yet told you how to install the packages, so just keep this in mind.

Changing priorities - nice and renice commands

It's about knowing how this works, and the parameters that you enter at any one time. This is perhaps the simplest use of the command. In this case, the source file must be in the working directory in which you are located. This will be the equivalent of dragging a file from one location to another. The syntax is very simple, you just need to specify the start location, including the file name and target location.

You can also change the file name in the target location. This article describes the basic steps that you can perform in text mode. It had to be done from start to finish. Thus, paragraph headers are painfully unintelligent.

This is especially true when you accidentally run some extremely dangerous commands with incorrect arguments, for example sudo rm -rf / By the way, get acquainted, this command will remove everything   files from your computer. That's why you should never do it. Even if you interrupt it in the middle - the system you can not restore. I write this only to show that despite the power of the terminal (or thanks to it) when executing console commands, the most important thing is the user's attentiveness. Never execute commands whose assignments you do not understand. For example, the command echo "test ... test ... test ..." | perl -e "$ ?? s:; s: s ;; $? :: s ;; =] =\u003e% - (<-|}<&|`{;;y; -/:[email protected][-` (-); `- (/" - ;; s ;; $ _; see "does exactly the same as the one mentioned above. rm -rf / And the worst thing is that by running it you will not even notice anything until pores, until it finishes the work and you do not find the loss of absolutely all of your files. So always be careful!

To use the commands that will be listed here, you either need to open the terminal in a graphical environment, or use "text mode". Whenever you are in the terminal, there is a "current directory". To find out which directory you are in, type.

As a rule, this directory will be. To find out what files exist in the "current directory", type. The choice of the catalog depends on you. To find out where you can go. How about getting into the cache and deleting everything? There is a way to get rid of questions. Create catalogs for storing your things. This is a practice that allows you not to lose files and reduces the time that you lose before micro.

Continuing the theme:
Windows

A shortcut is an icon for a file that is created to quickly access content. For example, a folder with photos is located on the "Local Disk (D :)", and open it ...