Sunday, December 11, 2022

Urban Legend

When I was talking about Windows 11 and the terminal, I remembered a story from a Urban Legend board on a certain huge message board (it was 2, not 5 lol). There, it was said that the reason why you can't create a folder or file named PRN in Windows was because Bill Gates didn't like this word, or because it was the initials of someone who used to bully him (;-s).
I think anyone who was a Unix and MS-DOS user (Linux did not exist at that time) knows this, but I would like to write it down as a reminder because I think there are not so many engineers from that era anymore.
The following commands, which are commonly used in Unix (again, Linux did not exist yet in the MS-DOS era) scripts,

$ (various commands) > /dev/null
$ (various commands) > /dev/null

This means that the text information output by the command is not shown on the screen. The reason why you need to do is that sometimes the output of scripts became so huge, and you cannot see the critical message, you can omit the unnecessry output. Since MS-DOS mimics Unix a little bit (:-), you can use the same command in MS-DOS

C:\> (some commands) > NUL
C:\> (some commands) > NUL

The difference from Unix is that NUL is a reserved word, not a device.
Next, the following command on Unix,

$ tty
/dev/pts/0
$ echo "Hello World" > /dev/pts/0
$ tty
/dev/pts/0
$ echo "Hello World" > /dev/pts/0

The tty command outputs the name of the screen you are using (the name depending on your environment). The second command outputs text directly to the screen, which is what the second command means. If you have a Linux environment, try to open two terminals and write on each terminal name. It will be a simple chat (:-). Of course, since this is a standard OS device file, the contents of the /dev/pts/* file will not become "Hello World" (lol). The same function works if a printer is connected.
Similarly, in MS-DOS, the reserved word for the connected printer was PRN, so you can use

C:\> type autoexec.bat > PRN
C:\> type autoexec.bat > PRN

would print to the printer. Of course, this was only if there was a printer directly connected to the serial port of the PC. Incidentally, I remember that I used to run this command to check the contents of autoexec.bat, which was launched at the beginning of the OS, when my computer was acting strangely (:-).
I don't think anyone executes such commands nowadays, but I feel a long history in that NUL and PRN have been inherited by the current Windows as reserved words to maintain compatibility of such functions of MS-DOS (:-o).

Labels: , ,

Sunday, December 4, 2022

Windows11 Terminal

I bought a mini PC called MINISFORUM and became a Windows 11 user, and I noticed the existence of Windows Terminal, which is very useful. I used to use WinKey + r + app name or Wikey + r + cmd to use the command line. Maybe it's because I was originally an MS-DOS user (:-o). The days seem like a long time ago when MS-DOS would first start up and then I would type win to start up Windows before Windows 3.1 (:-). However, as for MicroSoft, it may be that they are still drawn to the compatibility with MS-DOS (:-s). I don't know the details of whether Windows Terminal was added only with Windows 11, or whether it existed before, but I guess Windows finally decided to get rid of the fossil-like cmd application.
However, the settings for using the terminal are in a strange place, so I feel that it is still undergoing a fearful change.
In Windows SettingsPrivacy and SecurityFor Developers, I found a setting for Terminal. It seems that if you set it here, you can use the terminal instead of the console (cmd).

Windows Terminal Settings

The good thing about the terminal is that you can use a number of windows in tabs, and above all, you can copy and paste by CTRL+c and CTRL+v after selecting a range as usual. Of course, the previously executed command can be selected with the up/down cursor keys (this may have been possible before). In the days when there was no terminal, many people used Teraterm to access Linux and other applications, but I think this is sufficient if you have a terminal (jsut personal opinion, lol). From now on, in Windows 11, you can use WinKey + r followed by

ssh [Cloud Computer Name]
ssh [Cloud Computer Name]

to connect to the Cloud Computer. That is wonderful , simple and rapid operation with the function of copy & paste!

Labels: , , ,