How to get the current terminal name?

tty

Now I have to enter 30 characters where 3 would have been enough... :-)


Re: "You could simply explain what that command, is, what it does and what else you can do with it and whoooosh, it would be a better answer. – Bobby"

The Unix name of the current terminal (or console, as we oldsters use to sometimes also call it) is: /dev/tty which, can be used to easily create a new multi-line file from the command prompt thusly: cp /dev/tty README.md (hitting then puts the cursor on a new blank line where you can enter text, hit return again, enter a second line, etcetera. When finished entering lines, do a control-d which causes the cp command to exit and you will have made a multi-line file with a single command).

Tags:

Terminal

Bash