The most useful commands for the command line. Command concatenation operator


Greetings, dear friends, acquaintances and other personalities. Today we will talk about such a useful thing as console commands, as well as about working with the command line in general.

The command line is text interface, in which commands are issued by entering text strings from the keyboard. Another name for the command line, as you have already understood for a long time, is the console.

To many users, the command line seems like an anachronism from the days of working with DOS, however sometimes she is completely necessary tool, not only for professionals, but also for the average user.

Basic console commands. What's what and why. Introductory

Actually, this thing is one of the key elements for system management, despite the fact that the OS has long switched to GUI. Not knowing about the console and not being able to master at least its basic fundamentals is bad, and even if IT-a student who has no knowledge about basic things at all...

To launch Command Prompt, press the keyboard shortcut Win+R and in the window that appears “ Execute» enter cmd. The command line utility itself is usually located in the folder C:\Windows\System32\cmd.exe.

This is what the command line looks like by default Windows. As you can see, everything is quite ascetic. If you want a nicer look, click right click mouse over the window title and select " Properties", tab " Colors", where you can choose the font and background color.

In the window that opens, at the top you see the traditional small-soft copyright sign, and just below there is a line with the current catalog and a blinking cursor inviting you to start working.

The command line has hotkeys that can help you with your work:

  • F1– each time you press a key, enters the last command letter by letter;
  • F3– displays the last command;
  • F5– each press displays the previous command;
  • F7– displays a numbered list of commands (the last 50 commands are saved by default).

Now let's look at some commands in more detail.

dir command
Displays the contents of the current directory. If you need to view the contents of another directory, you will have to specify the path to the console, for example: dir (space) C:\, and press Enter.

cd command
Allows you to change the current directory. Let me remind you that the directory in which you are in this moment located, listed here:

Do you want to know and be able to do more yourself?

We offer you training in the following areas: computers, programs, administration, servers, networks, website building, SEO and more. Find out the details now!

To change the current directory type: cd (space) C:\Folder name and press Enter.

Notes:

  • If you want to open a new directory on the same disk where the current one is located, then you do not need to register the disk; you just need to indicate the name of the desired directory.
  • In order to use the command CD move to another drive, you need to add this parameter (sometimes called a flag) /D, that is, the command to switch to another disk will look like this:
    cd /D D:\

mkdir command
Allows you to create new folders with the name you specify.

Default command mkdir creates folders in the current directory. If you need to create a folder in another directory, write this, for example:

Using the same command, you can immediately create a directory tree.

rmdir command
Used to delete directories. Something like this:

Note: default command rmdir deletes only empty directories. If you use it to try to delete a folder with contents, you will see the following message:

To delete a non-empty folder, use the command rmdir need to add parameter /S. Like this:

Don't forget to confirm the deletion by pressing the " Y" And Enter.

shutdown command
I think it's clear from the name that this command allows you to turn off the computer. I foresee a completely logical question - why turn off the computer using the command line, when it is much easier to turn it off through the main menu Windows. But imagine, for example, that you need to leave, and the computer is still performing some task that you do not want to interrupt, but the computer must nevertheless be turned off. In this case, the command shutdown irreplaceable.

So, on the command line, type:

shutdown (space) –s

In this case, the computer will simply turn off. If you need a delayed shutdown of your computer, type:

shutdown (space) –s (space) –t (space) time in seconds, through which the computer should turn off:

Once you click Enter, the countdown of the time remaining until the computer turns off will begin. IN XP it looks like this:

IN Windows 7:

If you change your mind about turning off the computer, you can stop the countdown by adding the –a parameter to the command shutdown. Like this:

And the countdown will be disabled.

systeminfo command
Provides detailed information about system configuration, version information, type, processor, version BIOS, memory capacity, etc. Like this:

z

driverquery command
Lists all installed drivers devices and their properties. If you add the parameter to the command /V, in addition to the list of drivers, their status will also be displayed.

cls command

