which will change the code page to UTF-8. Also, you need to use Lucida console fonts.
- CMD and “console” are unrelated factors. CMD.exe is a just one of programs which are ready to “work inside” a console (“console applications”).
- AFAIK, CMD has perfect support for Unicode; you can enter/output all Unicode chars when any codepage is active.
- Windows’ console has A LOT of support for Unicode — but it is not perfect (just “good enough”; see below).
- chcp 65001 is very dangerous. Unless a program was specially designed to work around defects in the Windows’ API (or uses a C runtime library which has these workarounds), it would not work reliably. Win8 fixes ½ of these problems with cp65001, but the rest is still applicable to Win10.
- I work in cp1252. As I already said: To input/output Unicode in a console, one does not need to set the codepage.
The details
- To read/write Unicode to a console, an application (or its C runtime library) should be smart enough to use not File-I/O API, but Console-I/O API. (For an example, see how Python does it.)
- Likewise, to read Unicode command-line arguments, an application (or its C runtime library) should be smart enough to use the corresponding API.
Practical considerations
- The defaults on Window are not very helpful. For best experience, one should tune up 3 pieces of configuration:
For output: a comprehensive console font. For best results, I recommend my builds. (The installation instructions are present there — and also listed in other answers on this page.)For input: a capable keyboard layout. For best results, I recommend my layouts.For input: allow HEX input of Unicode. - For output: a comprehensive console font. For best results, I recommend my builds. (The installation instructions are present there — and also listed in other answers on this page.)
- For input: a capable keyboard layout. For best results, I recommend my layouts.
- For input: allow HEX input of Unicode.
- One more gotcha with “Pasting” into a console application (very technical):
HEX input delivers a character on KeyUp of Alt; all the other ways to deliver a character happen on KeyDown; so many applications are not ready to see a character on KeyUp. (Only applicable to applications using Console-I/O API.)Conclusion: many application would not react on HEX input events.Moreover, what happens with a “Pasted” character depends on the current keyboard layout: if the character can be typed without using prefix keys (but with arbitrary complicated combination of modifiers, as in Ctrl-Alt-AltGr-Kana-Shift-Gray*) then it is delivered on an emulated keypress. This is what any application expects — so pasting anything which contains only such characters is fine.However, the “other” characters are delivered by emulating HEX input.Conclusion: unless your keyboard layout supports input of A LOT of characters without prefix keys, some buggy applications may skip characters when you Paste via Console’s UI: Alt-Space E P. (This is why I recommend using my keyboard layouts!) - HEX input delivers a character on KeyUp of Alt; all the other ways to deliver a character happen on KeyDown; so many applications are not ready to see a character on KeyUp. (Only applicable to applications using Console-I/O API.)
- Conclusion: many application would not react on HEX input events.
- Moreover, what happens with a “Pasted” character depends on the current keyboard layout: if the character can be typed without using prefix keys (but with arbitrary complicated combination of modifiers, as in Ctrl-Alt-AltGr-Kana-Shift-Gray*) then it is delivered on an emulated keypress. This is what any application expects — so pasting anything which contains only such characters is fine.
- However, the “other” characters are delivered by emulating HEX input.
One should also keep in mind that the “alternative, ‘more capable’ consoles” for Windows are not consoles at all. They do not support Console-I/O APIs, so the programs which rely on these APIs to work would not function. (The programs which use only “File-I/O APIs to the console filehandles” would work fine, though.)
One example of such non-console is a part of MicroSoft’s Powershell. I do not use it; to experiment, press and release WinKey, then type powershell.
(On the other hand, there are programs such as ConEmu or ANSICON which try to do more: they “attempt” to intercept Console-I/O APIs to make “true console applications” work too. This definitely works for toy example programs; in real life, this may or may not solve your particular problems. Experiment.)
Summary
- set font, keyboard layout (and optionally, allow HEX input).
- use only programs which go through Console-I/O APIs, and accept Unicode command-line arguments. For example, any cygwin-compiled program should be fine. As I already said, CMD is fine too.
The solution that works for me is:
In the batch file, change the charset page
My batch file:
chcp 1250
copy “O:VEŘEJNÉŽŽŽŽŽŽŽ.xls” c: emp
У консоли есть много команд, и этому посвящены отдельные учебники. Я покажу основные, самые популярные. Некоторые команды могут работать только в командной строке запущенной от имени администратора.
Почти любая команда может запускаться с параметрами. Чтобы посмотреть помощь по команде нужно ввести её со знаком вопроса, вот так:
Необязательные параметры обозначены в квадратных скобках:

