Hot answers tagged

344 votes
Accepted

Why does Linux use LF as the newline character?

Windows uses CRLF because it inherited it from MS-DOS. MS-DOS uses CRLF because it was inspired by CP/M which was already using CRLF. CP/M and many operating systems from the eighties and earlier ...
jlliagre's user avatar
  • 60.4k
167 votes

If Linux is only a kernel, then how were its first versions used (without distribution)?

In the early stages of Linux, Linus Torvalds released the Linux kernel source in an alpha state to signal to others that work towards a new Unix-like kernel was in development. By that time, as @...
Rui F Ribeiro's user avatar
139 votes
Accepted

Why can't Linux usernames begin with numbers?

Some commands (eg chown) can accept either a username or a numeric user ID, so allowing all-numeric usernames would break that. A rule to allow names that start with a number and contain some alpha ...
thomas_d_j's user avatar
  • 1,481
104 votes
Accepted

Why is rm allowed to delete a file under ownership of a different user?

The reason why this is permitted is related to what removing a file actually does. Conceptually, rm's job is to remove a name entry from a directory. The fact that the file may then become unreachable ...
Celada's user avatar
  • 43.3k
102 votes

On what systems is //foo/bar different from /foo/bar?

This is a compilation and index of the answers given so far. This post is community wiki, it can be edited by anybody with 100+ reputation and nobody gets reputation from it. Feel free to post your ...
100 votes
Accepted

Why is Unix 'self-supporting'?

The question in your title is addressed immediately after your quote in the paper: All Unix software is maintained on the system; likewise, this paper and all other documents in this issue were ...
Stephen Kitt's user avatar
99 votes
Accepted

What does the letter 'u' mean in /dev/urandom?

Unlimited. In Linux, comparing the kernel functions named random_read and random_read_unlimited indicates that the etymology of the letter u in urandom isunlimited. This is confirmed by line 114: ...
Tom Hale's user avatar
  • 28.8k
94 votes

What did the sticky bit originally do when applied to files?

No, the sticky bit was not like the set-UID or set-GID flags. It didn't effect any changes to process credentials. What the sticky bit did was make the program text "sticky". It wasn't a ...
JdeBP's user avatar
  • 67.1k
84 votes
Accepted

Is there any reason to have a shebang pointing at /bin/sh rather than /bin/bash?

There are systems not shipping bash by default (e.g. FreeBSD). Even if bash is installed, it might not be located in /bin. Most simple scripts don't require bash. Using the POSIX shell is more ...
Marco's user avatar
  • 33.2k
83 votes
Accepted

Patching a binary with dd

Let's try it. Here's a trivial C program: #include <stdio.h> int main(int argc, char **argv) { puts("/usr/tmp"); } We'll build that into test: $ cc -o test test.c If we run it, it prints ...
Michael Homer's user avatar
83 votes

Why can't Linux usernames begin with numbers?

here is a test on ubuntu 14.04 using numbers: root@ubuntu:~# useradd 232 root@ubuntu:~# mkdir /home/232 root@ubuntu:~# chown 232.232 /home/232 root@ubuntu:~# passwd 232 Enter new UNIX password: ...
adonis's user avatar
  • 1,714
69 votes

Intended use of ctrl+T in bash?

It's very useful to quickly fix typos: sl becomes ls with a single CtrlT. You can use AltT to swap words too (e.g. when switching between service and systemctl...). Historically speaking, the ...
Stephen Kitt's user avatar
66 votes
Accepted

Why are UNIX/POSIX system call namings so illegible?

It's due to the technical constraints of the time. The POSIX standard was created in the 1980s and referred to UNIX, which was born in the 1970. Several C compilers at that time were limited to ...
dr_'s user avatar
  • 28.8k
62 votes

What's this I hear about First Edition Unix being restored?

In 2008–2009 The Unix Heritage Society managed to reconstruct the source for First Edition Unix kernel and parts of the shell from various sources, including magnetic tapes and paper documents. ...
JdeBP's user avatar
  • 67.1k
60 votes
Accepted

Why is the Intel HD Graphics driver called i915?