When the command prompt window becomes filled with various text and becomes difficult to operate, the command cls allows you to clear the screen.

msconfig command
Calls the service " Windows System Configuration".

I think that for many it will not be new.

regedit command
Opens a utility that allows you to edit system registry Windows.

chkdsk command
Intended. If the command is used without additional parameters, then a report on the status of the current disk is displayed on the screen.

Here are some command parameters that may be useful when checking disks:

  • /f– sets the correction of errors on the disk. For the scan to begin, the disk must be locked. If the drive is not locked, you will be prompted to check the drive the next time you restart your computer.
  • /v– allows you to display the names of scanned files and directories;
  • /r– allows you to detect bad sectors disk and restores that part of the data that can still be read.

format command
Using this command you can format HDD. I don’t recommend doing this now :) Syntax:

format (space) C: Enter.

The following additional parameters exist for this command:

  • /fs defines file system when formatting a disk;
  • /v allows you to set a volume label;
  • /a allows you to set the cluster size. If this parameter is not specified, the cluster will be determined automatically based on the disk size.

This is the bare minimum :)

pathping command
The utility that this command runs provides information about data loss on intermediate nodes between the origin and destination. The command sends ping messages to each router along the path over a period of time, and then calculates the loss rate for each router based on the responses received. This way you can identify routers that have problems accessing the network.

netstat command
Displays active connections TCP, ports listened to by the computer, statistics Ethernet, routing tables IP, statistics IPv4(for IP, ICMP, TCP and UDP protocols) and IPv6(for protocols IPv6, ICMPv6, TCP through IPv6 And UDP through IPv6). If you run the command without parameters, only connections will be displayed TCP.

tasklist command
Launches a command line utility that lists all launched by the system processes with PID- code and size of the occupied space random access memory. If the command is run without additional parameters, a list of processes on the current computer is displayed.

To see the list of processes remote computer serves as a parameter /s indicating IP addresses or computer domain name.

taskkill command
Unlike the previous command, this one is intended to stop a process on a local or remote system. A process can be stopped by its ID. To do this, use the parameter /pid. For example, like this:

taskkill (space) /pid (space) 3148 Enter

In addition, the process can be stopped by image name by adding the / parameter im. Like this:

taskkill (space) /im (space) AnVir.exe Enter

Further.

sfc team
Very useful utility, which is intended to restore damaged system files. Here are some parameters it works with:

  • /scannow- immediate scanning of all protected system files;
  • /scanonce- checking protected system files the next time the system boots;
  • /scanboot– scanning of all protected system files every time the system boots;

Afterword

This material presents the bare minimum for working with the console. In subsequent articles, there may be more interesting and useful commands. However, you can study some of them yourself by entering the command in the console help, after which, having selected the command you are interested in, enter HELP<имя команды> to learn about its syntax and other components:

As always, if you have any questions, additions, thanks, etc., write in the comments.

Remember that you are better!
Which means everything will be fine.
Stay with us.

PS: For the existence of this article, special thanks to a friend of the project and a member of our team under the nickname “Wolverine”.

Windows lets you do a lot of different things, with all sorts of tools and utilities, most of which can be easily accessed in . A similar, but more efficient and faster way is to use the Run function, which is available in all Windows operating systems.

Some users believe that this window is intended for geeks or nerds, but in fact this is not the case. It can be used by intermediate and beginners, but only if they know what they are doing and what commands to enter. In short, the tool allows you to become more productive while working on your computer. Therefore, if you are interested in this, or need to know about it, then here is a list of commands for the dialog box Execute.

We've given you a list of 30 execute commands so you can bypass the endless clicks, thereby speeding up the process of launching utilities and tools in your everyday use Windows. It should be noted that in Windows 8 the Run window does not disappear. To open this window, simply press the “Win ​​+ R” key combination on your keyboard and it will appear.

Note: again, to bring up the Run dialog box use Win(Start) + R on the keyboard, then, in the input field, enter any command to access the corresponding tool and press Enter.