Это дополнительные, т.е. уточняющие параметры вызова, которые можно не указывать, если устраивают умолчания.
Посмотрите небольшое видео как выполнять команды:
Команда чтения содержимого папки — dir
Отображает содержимое каталога. Для выбора другого каталога (не того, который отображается по умолчанию), необходимо указать требуемый путь. К примеру:

Перейти в другую папку — cd
Меняет каталог. Текущее «местонахождение» можно посмотреть здесь:

Для смены текущей папки нужно набрать команду:
Чтобы перейти на другой диск, достаточно просто ввести имя диска с двоеточием, например
Команда создать каталог — mkdir
Создает новую папку с заданным названием. Для того, чтобы папка была создана в указанном каталоге, необходимо прописать соответствующую команду, например:

Эта же команда позволяет создать целое дерево каталогов, в таком случае команда будет выглядеть так:
где цифры заменить на свои имена папок
Удаление папки — rmdir
Довольно полезная команда, с помощью которой можно удалить ненужный каталог. Выглядит она, например, вот так:
Стоит учитывать, что в стандартном виде, командой удалятся только пустые каталоги. Если в папке есть содержимое любого вида, пользователю выдается сообщение «Папка не пуста». Для того чтобы удалить папку вместе с содержимым, к команде добавляют параметр /S. Тогда команда будет иметь следующий вид:
rmdir /s c: emp est
Подтверждается удаление нажатием клавиш «Y» и Enter.
Популярные утилиты и программы для консоли
Помимо встроенных команд, командную строку часто используют для запуска консольных (с текстовым интерфейсом) и обычных программ. Для этого не обязательно открывать саму консоль, а можно ввести команду прямо в окне «Выполнить». Но при этом, после её исполнения, окно быстро закроется и исчезнет. Т.е., если надо смотреть результаты исполнения утилиты, её надо запускать из самой командной строки.
Выключение компьютера — shutdown
Здесь большинство пользователей задают вполне логичный вопрос: зачем ради выключения компьютера лезть в консоль? Ответ прост. Для примера, компьютер работает над выполнением определенной задачи, прервать которую нельзя. А вам в это время нужно уйти, или банально лечь спать, при этом на всю ночь оставлять компьютер включенным не хочется.
Конечно, есть и другие способы включить таймер на выключение компьютера, но практически все эти способы связаны с запуском постороннего приложения. Если же их нет под рукой, то как нельзя кстати окажутся команды командной строки. Итак, для выключения компьютера, набираем:
где цифры – это время, по истечении которого компьютер выключится (в секундах). После нажатия клавиши Enter, начнется отсчет времени до выключения ПК. При этом появится такое сообщение:

За 10 минут до конца появится ещё одно системное уведомление. Если необходимости в отключении компьютера больше нет, то остановить отсчет можно просто добавив к команде параметр –a:
Это отключит обратный отсчет.
Информация о системе — systeminfo
Как можно понять из названия, команда покажет пользователю некоторые сведения о системе и «железе» пользователя:

Но всё-таки, чтобы посмотреть параметры компьютера лучше использовать программы типа AIDA64.
Очищение экрана — cls
Позволяет очистить экран от введенных ранее команд. Вводится без параметров:
Получение информации о сетевых настройках — ipconfig
Команда без введения дополнительных параметров отобразит:
- маску подсети
- основной шлюз каждого из подключенных сетевых адаптеров.
Для получения более подробных сведений, команду вводят с параметром:
Так можно узнать MAC-адреса сетевых карт, текущие DNS сервера, состояние IP-маршрутизации и другое.
Проверка диска на ошибки — chkdsk
Предназначена для проверки логических дисков и поиск возможных ошибок. Если не были введены дополнительные параметры, на экране появится информация о состоянии диска. Также вместе с данной командой часто используются некоторые ее параметры:
- /f – исправляет найденные на диске ошибки. При этом перед началом проверки диск необходимо заблокировать. Если этого не сделать, система запросит проверку при следующем запуске.
- /v – в процессе проверки выводит на экран имя каждого проверяемого файла и каталога.
- /r – обнаруживает поврежденные сектора и восстанавливает все данные, которые могут быть восстановлены.

