As a developer or an administrator, you often use the Windows Console. Before Windows 10 and Windows Server 2016, it was a pain. The main burden was the 80 columns limitation. But Microsoft has finally decided to make some improvements. The major improvement is the console now support more than 80 columns and common shortcuts such asCtrl+C and Ctrl+V. Here's are some tips to help you using the console.
You often want to open a console in a specific directory. Instead of using the
cd command, you can open it from the explorer. Simply enter
cmd in the search bar and press enter. You can focus the search bar by pressing CTRL+L.
Of course, you can replace
pwsh (PowerShell Core) or
wt (Windows Terminal) 😉
You can change the transparency of the console using Ctrl+Shift+Mouse wheel orCtrl+Shift++ and Ctrl+Shift+-. This allows to view the window behind.
If you are only using the console, such as on Windows Server Core, you can show the console in full screen using F11 or Alt+Enter. This will make your Windows looks like Linux 😃
It's nice to avoid typing a command twice. The console keeps an history of all the executed commands, so you can reuse them latter. Navigating using up and down is not so useful as you don't always know which is the previous command. The console has an awesome UI for showing previous commands 😃 You can show it using F7
Sometimes you need to search in the output of a command. Of course you can read the whole output and find what you are looking for. But, if the output is very long, you'll spend long minutes. As in many applications, you can find text using Ctrl+F.
You can use the
clip command to redirect the command output from the command line to the Windows clipboard:
echo toto | clip
You can also copy the content of a file to the clipboard:
clip < file.txt
dir | wsl grep ts
wsl ls | find /i "ts"
Do you have a question or a suggestion about this post? Contact me on Twitter or by email!