List of commands for the Run window

1. "\"

Most users usually open the C drive via Windows Explorer or the My Computer desktop icon. There's nothing wrong with that, there's just more quick way To do this, use the Run dialog box by entering a backslash (slash).

2. "."

A command consisting of one dot opens home folder current user.

3. ".."

The command of two dots opens the “Users” folder, which is located directly in the C drive.

4.ncpa.cpl

This command opens a folder network connections.

5.appwiz.cpl

Use this command if you want to quickly access Programs and components, where you can uninstall any installed program on your computer.

6.Calc

If you want to open the built-in Windows calculator, then the fastest way to do this is to type the word calc in the run dialog box.

7.CMD

Everyone Windows users sometimes you have to deal with the command line. Typing cmd will quickly open a command prompt without administrator privileges.

If Command Prompt is too old for you, try PowerShell instead. To do this, simply type (without a space) in the input line of the Run dialog box, and it will open without administrator privileges.

9.perfmon.msc

Enter this command into the Run dialog box and the utility will launch, which allows you to monitor Windows performance, the effectiveness of programs and gives access to many other useful data.

10.powercfg.cpl

Windows allows you to adjust your computer's power consumption by reducing screen brightness, computer power, etc. Using this command launches the window.

11.devmgmt.msc

This command opens Windows Device Manager, which allows you to manage all the computer hardware. You can also use the command for this hdwwiz.cpl.

12.Regedit

The regedit command opens a window. This is a hierarchical database that stores parameters for almost everything on your computer: program settings, drivers, user passwords, Windows settings And all the rest.

13. msconfig

Use this command to open Windows system configurations, where you can configure boot and startup settings. services, services, etc.

14.sysdm.cpl

Opens system properties

15. netplwiz

This command is useful for computers with multiple . Administrators can open any account and customize it however they want. And other users can open and edit only their Personal settings user.

16.firewall.cpl

Do you want to quickly disable or enable Windows firewall? - just enter firewal.cpl in the execute field, and the firewall settings window will appear right in front of you.

17. wuapp

If you want to check or adjust the settings Windows updates, then use this command.

18.services.msc

Type services.msc and click Enter key, a window will open Services, where you can easily configure the settings for each service individually.

19. msinfo32

If you want to quickly get information about the system, then use the msinfo32 command and you will have access to all the information about the system, including hardware and software.

20.sdclt

33. utilman

Above we showed you how to open on-screen keyboard on Windows. But besides this, there are other useful service Windows programs, such as, magnifier, screen reader, etc. You can access them using this command.

34. write

Last but not least is the write command, which opens the built-in Windows editor WordPad(Notebook).

The Run tool in Windows, including its commands, is one of the most the best means, which you can find on Windows. In addition to the commands listed above, there are hundreds of other commands that provide access to various operating system tools and utilities.

Command line - special program, which allows you to control the operating system using text commands entered in the application window. Its interface is completely text-based, in contrast to the usual appearance of the operating system.

Performing actions using text expressions, of course, is not as convenient as clicking on icons on the screen, selecting menu items, or opening program windows. But sometimes it is simply necessary to open the command line, for example, in case of problems with the system, working with network and equipment settings, calling system applications. Here are some examples of its use:

  1. The systeminfo command allows you to collect information about the system, including installed updates and network information. The graphical interface does not provide for receiving such data.
  2. chkdsk - checks the disk for errors and generates a report.
  3. sfc /scannow is a useful command to start scanning and repairing damaged files.
  4. ipconfig - allows you to find out the IP address of your computer in a split second.
  5. ping - check the network operation in case of problems with the router.
  6. help - the command line will display a list of possible commands with brief information about them.

These are just a few examples beneficial use this application. In addition, through the program window you can quite successfully work on the computer without using a mouse.

Switching methods

There are several options to open the Windows Command Prompt:

In versions higher than Windows 8, in order to apply this method, you need to click on the magnifying glass next to the user name.


