Help me make my windows cmd.exe console work more like a Linux terminal
I personally use Console2 with the Bash shipped with MYSYS-Git. You can also use PuTTY and SSH to a real linux box 😉
I personally use Console2 with the Bash shipped with MYSYS-Git. You can also use PuTTY and SSH to a real linux box 😉
the simplest one-command solution is to use Powershell Get-Content. N – number of lines. From the begining of file: Get-Content -Head N file.txt From the end of file: Get-Content -Tail N file.txt
You can find the newer of two files with one line of batch script. Just list the files in date order, oldest first, which means the last file listed must be the newer file. So if you save the file name each time, the last name put in your variable will be the newest file. … Read more
The set command does not take spaces. The proper syntax would be: set tt=name What you have done in your example is set an environment variable tt<space>. With that in mind, you can try this: echo %tt % and see your output.
All credit goes to PetSerAl, this had to be posted as an aswer: (dir 2>&1 *`|echo CMD);&<# rem #>echo PowerShell Within Win32-OpenSSH this command also works, and outputs CMD. NB : Win32-OpenSSH seems a bit limited, cd is not recognized on my system.
You can create directly multiline strings with the caret (one empty line is required). setlocal EnableDelayedExpansion set multiLine=This is a ^ multiline text^ line3 echo !multiLine! Or you can create first a newline character. setlocal EnableDelayedExpansion set LF=^ rem Two empty lines are required set multiLine=This is a!LF!multiline text!LF!line3 echo !multiLine! An explanation how this … Read more
The help for start contains this tidbit: START [“title”] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B] [command/program] [parameters] “title” Title to display in window title bar. In other words the first quoted string will … Read more
2019 Update: Microsoft has released the terminal app on Github & the Windows Store, and it has tabs, panels, acrylic transparency, and other features. 2016 Update: Windows 10’s default conhost UI has more features, including free resize, transparency, etc (this includes cmd & powershell) I now use ConEmu (walkthrough here) which has many features including … Read more
Use the command start with switch /min to start cmd in minimized window: start /min cmd /c “full path to my batch file”
You are not the first, who fell into the famous “delayed expansion trap” (and you won’t be the last). You need delayed expansion if you want to use a variable, that you changed in the same block (a block is a series of commands within parentheses (and )). Delayed variables are referenced with !var! instead … Read more