Well, that P4 chipset is the reason for the driver name. Starting with i810, Intel outsourced the driver to Tungsten Graphics, but commissioned it as an open source one for Linux. The first 915 ...
don_crissti's user avatar
  • 79.6k
60 votes
Accepted

When did Unix stop storing passwords in clear text?

For the early history of Unix password storage, read Robert Morris and Ken Thompson's Password Security: A Case History. They explain why and how early Unix systems acquired most the features that are ...
Gilles 'SO- stop being evil''s user avatar
57 votes
Accepted

Why is there a Linux kernel policy to never break user space?

The reason is not a historical one but a practical one. There are many many many programs that run on top of the Linux kernel; if a kernel interface breaks those programs then everybody would need to ...
Gilles 'SO- stop being evil''s user avatar
56 votes
Accepted

Why was `cp` designed to silently overwrite existing files?

The default overwrite behavior of cp is specified in POSIX. If source_file is of type regular file, the following steps shall be taken: 3.a. The behavior is unspecified if dest_file exists ...
telcoM's user avatar
  • 88.3k
55 votes
Accepted

How do pipelines limit memory usage?

The data doesn’t need to be stored in RAM. Pipes block their writers if the readers aren’t there or can’t keep up; under Linux (and most other implementations, I imagine) there’s some buffering but ...
Stephen Kitt's user avatar
53 votes

Does vi silently add a newline (LF) at the end of file?

POSIX requires this behavior, so it's not in any way unusual. From the POSIX vi manual: INPUT FILES See the INPUT FILES section of the ex command for a description of the input files supported by the ...
Barefoot IO's user avatar
  • 1,906
52 votes
Accepted

Why don't man pages have examples?

That depends on the man pages... Traditionally, they have included a section with examples - but for some reason that is usually missing from the man pages under Linux (and I assume other using GNU ...
Baard Kopperud's user avatar
52 votes

How did Linux/xBSD boot before GRUB?

The first Linux distribution I used back in the 90s (Slackware 3.0 IIRC) used LILO as a bootloader. And many distros used LILO for years even when GRUB was becoming the "default" bootloader. Moreover,...
Daniele Santi's user avatar
49 votes
Accepted

Is there a reason why the first element of a Zsh array is indexed by 1 instead of 0?

Virtually all shell arrays (Bourne, csh, tcsh, fish, rc, es, yash) start at 1. ksh is the only exception that I know (bash just copied ksh). Most interpreted languages at the time (early 90s): awk, ...
Stéphane Chazelas's user avatar
47 votes
Accepted

What is the point of mv -f when default behavior already overwrites files?

The usage of -f is more clearly described in the man page from 4BSD, which was where the -f and -i options were added: If file2 already exists, it is removed before file1 is moved. If file2 has a ...
Mark Plotnick's user avatar
47 votes

Why is cp's option not to overwrite files called --no-clobber?

“Clobber” in the context of data manipulation means destroying data by overwriting it. In the context of files in a Unix environment, the word was used at least as far back as the early 1980s, ...
Gilles 'SO- stop being evil''s user avatar
42 votes
Accepted

What do the large computers that real terminals were connected to look like?

That terminal would typically be connected to a PDP-11, or a VAX-11 (it can be used with many, many different types of computers though!). The PDP-11, like many mini-computers, was often housed in a ...
Stephen Kitt's user avatar
40 votes
Accepted

What does "on-line" mean, as used in man(1)?

In contrast to a printed (hard-copy) manual, which you could read off-line (while not using a computer). The term dates back (at least) to time-sharing systems. Users may have had a terminal which ...
Thomas Dickey's user avatar
36 votes

Is the shell ksh93 dead?

It is not possible to give a real answer to this question, but the form of a comment is not sufficient. So I think it may be a good idea to collect points to a editable answer... Two years ago, David ...
schily's user avatar
  • 18.8k
36 votes

How do pipelines limit memory usage?

But I don't understand how this could limit memory usage considering the fact that the data has to be stored in RAM to transmit between programs. This is your fundamental error. Early versions of ...
JdeBP's user avatar
  • 67.1k

Only top scored, non community-wiki answers of a minimum length are eligible