Форматирование диска — format
Форматирует жесткий диск или флешку. Прописывается следующим образом:
НЕ ВЫПОЛНЯЙТЕ ЭТУ КОМАНДУ, ЕСЛИ НЕ ЗНАЕТЕ ЗАЧЕМ, ИНАЧЕ МОЖЕТЕ ПОТЕРЯТЬ СВОИ ДАННЫЕ!
- /fs – определяет файловую систему форматируемого диска;
- /v – задает метку тома;
- /a – задает размер кластера. Не обязательно, т.к. система может определить размер кластера автоматически, в соответствии с размером диска.
Могут быть прописаны и другие команды, смотрите помощь. Форматировать диски в Windows 7/10 можно не только из командной строки, но и из контекстного меню диска в проводнике.
Информация о запущенных процессах — tasklist
Команда запускает утилиту, выводящую список запущенных процессов (с PID-кодами), а также предоставляет информацию о размере потребляемой оперативной памяти каждым процессом. Без дополнительных параметров утилита просто выведет список запущенных на компьютере процессов:

Завершение процессов — taskkill
где 5637 – это PID (идентификатор процесса). Также есть возможность остановить процесс с определенным именем образа, для этого нужно добавить параметр /im. Впоследствии, команда будет выглядеть так: taskkill /im notepad.exe
где на месте «notepad.exe» своё имя программы. Иногда просто лень искать программу в меню «Пуск» и тогда я просто набираю имя запускаемого файла в окне «Выполнить». Самые часто используемые мной:
С этой утилитой многие уже имели возможность познакомиться, это редактор системного реестра. С помощью него изменяются скрытые настройки операционной системы, и лезть туда без надлежащих знаний не нужно, иначе можно сломать Windows.

Конфигурация системы — msconfig
Вызовет специальную службу «Конфигурация системы».

