Terminal Commands Everyone Should Know. Ubuntu, Linux and Mac OS X terminal commands (how to start and use the console) How to open a command line in linux

Terminal Commands Everyone Should Know.  Ubuntu, Linux and Mac OS X terminal commands (how to start and use the console) How to open a command line in linux
Terminal Commands Everyone Should Know. Ubuntu, Linux and Mac OS X terminal commands (how to start and use the console) How to open a command line in linux

Terminal

Working with the command line is not as scary a task as you might think. To use command line not required special knowledge, since this is the same program as all the others. Most tasks in Linux can be done from the command line. While there are graphical utilities for most programs, sometimes they just aren't enough. This is where the command line comes into play.

The terminal is often referred to as the command line or shell. In the old days, users interacted with computers 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.

The terminal was originally used as a file browser and is indeed still used in that role. You can use the terminal as a file browser, get to your files and undo your changes.

Launching the Terminal

Application Console can be run by selecting K-menu->System->Konsole (Terminal Program) from the desktop menu.

Basic Commands

Browse directories and files: - ls

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

Create directories - mkdir (directory name)

Application mkdir(MaKeDIRECtory) creates a directory.

Change directory: - cd (/address/directory)

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

Copy file and/or directory: - cp (file or directory name) (to: directory or file name)

Team cp(CoPy) copies any selected file. Team cp-r copies any selected directory with all its contents.

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

Team rm(ReMove) removes any file you specify. Team rm-r deletes any directory you specify with all its contents.

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

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

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

Team 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 is executed automatically every day if you leave your computer on. It must be run with administrative privileges.

You can also use wildcards in file and directory names to specify more than one file, such as "*" (match all characters) or "?" (match one character).

Switching to console mode

To access the command line in Kubuntu, one usually launches a terminal (see "Launching the Terminal" above), however sometimes it is useful to switch to a real console:

    To switch to the first console, use the keyboard shortcut ctrl -alt -F1 .

    To switch back to the desktop, use the keyboard shortcut ctrl -alt -F7 .

Comment

There are six consoles available. Each of them can be accessed with a key combination: from ctrl -alt -F1 before ctrl -alt -F6 .

By analogy with Windows, Linux has a certain 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, actions are performed in the terminal emulator. In fact, "Terminal" And "Command line"- It is the same.

For those who have recently begun to get acquainted with the line of operating systems of the Linux family, below is a list of the most significant commands that each user needs. Note that the tools and utilities called from "Terminal", are preset in all Linux distributions and do not need to be preloaded.

File management

In any operating system, interaction with various file formats is indispensable. Most users are used to using file manager, which has a graphical shell. But all the same manipulations, or even a larger list of them, can be carried out using special commands.


Work with text

Entering into "Terminal" commands that directly interact with files, sooner or later you will need to make changes to them. To work with text documents the following commands are used:


Process management

Prolonged use of the OS during one session stimulates the appearance of many active processes that can significantly degrade the performance of the computer to the point that it will not be comfortable to work with.

This situation can be easily corrected by terminating unnecessary processes. IN Linux system For this purpose, the following commands are used:


User environment

Important commands include not only those that allow you to interact with system components, but also perform more trivial tasks that contribute to the convenience of working at a computer.


user management

When more than one person works at one computer, but several, then the best option will create multiple users. However, you need to know the commands to interact with each of them.


Viewing Documents

No user is able to remember the meaning of all the commands in the system or the location of all the executable files of a program, but three easy-to-remember commands can come to the rescue:


Network management

In order to set up the Internet and subsequently successfully make adjustments to the network parameters, you need to know at least a few commands responsible for this.


Conclusion

Knowing all the above commands, even a beginner who has just installed a Linux-based system will be able to interact with it perfectly, successfully solving the tasks. At first glance, it may seem that the list is very difficult to remember, but with frequent execution of a particular command, over time, the main ones will stick into memory, and you will not need to refer to the instructions presented by us every time.

Mac OS is a Unix system and as a full member of the Unix family it has a command line (I think not experienced users Mac will surprise you.) Yes, in Mac OS, as well as in Linux, Windows has a command line through which you can execute absolutely all commands. Initially, work in Unix, Linux, Windows happened like this - the user entered a command and after a while received the result. Then a graphical interface appeared, with the help of which it was possible to perform the same operations only much easier. Today, almost all operations in Mac OS can be performed in a graphical interface, but there is still an administration area in which you can’t do without the command line (in Mac OS it’s called the Terminal), it’s especially needed when restoring the operating system. But since failures in Mac OS are extremely rare, many users do not even realize that they have a Terminal.

