Hot answers tagged

343

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 used CRLF because it was the way to end a line printed on a teletype (return to the beginning of the line and jump to the next line, just like regular typewriters)...


247

Apt started its life around 1997 and entered Debian officially around 1999. During its early days, Jason Gunthorpe was its main maintainer/developer. Well, apparently Jason liked cows. I don't know if he still does. :-) Anyway, I think the apt-get moo thing was added by him as a joke. The corresponding aptitude easter eggs (see below) were added later by ...


222

For distributing archives over the Internet, the following things are generally a priority: Compression ratio (i.e., how small the compressor makes the data); Decompression time (CPU requirements); Decompression memory requirements; and Compatibility (how wide-spread the decompression program is) Compression memory & CPU requirements aren't very ...


167

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 @RalfFriedi stated, the Linux kernel was cross-compiled in Minix. As for usable software, Linus Torvalds also ported utilities to distribute along with the Linux ...


137

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 was probably considered not worth the effort; instead there is just a requirement to start with an alpha character. Edit: It appears from the other responses ...


110

The forward slash / is the delimiting character which separates directories in paths in Unix-like operating systems. This character seems to have been chosen sometime in the 1970's, and according to anecdotal sources, the reasons might be related to that the predecessor to Unix, the Multics operating system, used the > character as path separator, but the ...


103

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 if that was the file's only name and that the inode and space occupied by the file can therefore be recovered at that point is almost incidental. The name of ...


100

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 generated and formatted by the Unix editor and text formatting programs. So “self-supporting” means that once a Unix system is setup, it is self-sufficient, and ...


99

A socket is a pseudo-file that represents a network connection. Once a socket has been created (identifying the other host and port), writes to that socket are turned into network packets that get sent out, and data received from the network can be read from the socket. Sockets are similar to pipes. Both look like files to the programs using them. Both ...


98

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 own answer and add a link to it in here (or wait for me to do it). Ideally, this answer should just be a summary (with short entries while individual other ...


96

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: The /dev/urandom device does not have this limit [...] Update: Regarding which came first for Linux, /dev/random or /dev/urandom, @Stéphane Chazelas gave ...


93

I always assumed that this feature derived from cowsay & cowthink. See the Wikipedia article on Cowsay. I've been using these for years on Fedora (I believe they predate 1999) and were used as a way to display fortunes in a more interesting way. $ fortune | cowsay ________________________________________ / It doesn't matter what you do, it only \ | ...


91

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 misnomer, originally. background: program image sections and shared text In essence, without getting too deep into the details of executable file formats (which can, ...


85

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 portable and the scripts will run on a greater variety of systems.


81

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: Retype new UNIX password: passwd: password updated successfully root@ubuntu:~# login c2 login: 232 Password: Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 4.4.0-22-...


79

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 "/usr/tmp". Let's find out where "/usr/tmp" is in the binary: $ strings -t d test | grep /usr/tmp 1460 /usr/tmp -t d prints the offset in decimal into the ...


67

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 CtrlT feature came to Bash from Emacs in all likelihood. It probably was copied to Emacs from some other editor; it was present in Stanford's E editor (see ...


62

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 identifiers that were 6 or 8 characters long, so that settled the standard for the length of variable and function names. Related questions: Why is 'umount&#...


62

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. The details were written up and presented at a USENIX conference in 2009. Warren Toomey (2009). "The Restoration of Early UNIX Artifacts". Proceedings of ...


60

Hit CTRL-U (kill line - this saves the line in the shell's kill-ring), do what you need to do, then at the new prompt, hit CTRL-Y (yank from kill-ring) to get back the original command. Alternatively, and this is particularly useful if you are in a nested command, such as a while or for loop, hit CTRL-C, which adds the command to history without executing ...


60

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 still seen today as the important features of password storage (but done better). The first Unix systems stored passwords in plaintext. Unix Third Edition ...


59

The first hierarchical file system as we know it today was designed for Multics. The design is described in “A General-Purpose File System For Secondary Storage” by R.C. Daley and P.G. Neumann. A salient characteristic of this filesystem is that a directory is a file which can be contained in a directory like any other file. The file structure forms a tree, ...


59

Indeed, the original purpose of a signal was to kill the target process. kill appeared in Unix 3rd Edition; at the time, it was reserved to root and the process was forcibly killed (like SIGKILL today) and left a core dump. Unix 4th edition added a signal number argument, as well as the companion signal system call to set a signal handler. At the time, all ...


56

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 and was written by a previous step. Otherwise, if dest_file exists, the following steps shall be taken: 3.a.i. If the -i option is in effect, the cp ...


52

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 vi command. Following the trail to the POSIX ex manual: INPUT FILES Input files shall be text files or files that would be text files except for an ...


52

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, in the early years of Linux it was common to boot Linux from another OS (i.e. DOS or Windows) instead of relying on a bootloader/dual booting. For example ...


51

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 commands - which are most these days). On for example Solaris on the other hand, almost every man page include the Example section, often with several examples. ...


50

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 upgrade those programs. Now it's true that most programs do not in fact depend on kernel interfaces directly (the system calls), but only on interfaces of the C ...


50

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 that’s not required. As mentioned by mtraceur and JdeBP (see the latter’s answer), early versions of Unix buffered pipes to disk, and this is how they helped ...


49

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 chipset was released in June 2004 and soon after1, a driver for this chipset was added to the linux kernel (see also 2.6.9-rc2 changelog). The driver name was, you ...


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