this post was submitted on 30 Mar 2025
32 points (90.0% liked)

Linux

52687 readers
670 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

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

Response to a recent claim that Ctrl+D in the terminal is like pressing Enter. It kind of is but it’s also misleading to say so without further explanation.

you are viewing a single comment's thread
view the rest of the comments
[–] pmk@lemmy.sdf.org 7 points 2 days ago (3 children)

Isn't ctrl-m the "enter" equivalent?

[–] mina86@lemmy.wtf 8 points 2 days ago (1 children)

Yes. So is Ctrl+J actually. Ctrl+J corresponds to line feed (LF) and Ctrl+M corresponds to carriage return (CR) ASCII characters. They are typically treated the same way.

[–] pmk@lemmy.sdf.org 7 points 2 days ago* (last edited 2 days ago) (1 children)

Found it in the classic The UNIX Programming Environment from 1984:

But then, this is for return, which technically isn't "enter", but nowadays they are sort of interpreted the same by programs?

[–] mina86@lemmy.wtf 4 points 2 days ago* (last edited 2 days ago)

Yeah, it’s a bit philosophical.

  • In graphical applications, Ctrl+M, Ctrl+J and Return/Enter are all different things.
  • In a terminal in raw mode, Ctrl+M and Return/Enter are the same thing but Ctrl+J is something different. You can for example run bind -x '"\C-j":"echo a"' in bash and Ctrl+J will do something different.
  • In a terminal in canonical mode, they are all the same thing. There probably are some stty options which can change that though.
load more comments (1 replies)