To get started with the Terminal or just execute some commands, you need to run it. Launch Terminal on Mac possible in several ways.

Open Terminal using Spotlight search.

Launch Spotlight by clicking on the magnifying glass icon in the menulet area or using the keyboard shortcut + <Пробел>.

In the Spotlight search bar, enter the word Terminal and press "Enter"

As a result, you will see a Terminal window.

Launch Terminal in Finder.

If the first way to launch the Terminal did not suit you for some reason, in my opinion, it is the most convenient, there is another way. Open "Finder" select "Programs" - "Utilities".

Among the utilities, find "Terminal" and run.

Many users of the operating Mac systems OS from Apple quite often in their work they have to deal with tasks that can only be solved through the "Terminal" application. And newcomers to the Mac infrastructure usually avoid messing with this program like the command line in a WIndows environment.

Yes, it's really almost the same thing, but it's not at all scary and even useful. On Mac OS, some interesting and useful things can only be done using the Terminal, and many users do not even know where it is and how to turn it on. Just for them, we will tell how to open terminal on mac os?

Opening a terminal on Macs is no different than opening any other program and is done different ways. Here are a couple of them. Any other program on Mac OS opens in the same way.

1. Open terminal via Finder

The most direct way is to open from the general list of programs. To do this, open the program Finder(in the Dock menu it is always on the left), in the left menu select "Programs" and in the list of all programs that opens, find the folder "Utilities"- in it you will find the application "Terminal.app". double click open it - Terminal is open.

2. Open terminal via Spotlight search bar

Even more fast way open the program you need through the Spotlight search bar on Mac. To do this, hold down the key combination at the same time. ctrl+space, and in the pop-up window, start typing the word "Terminal". After you see desired application, just click on it - Terminal is open.

3. Open Terminal via Programs in the Dock

The last method, like the previous two, is not difficult. On the right side of the Mac OS Dock, there is usually a shortcut "Programs", which opens a list of all installed programs on your Mac. Click on it and in the pop-up window open the folder "Utilities", and in the following list find and open the program "Terminal.app"- The terminal is open.

The terminal is a text input and output environment. Used to manage system processes. Represents a kind of device file that can execute additional commands.

Command line

In a text environment, you can quickly:

  1. install and remove programs;
  2. change network settings;
  3. change access rights;
  4. enable, disable the graphical interface;
  5. turn off, restart the computer;
  6. install drivers;
  7. create users;
  8. update the kernel and all system components;
  9. install additional measures burglary protection;
  10. configure network, dns, ip-address, mask;
  11. run programs, scripts on schedule. cron job scheduler
  12. restart, turn off the computer;
  13. and much more.

What is shell?

Shell, visually speaking, is a black window in the middle. In my case it is white.

Shell is a shell, a program that accepts various commands from the user.

The graphical shell helps the user to make Linux easier to understand, but sometimes the user needs to start the command line. In this case, the question arises. How to open it?

There are several ways to launch the terminal:


Questions and answers

How to call a command line with root privileges?

There are two main options:

  1. In the input line, type "sudo bash" and enter the password.
  2. Enter "su -".

How to exit the Linux terminal?

  1. If in a graphical environment, then enter "exit".
  2. If without graphics, then press hot alt keys+ ctrl + f7.

What is the difference between terminal and console?

To understand the differences, it is necessary to distinguish between these two concepts.

Terminal, as mentioned above, is a text input and output environment. Console - physical terminal.

These two terms are very related.

Konsole is about working with the device itself physically. Terminal - remotely.

For example, in a graphical environment, we opened the terminal emulator, it gave us access to the "console".

How to open the console?

To open the console, enter the following at the command line:

  1. in ubuntu, debian is "gnome-terminal";
  2. in Linux Mandriva - "konsole".

Important! Activating the text console will disable the graphical shell, however running processes will remain working.

As a result, we can say that starting the terminal in Linux should not cause difficulties. Another thing is to enter commands, install and remove programs. The basic commands for beginners are described in another article.