Also for quick launch you can create a desktop shortcut and hotkeys. You can create a shortcut like this:

  1. In the Explorer window, find the “Windows\System32” folder, right-click on the cmd.exe file in it, then “Create a shortcut” and select a name for it.
  2. Right click on empty space on the screen, find “Create shortcut” in the context menu. In the field that appears, type C:\Windows\System32\cmd.exe. Next, select a name and click OK.

Now you can assign hotkeys. Call the context menu of the created shortcut, click “Properties”, “Shortcut” tab, enter the required combination in the “Shortcut” field.

Please note that when launched using the shortcut, search box and explorer, the command line is launched from the System32 folder, and using the "Run" item of the Start menu from Users folders your computer.

Opening with extended rights

Among the methods discussed, some allow you to enable the command line as an administrator. The point is that even if current work you are using account Administrator, you do not have full rights to control the system. This is done to improve reliability and reduce the risk of damage from malware.

The most common startup recommendations are: Start, run, cmd. There is a Run option in the start menu. It runs a program that allows you to send single commands Windows system. IN in this case cmd command Launches executable file cmd.exe located in the system32 folder.

C:\WINDOWS\system32\cmd.exe

On some Windows versions The execute menu item is removed by default. In this case, press + R, enter cmd, then Enter. You can also launch the command line directly from the system32 folder by making a shortcut to launch it on the desktop (right-click on cmd.exe and select Send/Desktop from the menu) or through the task manager (button new task-cmd).

By default, you cannot use the mouse in the command line (move the cursor or select text). This is inconvenient in general and for beginners in particular. In addition, the black screen looks somehow too gloomy and dull. So after running the command line

you will need to change its settings. Right click on cmd window and select defaults. It’s worth noting right away that the default settings apply to cmd.exe as a whole, and the properties apply to a specific open window.

In the command line properties window that appears, we see four tabs:

On the Options tab, it is worth checking the items to discard repetitions (to reduce the filling of the command buffer) and mouse selection (so that you can use the mouse in your work).

On the Fonts and Colors tabs, everything is simple: select the size, type and color of the font, as well as background color window. I will only note that the font size affects the size of the command line window, so it should be set before the window size, and not after.

In the Arrangement tab, you set the size of the window and its initial location at startup. I still don’t fully understand in what units the quantities are presented, so I advise you to set the size, guided by the preview window on the left.

It is worth noting that the buffer size affects the window capacity, i.e. on the amount of information that can be viewed without problems after the command execution results are displayed on the screen (horizontal and vertical stripes scroll). If you set equal sizes for the window and the buffer, then the window will display only the tail of the output information that will fit there.

Also, if the line does not fit into the width of the window, this will lead to its wrapping. It is less convenient to perceive information presented in this way. Therefore, I always set the buffer much larger than the window size. This allows you to view large amounts of information using the scroll bars on the right and bottom. The image below is clickable. The preview shows the beginning of the output of the dir command for the system32 folder, and by clicking on the preview you can see the tail of the output (pay attention to the scroll bar on the right - there is a lot of data).

Command Line Commands

The console is configured, now it remains to familiarize you with the command line commands. To display a complete list of them, just type the help command.

help - displays help for the commands help CD or CD /? - display help for one command (for the CD command) cd - go to the root directory cd .. - go to the parent directory D: - go to drive D. dir - output all contents of the folder dir *.exe - output a list of exe files in the folder cls - clear the command line screen

Command Prompt remembers the commands you enter. You can scroll through them using the ⇑ and ⇓ keys. You can view the contents of a folder using the Tab key (Shift + Tab scrolls in reverse order). You can scroll through files to a specific letter or letters. For example, by typing the letter s and pressing Tab, you can scroll through only files and folders starting with this letter ( s system, s ystem32, s ystem.ini, etc.) . How this can be used:

For example, you need to go from the root of drive C to the system32 folder, find and launch the control panel in it. You can simply type:

C:\ windows\system32\control.exe