В принципе, большинство пользователей уже сталкивались с данным окном. Чаще всего им пользуются для отключения автозапуска программ.
Проверка системных файлов — sfc
Запускает утилиту, которая восстанавливает поврежденные системные файлы. Очень полезная утилита, которую можно дополнить также некоторыми командами:
- /scannow – для немедленной проверки защищенных системных файлов;
- /scanonce – для проверки защищенных системных файлов один раз при следующем запуске системы;
- /scanboot – для проверки защищенных системных файлов при каждом запуске системы.
Если при проверке обнаружатся повреждённые или «левые» файлы, то программа попросит вставить диск с установочным дистрибутивом Windows.
И напоследок утилиты, которыми я также часто пользуюсь:
- appwiz.cpl – открывает стандартное окно «Установка и удаление программ»
- calc – встроенный в Windows «Калькулятор»
- notepad – блокнот
- pbrush – графический редактор «Paint»
- diskmgmt.msc – окно управления дисками, здесь можно разбить жёсткий диск на разделы
- services.msc – управление системными службами
В заключение
Здесь предоставлен минимальный набор команд, которые можно использовать при работе с консолью. Существует еще много полезных, или даже просто интересных команд, многие из которых пользователь может изучить самостоятельно. Для этого, достаточно просто ввести в командную строку команду «help», и она покажет доступные команды.
А для того, чтобы узнать подробную информацию о любой из них – достаточно просто ввести запрос HELP и после пробела указать название команды. Консоль отобразит всю необходимую информацию, включая синтаксис и прочие составляющие команды.
Not to be confused with Windows Terminal included in Windows 1.0 ~ 3.x/NT3.x, or its successor HyperTerminal included in Windows 95/NT4.0 ~ XP.
Terminal augments the text-based command experience by providing support for:
- Introductory post
- Terminal on GitHub
- Windows Terminal overview
Win-unicode-console
A Python package to enable Unicode input and display when running Python from Windows console.
The package is not needed on Python 3.6 and newer since the underlying issue has been resolved (see https://docs.python.org/3/whatsnew/3.6.html#whatsnew36-pep528).
General information
When running Python (3.5 and older) in the standard console on Windows, there are several problems when one tries to enter or display Unicode characters. The relevant issue is http://bugs.python.org/issue1602. This package solves some of them.
- First, when you want to display Unicode characters in Windows console, you have to select a font able to display them. Similarly, if you want to enter Unicode characters, you have to have you keyboard properly configured. This has nothing to do with Python, but is included here for completeness.
- The standard stream objects (sys.stdin, sys.stdout, sys.stderr) are not capable of reading and displaying Unicode characters in Windows console. This has nothing to do with encoding, since even sys.stdin.buffer.raw.readline() returns b”?
” when entering α and there is no encoding under which sys.stdout.buffer.raw.write displays α.The streams module provides several alternative stream objects. stdin_raw, stdout_raw, and stderr_raw are raw stream objects using WinAPI functions ReadConsoleW and WriteConsoleW to interact with Windows console through UTF-16-LE encoded bytes. The stdin_text, stdout_text, and stderr_text are standard text IO wrappers over standard buffered IO over our raw streams, and are intended to be primary replacements to sys.std* streams. Unfortunately, other wrappers around std*_text are needed (see below), so there are more stream objects in streams module.The function streams.enable installs chosen stream objects instead of the original ones. By default, it chooses appropriate stream objects itself. The function streams.disable restores the original stream objects (these are stored in sys.__std*__ attributes by Python).After replacing the stream objects, also using print with a string containing Unicode characters and displaying Unicode characters in the interactive loop works. For input, see below. - The module readline_hook provides our custom readline hook, which uses sys.stdin to get the input and is (de)activated by functions readline_hook.enable, readline_hook.disable.As we said, readline hook can be called from two places – from the REPL and from input function. In the first case the prompt is encoded using sys.stdin.encoding, but in the second case sys.stdout.encoding is used. So Python currently makes an assumption that these two encodings are equal.
- Python tokenizer, which is used when parsing the input from REPL, cannot handle UTF-16 or generally any encoding containing null bytes. Because UTF-16-LE is the encoding of Unicode used by Windows, we have to additionally wrap our text stream objects (std*_text). Thus, streams module contains also stream objects stdin_text_transcoded, stdout_text_transcoded, and stderr_text_transcoded. They basically just hide the underlying UTF-16-LE encoded buffered IO, and sets encoding to UTF-8. These transcoding wrappers are used by default by streams.enable.
- Since default Python 2 strings correspond to bytes rather than unicode, people are usually calling print with bytes argument. Therefore, sys.stdout.write and sys.stderr.write should support bytes argument. That is why we add stdout_text_str and stderr_text_str stream objects to streams module. They are used by default on Python 2.
- When we enter a Unicode literal into interactive interpreter, it gets processed by the Python tokenizer, which is bytes-based. When we enter u”α” into the interactive interpreter, the tokenizer gets essentially b’u”α”‘ plus the information that the encoding used is UTF-8. The problem is that the tokenizer uses the encoding only if sys.stdin is a file object (see https://hg.python.org/cpython/file/d356e68de236/Parser/tokenizer.c#l797). Hence, we introduce another stream object streams.stdin_text_fileobj that wraps stdin_text_transcoded and also is structurally compatible with Python file object. This object is used by default on Python 2.
- Similarly to the input from from sys.stdin the arguments in sys.argv are also bytes on Python 2 and the original ones may not be reconstructable. To overcome this we add unicode_argv module. The function unicode_argv.get_unicode_argv returns Unicode version of sys.argv obtained by WinAPI functions GetCommandLineW and CommandLineToArgvW. The function unicode_argv.enable monkeypatches sys.argv with the Unicode arguments.
Installation
Install the package from PyPI via pip install win-unicode-console (recommended), or download the archive and install it from the archive (e.g. pip install win_unicode_console-0.x.zip), or install the package manually by placing directory win_unicode_console and module run.py from the archive to the site-packages directory of your Python installation.
Usage
The top-level win_unicode_console module contains a function enable, which install various fixes offered by win_unicode_console modules, and a function disable, which restores the original environment. By default, custom stream objects are installed as well as a custom readline hook. On Python 2, raw_input and input functions are monkeypatched. sys.argv is not monkeypatched by default since unfortunately some Python 2 code strictly assumes str instances in sys.argv list. Use enable(use_unicode_argv=True) if you want the monkeypathcing. For further customization, see the sources. The logic should be clear.
- Opt-in runner. You may easily run a script with win_unicode_console enabled by using our runner module and its helper run script. To do so, execute py -i -m run script.py instead of py -i script.py for interactive mode, and similarly py -m run script.py instead of py script.py for non-interactive mode. Of course you may provide arguments to your script: py -i -m run script.py arg1 arg2. To run the bare interactive interpreter with win_unicode_console enabled, execute py -i -m run.
- Opt-out runner. In case you are using win_unicode_console as Python patch, but you want to run a particular script with win_unicode_console disabled, you can also use the runner. To do so, execute py -i -m run –init-disable script.py.
- Customized runner. To move arbitrary initialization (e.g. enabling win_unicode_console with non-default arguments) from sitecustomize to opt-in runner, move it to a separate module and use py -i -m run –init-module module script.py. That will import a module module on startup instead of enabling win_unicode_console with default arguments.
Compatibility
- colorama package (https://pypi.python.org/pypi/colorama) makes ANSI escape character sequences (for producing colored terminal text and cursor positioning) work under MS Windows. It does so by wrapping sys.stdout and sys.stderr streams. Since win_unicode_console replaces the streams in order to support Unicode, win_unicode_console.enable has to be called before colorama.init so everything works as expected.As of colorama v0.3.3, there was an early binding issue (tartley/colorama#32), so win_unicode_console.enable has to be called even before importing colorama. Note that is already the case when win_unicode_console is used as Python patch or as opt-in runner. The issue was already fixed.
- pyreadline package (https://pypi.python.org/pypi/pyreadline/2.0) implements GNU readline features on Windows. It provides its own readline hook, which actually supports Unicode input. win_unicode_console.readline_hook detects when pyreadline is active, and in that case, by default, reuses its readline hook rather than installing its own, so GNU readline features are preserved on top of our Unicode streams.
- IPython (https://pypi.python.org/pypi/ipython) can be also used with win_unicode_console.As of IPython 3.2.1, there is an early binding issue (ipython/ipython#8669), so win_unicode_console.enable has to be called even before importing IPython. That is the case when win_unicode_console is used as Python patch.There was also an issue that IPython was not compatible with the builtin function raw_input returning unicode on Python 2 (ipython/ipython#8670). If you hit this issue, you can make win_unicode_console.raw_input.raw_input return bytes by enabling it as win_unicode_console.enable(raw_input__return_unicode=False). This was fixed in IPython 4.
Backward incompatibility
- Since version 0.4, the signature of streams.enable has been changed because there are now more options for the stream objects to be used. It now accepts a keyword argument for each stdin, stdout, stderr, setting the corresponding stream. None means “do not set”, Ellipsis means “use the default value”.A function streams.enable_only was added. It works the same way as streams.enable, but the default value for each parameter is None.Functions streams.enable_reader, streams.enable_writer, and streams.enable_error_writer have been removed. Example: instead of streams.enable_reader(transcode=True) use streams.enable_only(stdin=streams.stdin_text_transcoding).There are also corresponding changes in top-level enable function.
- Since version 0.3, the custom stream objects have the standard filenos, so calling input doesn’t handle Unicode without custom readline hook.
Acknowledgements
- The code of streams module is based on the code submitted to http://bugs.python.org/issue1602.
- The idea of providing custom readline hook and the code of readline_hook module is based on https://github.com/pyreadline/pyreadline.
- The code related to unicode_argv.get_full_unicode_argv is based on http://code.activestate.com/recipes/572200/.
- The idea of using path hooks and the code related to unicode_argv.argv_setter_hook is based on https://mail.python.org/pipermail/python-list/2016-June/710183.html.
Knowing how to conduct rudimentary file management at the Command Prompt comes in useful when you’re starting to code. Any file you make from the Command Prompt persists in multiple areas of Windows—this means that generating an index or document at the prompt fixes things so that you can access, utilize, and control that catalog or record in the Windows platform.
Create File with Echo Command
The quickest way to implement this is to open the search bar by pressing Win + S, type cmd, and then select Command Prompt.
Choose the folder where you wish to save the file.
Modify filename.txt with a name according to your preference and hit Enter.
The “.txt” extension means that it’s a plain text file.
“.docx” (Word document), “.png” (empty photo), and “.rtf” (rich text document) are other popular file extensions.
All of these file formats may be viewed on any Windows system without the need for extra software.
Make a file with certain text in it.
Replace testfile with the appropriate file name in copy con testfile.txt. Hit Enter.
Press Control + Z after you’re done editing the file.
Hit the Enter key. You should notice “1 file(s) copied,” meaning your file has been saved using the name you chose.
Make a file of a specific size.
Avoid this step, if you don’t wish to deliver a document of a specific size. Utilize the accompanying order to produce a clear text document dependent on its byte size.
Replace filename with the name of your wish and 1000 with the exact number of bytes you want the document to be.
Other useful articles:
Command Line Utility Alternative to Device Manager
DEVCON is a Microsoft tool that allows “device management” from the command line.
It is available for free as part of the Windows Driver Kit (a.k.a. WDK).
Unfortunately, it is no longer available as a separate download from Microsoft’s websites.
Burn or mount the downloaded WDK ISO image, and either
- find setuptools_x64fre_cab001.cab (64-bit) or setuptools_x86fre_cab001.cab (32-bit) in the WDK folder
- use 7-Zip or similar software to extract _devcon.exe_00000
- rename _devcon.exe_00000 to devcon.exe
- move devcon.exe to a folder that is listed in your PATH
I dedicated this page to DEVCON because I became impressed by its possibilities.
It even allowed me to write scripts to backup drivers without having to search all INF files “manually”.
This had been on my wish list for a long time.
Another great feature is DEVCON’s built-in Reboot command.
Type DEVCON help command on the command line for detailed help on command or click a command in the table above to view its help page.
The table below lists some of my scripts based on DEVCON, along with the basic command line switches they use.
- Nir Sofer’s USBDeview allows you to view all installed/connected USB devices on your system.
- To eject PnP hardware devices use C’T’s DevEject.
This powerful tool can eject devices by their description, device ID or drive letter.
Как перейти в папку или на другой диск в командной строке
Работая в командной строке (CMD) все действия приходится выполнять при помощи текстовых команд и переход в другую папку не исключение. Для этого
Как перейти в папку в командной строке

Для того чтобы вернуться назад (перейти на уровень выше по дереву папок) нужно вводить команду:

Для того чтобы быстро перейти в корневый каталог текущего диска нужно выполнить:

Команду CD можно вводить как СHDIR, логика ее работы от этого не меняется.
Как перейти на другой диск
Если вам нужно перейти на другой диск, например, с диска C на диск D, то команду cd нужно выполнять с параметром /D. Например, если вам нужно перейти с диска C на диск D в папку GAMES, то вам нужно ввести команду:
cd /D d:games

Также вы можете просто ввести букву диска с двоеточием и таким образом перейти на другой диск:

Например, если вы находитесь на диске C и вам нужно перейти на диск D, то вы можете просто ввести команду «».
Как открыть командную строку сразу в нужной папке
Если вам нужно открыть командную строку в определенной папке, то это можно сделать прямо из Проводника Windows. Для этого нужно открыть данную папку в Проводнике и установить курсор в адресную строку, там где указывается путь к папке.

После этого нужно удалить путь к папке, ввести команду «» и нажать на клавишу ввода.

В результате откроется командная строка. При этом в качестве текущей папки уже будет выбранна та папка, из которой вы запускали «».

Таким образом из папки можно запускать не только командную строку, но и другие консоли. Например, PowerShell или bash, если у вас установлен WSL. Данный способ работает в Windows 10 и Windows 11.
Создатель сайта comp-security.net, автор более 2000 статей о ремонте компьютеров, работе с программами, настройке операционных систем.
Задайте вопрос в комментариях под статьей или на странице
«Задать вопрос»
и вы обязательно получите ответ.
Although Windows is the most widely used and most popular operating system for desktops and laptops, it is not as secure and open-sourced as Linux OS. That’s is why a lot of software developers and professionals prefer Linux OS.
You can access various Linux commands and software from the Linux terminal in Windows 10. In this article, we’ll give you step-by-step instructions on how to install and run the Linux terminal on Windows 10 OS.
Enable Windows Subsystem for Linux (WSL) and Install Ubuntu in Windows 10
If you intend to run a Linux terminal on Windows 10, you must first turn on the ‘Windows Subsystem for Linux’ feature. Then you can download and install your choice of Linux distribution.
The Windows Subsystem for Linux (WSL) is a feature that creates a GNU/Linux environment that allows you to run core Linux command-line tools and services directly on Windows, alongside your desktop and modern store apps.
By enabling Windows 10’s Linux subsystem, you can install and run various Linux distributions (distros) such as Ubuntu, OpenSuse, SUSE Linux, Fedora, etc.
First, Check your Windows Version
But before we get into how to enable Windows Subsystem for Linux (WSL) and install Linux, you need to check if you are running a compatible version of Windows 10. WSL is only supported on both Windows 10 64-bit (from version 1607) and Windows Server 2019.
To check your Windows version and build, go to ‘Settings’ from Windows Start menu.

Next, click ‘System’ setting.

Then, scroll down and select ‘About’ option at the bottom of the left pane to view About section.


There are two different types of WSL versions: WSL 1 and WSL 2. While they both provide smooth and continuous integration of Linux within Windows, WSL 2 is the latest and fastest version with supports full Linux kernel and system call compatibility. WSL 1 runs a translation layer which bridges the gap between Linux kernal and Windows.
- To run WSL 2, you must be running Windows 10 x64 bit systems: Version 1903 or higher, with Build 18362 or higher.
- To run WSL 1, you will need Windows 10 x64 bit systems: Version 1709 or higher, with Build 16215 or higher.
It doesn’t matter which version of WSL you want to run you must enable it first to use it. To do this, start type typing ‘Turn Windows features on and off’ into the Start Menu search field.

Select ‘Turn Windows features on and off’ control panel from the search result.

Then, scroll down to ‘Windows Subsystem for Linux’, tick the box in front of it, and click the ‘OK’ button.

Once the changes are applied, click ‘Restart now’ to restart your computer

If you want to only install WSL 1, you can now restart your computer and install your Linux distro.
Enable WSL 1 via PowerShell
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Enable WSL 2
We recommend you upgrade your WSL to version 2 for faster performance speed, and to run a real Linux kernel directly on Windows 10. All you need to do is enable the ‘Virtual Machine Platform’ feature in addition to the ‘Windows Subsystem for Linux’ feature on the Windows features control panel (see below).

Wait for the changes to be applied, then restart your computer.
Enable WSL 2 via PowerShell
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Set WSL 2 as the Default Version
Before setting up WSL 2 as your default version for all Linux distributions, download the WSL Linux kernel package update for x64 systems.
Run the .msi installer downloaded and install it. It will take only seconds.


Then restart your system to switch the feature from WSL 1 to WSL 2.
Install your Linux distribution of choice
WSL is enabled, now we will install a Linux distribution. First, search for ‘Microsoft Store’ in the Start Menu search field. Then, open it from the search result.

You’ll see a list of every Linux distributions currently available in the Windows Store which are supported by WSL.
- Ubuntu 16.04 LTS
- Ubuntu 18.04 LTS
- Ubuntu 20.04 LTS
- openSUSE Leap 15.1
- SUSE Linux Enterprise Server 12 SP5
- SUSE Linux Enterprise Server 15 SP1
- Kali Linux
- Debian GNU/Linux
- Fedora Remix for WSL
- Pengwin
- Pengwin Enterprise
- Alpine WSL
All of theses distributions are available for free. For our tutorial, we’ll select ‘Ubuntu’.

From the Ubuntu distribution’s page, Click the ‘Get’ button.

Now, Ubuntu distribution will be downloaded and installed automatically on your computer.

Once the installation finished, click the ‘Launch’ button to launch the terminal. You can also launch the app from the Windows Start Menu.


Once, the set up finished, it will take you to the bash command line. It’s better to update the software right away. In Ubuntu, you can search for, download, and install software updates, all from the apt command.
sudo apt update
This ‘update’ command will update the Ubuntu repositories.

Ubuntu will download a series of package lists.

sudo apt upgrade
Enter ‘Y’ at the prompt to continue the installation.

The ‘dist-upgrade’ command upgrade packages to their latest versions.
Upgrade WSL1 to WSL 2 for Ubuntu
If you wish to upgrade the existing WSL 1 version to WSL 2 for a specific distribution. Then, run the below command in PowerShell.

Now, you can access Linux commands and software on a Windows 10 system using this Ubuntu Environment.
Bash shell on Windows 10
You now have a full command-line ‘bash’ shell on your system based on the Linux distribution. You can access all the Linux commands and applications via that bash shell.
To run bash shell, type ‘bash’ into the Start Menu search field and click to open the bash command-line tool.

Now, you can start running commands there.

Enjoy Linux on Windows!



