this post was submitted on 20 Mar 2025
38 points (75.7% liked)
Linux
52213 readers
626 users here now
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
CTRL+M is like pressing ENTER. Kernigan & Pike, 1984: UNIX Programming Enviornment
This reminds me of a time at work when I was not on a reasonable terminal. I was explaining to a co-worker how I automated some tasks by running some scripts, but in my demo my RETURN key didn't work, so I had to improvise and use CTRL+M which worked, hahaha. I don't know how the terminal got in such a bad spot but it was probably something to do with msys on Windows.. honestly not sure. It was perfect timing to have happen while teaching of course ;)
I would also be doing a disservice not to share what the book you linked says about CTRL+D. Right after your quote, it says:
This is pretty good for an introduction, but it is not the full story. It explains CTRL+D properly later (chapter 2, page 45):
This is why the article says it's "like pressing enter," because it flushes the input just like enter. The difference is that enter sends a newline, but CTRL+D does not, so you can exploit that to send no data (and the program chooses to interpret that as an EOF).
Yes, although
Ctrl-M
would be the "Carriage Return" character (\r
). For the "Line Feed" newline character (\n
) the Control combination would beCtrl-J
. Both of them would normally produce a new line when you press them on most terminals.That's why if you open in nano/vim a file with Windows style EOL (
/r/n
), you might see a strange^M
symbol at the end of each line.