Basic Linux teams in the Terminal

Anonim

Basic Linux commands in the terminal

By analogy with Windows, Linux has a specific set of commands for the most convenient and fast work in the operating system. But if in the first case we call the utility or perform an action from the "command line" (CMD), then in the second system of action are made in the terminal emulator. In fact, the "Terminal" and "Command Line" is the same thing.

List of teams in "Terminal" Linux

For those who recently started familiarizing with the line of operating systems of the Linux family, let's see the register of the most significant commands that each user needs. Note that the tools and utilities caused from the "Terminal" are pre-installed in all Linux distributions and do not need to be preloaded.

File Management

In any operating system, it is not without interaction with various file formats. Most users are used to using a file manager for these purposes, which has a graphic shell. But all the same manipulations, and even more of their list, you can spend using special teams.

  • Ls - allows you to view the contents of the active directory. It has two options: -l - displays content as a list with a description, -a - shows the files that are hidden by the system.
  • LS command in Linux terminal

  • CAT - demonstrates the contents of the specified file. For numbering the lines, the -n option is applied.
  • CD - used to move from the active directory to the specified one. When starting, without additional options, redirects to the root directory.
  • PWD - serves to determine the current directory.
  • MKDir - creates a new folder in the current directory.
  • File - Displays detailed information about the file.
  • File command in Linux terminal

  • CP - necessary to copy a folder or file. When adding an option, it turns on recursive copying. Option -a saves the attributes of the document in addition to the previous option.
  • MV - Used to move or rename folder / file.
  • Rm - deletes a file or folder. When used without options, the removal occurs permanently. To move to the basket, enter the -R option.
  • LN - creates a link to the file.
  • CHMOD - changes the rights (reading, recording, change ...). Can be separately applied for each user.
  • Chown - allows you to change the owner. Available only for superuser (administrator).
  • Note: To get the superuser's rights (root-rights), you must enter "sudo SU" before executing the command (without quotes).

  • Locate - designed to search for files in the system. Unlike the Find command, the search is executed in UpdatedB.
  • DD - applies when creating copies of files and their conversion.
  • Find - Searches for documents and folders on the system. It has many options with which you can flexibly configure the search parameters.
  • Find Team in Linux terminal

  • Mount-umounth - used to work with file systems. With its help, the system can be turned off and connect. To use you need to get root rights.
  • DU - shows an example of files / folders. Option -H performs a conversion to a readable format, -s - displays abbreviated data, and -d - sets the depth of recursion in the catalogs.
  • DF - analyzes disk space, allowing you to find out the amount of the remaining and filled place. It has many options that allow you to structure the data obtained.

Work with text

Entering the commands in the Terminal that directly interact with the files, sooner or later you will need to make edits in them. The following commands are used to work with text documents:

  • More - allows you to view text that is not placed in the area of ​​the work field. In the absence of a scrolling of the terminal, a more modern LESS function is applied.
  • MORE command in Linux terminal

  • Grep - Searches text on the template.
  • Head, Tail - The first team is responsible for the output of the first few rows of the start of the document (cap), the second -

    Shows the latest lines in the document. By default, 10 lines are displayed. You can change their quantity using the -n and -f function.

  • Sort - Used to sort the lines. For numbering, the -n option is used, for sorting from top to bottom - -R.
  • DIFF - compares and shows distinctions in a text document (line).
  • WC - considers words, lines, bytes and symbols.
  • WC command in Linux terminal

Process management

Long-term use of the OS for one session stimulates the appearance of a plurality of active processes that are able to significantly worsen the performance of the computer up to the fact that it will not be comfortable to work.

This situation can be easily corrected, completing unnecessary processes. The following commands are used in the Linux system for this purpose:

  • PS, PGREP - The first command displays all the information about the active processes of the system (the "-E" function displays one specific process), the second outputs the process ID after entering its name by the user.
  • PS command in Linux terminal

  • Kill - completes the PID process.
  • xkill - by clicking on the process window -

    Completes it.

  • PKILL - completes the process by his name.
  • Killall completes all active processes.
  • Top, HTOP - is responsible for displaying processes and apply as system console monitors. HTOP is more popular today.
  • Time - Displays the "Terminal" screen data on the time of process execution.

User environment

Important teams include not only those that allow you to interact with system components, but also performing more trivial tasks that contribute to convenience when working at a computer.

  • Date - displays the date and time in various formats (12 hours, 24 hours), depending on the option.
  • Date command in Linux terminal

  • Alias ​​- allows you to reduce the command or create it synonym, perform one or thread from several commands.
  • UNAME - provides information about the system's working name.
  • Sudo, Sudo SU - the first starts the programs on behalf of one of the users of the operating system. Second - on behalf of the superuser.
  • Sleep - translates computer into sleep mode.
  • Shutdown - Turns off the computer immediately, the -H option allows you to turn off the computer at a predetermined time.
  • Reboot - reboots the computer. You can specify a certain reboot time using special options.

user management

When not one person works at one computer, but a few, then the best option will create several users. However, it is necessary to know the commands to interact with each of them.

  • UseRADD, UserDel, UserMod - Add, Delete, edit the user account, respectively.
  • Passwd - serves to change the password. Startup on behalf of the SUDO (SUDO SU at the beginning of the command) allows you to reset the passwords of all accounts.
  • Passwd command in Linux terminal

View documents

No user is able to remember the value of all commands in the system or the location of all executable program files, but three easily memorable commands can come to the rescue:

  • Whatis - Displays the path to executable files.
  • MAN - shows a help or manual to the command, is used in commands with the pages of the same name.
  • MAN command in Linux terminal

  • Whatis is analogue above the presented command, however, this is used to display available certificate sections.

Network Management

To set up the Internet and in the future successfully make adjustments to network settings, you need to know at least somewhat responsible for these commands.

  • IP - setting up network subsystems, view available IP port ports. When adding an attribute -Show displays the objects of the specified types as a list, reference information is displayed with the -HELP attribute.
  • Ping - Diagnostics connecting to network sources (router, router, modem, etc.). Also reports information on the quality of communication.
  • Ping team in Linux terminal

  • NETHOGS - providing data to the user about traffic flow. Attribute -i Specifies the network interface.
  • Tracerout is an analogue of the Ping command, but in a more improved form. Displays the data packet delivery speed to each of the nodes and provides complete information about the full packet transmission route.

Conclusion

Knowing all the above commands, even a newbie, who only installed a system based on Linux, will be able to interact with it perfectly, successfully solving the tasks set. At first glance, it may seem that the list is very difficult to remember, however, with a frequent execution of a command or another, the mains will take place in memory, and contact each time the instructions submitted by us will not need.

Read more