But this is not always fast and convenient, and besides, you don’t always know what exactly you need to type. Therefore, you can type the command CD, then after the space type wi Windows, put a slash after it, type the letters sy, scroll with the Tab key to the folder sy stem32, then slash again and the same with control.exe.

C: cd wi ndows\ sy stem32\ co ntrol.exe

This tab method is much faster in most cases than simple typing, since file and folder names can be long.

When you enable mouse support, you can copy information from the command line by selecting a section of text with the mouse and pressing Enter. The right mouse button, on the other hand, pastes information from the clipboard into the command line.

To conclude this article, I will say that cmd.exe is just an input/output program, the same as notepad. Of course, there are more advanced analogues that can also be used. One such program is Console Portable

By the way, in operating system The GNU Linux command line can be called directly from the folder. In this case, a line will open immediately with the folder address and you will not need to enter it manually. In Windows, in order to open the command line directly in a folder, you need to hold down Shift, press the right mouse button and select "Open command window" from the menu.

You can also add this feature (and a number of others) using an extension program context menu FileMenuTools:

In Windows 7, there are operations that are impossible or difficult to perform through a regular graphical interface, but they can actually be carried out through the Command Line interface using the CMD.EXE interpreter. Let's consider basic commands, which users can apply when using the specified tool.

Using commands in the Command Prompt, you launch various utilities and perform certain operations. Often the main command expression is used together with a number of attributes, which are written separated by a slash ( / ). It is these attributes that initiate the execution of specific operations.

We do not set ourselves the goal of describing absolutely all the commands used when using the CMD.EXE tool. To do this, I would have to write more than one article. We will try to fit information about the most useful and popular command expressions on one page, dividing them into groups.

Launching system utilities

First of all, let's look at the expressions that are responsible for launching important system utilities.

CHKDSK– launches the Check Disk utility, which performs . This command expression can be entered with additional attributes, which, in turn, trigger the execution of certain operations:

  • /f– disk recovery in case of detection of logical errors;
  • /r– restoration of drive sectors in case of detection of physical damage;
  • /x– disconnecting the specified hard drive;
  • /scan– proactive scanning;
  • C:, D:, E: …- indication logical drives for scanning;
  • /? – call up help about the operation of the Check Disk utility.

SFC– launch the utility. This command expression is most often used with the attribute /scannow. It runs a tool that checks OS files for compliance with standards. In case of damage, if available installation disk It is possible to restore the integrity of system objects.

Working with files and folders

The next group of expressions is designed to work with files and folders.

APPEND– opening files in a user-specified folder as if they were in the required directory. A prerequisite is to indicate the path to the folder to which the action will be applied. The recording is made according to the following template:

append [;] [[computer drive:]path[;...]]

When using this command, you can apply the following attributes:

  • /e– recording a complete list of files;
  • /? – launch help.

ATTRIB– the command is intended to change the attributes of files or folders. Same as in the previous case, prerequisite is the input along with a command expression of the full path to the object being processed. The following keys are used to set attributes:

  • h– hidden;
  • s– systemic;
  • r- only for reading;
  • a– archival.

In order to apply or disable an attribute, the sign is placed in front of the key accordingly «+» or «-» .

COPY– used to copy files and directories from one directory to another. When using the command, be sure to indicate the full path of the copy object and the folder into which it will be performed. The following attributes can be used with this command expression:

  • /v– checking the correctness of copying;
  • /z– copying objects from the network;
  • /y– rewriting the final object if the names match without confirmation;
  • /? – activation of help.

DEL– deleting files from the specified directory. The command expression allows for the use of a number of attributes:

  • /p– enabling a request to confirm deletion before manipulating each object;
  • /q– disable the request when deleting;
  • /s– deleting objects in directories and subdirectories;
  • /a:— deleting objects with the specified attributes, which are assigned using the same keys as when using the command ATTRIB.

R.D.– is analogous to the previous command expression, but deletes not files, but folders in the specified directory. When used, the same attributes can be applied.

DIR– displays a list of all subdirectories and files that are located in the specified directory. The following attributes are used along with the main expression:

  • /q– obtaining information about the owner of the file;
  • /s– displaying a list of files from the specified directory;
  • /w– displaying a list in several columns;
  • /o– sorting the list of displayed objects ( e- by extension; n- by name; d- by date; s- to size);
  • /d– display a list in several columns with sorting by these columns;
  • /b– display only file names;
  • /a– displays objects with certain attributes, which are specified using the same keys as when using the ATTRIB command.

REN– used to rename directories and files. The path to the object and its new name are specified as arguments to this command. For example, to rename the file file.txt, which is located in the folder "Folder" located in the root directory of the disk D, in the file file2.txt, you need to enter the following expression:

REN D:\folder\file.txt file2.txt

M.D.– is intended for creating a new folder. In the command syntax, you must specify the drive on which the new directory will be located, and the directory where it will be located if it is nested. For example, to create a directory folderN, which is located in the directory folder on disk E, you should enter the following expression:

md E:\folder\folderN

Working with text files

The next block of commands is designed to work with text.

TYPE– displays the contents of text files on the screen. The required arguments to this command are the full path to the object whose text should be viewed. For example, to view the contents of file.txt located in the folder "Folder" on disk D, you need to enter the following command expression:

TYPE D:\folder\file.txt

PRINT– printout of contents text file. The syntax of this command is similar to the previous one, but instead of displaying text on the screen, it is printed.

FIND– performs a search text string in files. Along with this command, the path to the object in which the search is performed must be indicated, as well as the name of the searched string, enclosed in quotation marks. In addition, the following attributes apply with this expression:

  • /c– displays the total number of lines containing the searched expression;
  • /v– output lines that do not contain the search expression;
  • /I– case insensitive search.

Working with accounts

Using the command line, you can view and manage information about system users.

FINGER– displaying information about users registered in the operating system. The required argument of this command is the name of the user about whom you want to obtain data. Alternatively, you can use the attribute /i. In this case, the information will be displayed in a list format.

TSCON– attaches a user session to a terminal session. When using this command, you must specify the session ID or its name, as well as the password of the user to whom it belongs. The password should be specified after the attribute /PASSWORD.

Working with Processes

The next block of commands is designed to control processes on the computer.

QPROCESS– provision of information about running processes on PC. The information displayed will include the name of the process, the name of the user who launched it, the name of the session, ID and PID.

TASKKILL– used to terminate processes. The required argument is the name of the element that needs to be stopped. It is indicated after the attribute /IM. You can also terminate not by name, but by process ID. In this case the attribute is used /PID.

Networking

Using the command line it is possible to manage various actions online.

GETMAC– starts displaying the MAC address connected to the computer network card. If there are several adapters, all their addresses are displayed.

NETSH– initiates the launch of the utility of the same name, which is used to display information about network parameters and change them. This command, due to its very broad functionality, has great amount attributes, each of which is responsible for performing a specific task. For getting detailed information You can get help about them by using the following command expression:

NETSTAT– displaying statistical information about network connections.

Other commands

There are also a number of other command expressions used when using CMD.EXE that cannot be separated into separate groups.

TIME– viewing and setting the PC system time. When you enter this command expression, the current time is displayed on the screen, which can be changed to any other time in the very bottom line.

DATE– the syntax command is completely similar to the previous one, but is used not to display and change the time, but to launch these procedures in relation to the date.

SHUTDOWN– turns off the computer. This expression can be used both locally and remotely.

BREAK– disable or start the button combination processing mode Ctrl+C.

ECHO– displays text messages and is used to switch their display modes.

This is far from full list all commands that are used when using the CMD.EXE interface. Nevertheless, we tried to reveal the names, as well as briefly describe the syntax and main functions of the most popular ones, for convenience, dividing them into groups by purpose.







2024 gtavrl.ru.