We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

1064

Quoting Wikipedia: On Unix-like operating systems (including BSD, GNU/Linux and Mac OS X), tilde often indicates the current user's home directory: for example, if the current user's home directory is /home/bloggsj, then cd, cd ~, cd /home/bloggsj or cd $HOME are equivalent. This practice derives from the Lear-Siegler ADM-3A terminal in common use ...


370

Here is all you never thought you would ever not want to know about it: Summary To get the pathname of an executable in a Bourne-like shell script (there are a few caveats; see below): ls=$(command -v ls) To find out if a given command exists: if command -v given-command > /dev/null 2>&1; then echo given-command is available else echo ...


335

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)...


216

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 ...


198

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 ...


161

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 ...


155

The Home key was also used for the tilde character on old terminals. See here for more details.


136

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 ...


109

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 ...


100

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 ...


98

hash is a bash built-in command. The hash table is a feature of bash that prevents it from having to search $PATH every time you type a command by caching the results in memory. The table gets cleared on events that obviously invalidate the results (such as modifying $PATH) The hash command is just how you interact with that system (for whichever reason ...


96

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 ...


93

It appears that you are confusing two very different parts of the OS. It's understandable, because they are often referred to interchangably, but it's technically incorrect, so your question is based on a faulty premise. In order to fully explore and hopefully answer the question that you likely want to ask, a short history lesson is needed. First, there ...


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, ...


90

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 ...


87

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 ...


84

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.


82

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 \ | ...


82

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-...


73

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 ...


65

In the simplest terms, a socket is a pseudo-file that represents a network connection. Once a socket has been created (using the proper primitives, and the proper parameters to identify the other host), writes to the socket are turned into network packets that get sent out, and data received from the network can be read from the socket. In one regard, ...


63

GNU Info was designed to offer documentation that was comprehensive, hyperlinked, and possible to output to multiple formats. Man pages were available, and they were great at providing printed output. However, they were designed such that each man page had a reasonably small set of content. A man page might have the discussion on a single C function such ...


63

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

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 ...


61

In The Art of Unix Programming Eric Steven Raymond describes how this practice evolved: In the original Unix tradition, command-line options are single letters preceded by a single hyphen... The original Unix style evolved on slow ASR-33 teletypes that made terseness a virtue; thus the single-letter options. Holding down the shift key required actual effort;...


61

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&#...


61

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 ...


57

I think it stands for "diagnostic messages", as per the older1 man page (referenced here too). dmesg - system diagnostic messages Dmesg looks in a system buffer for recent kernel diagnostic messages and reproduces them on the standard output One of the oldest references appears to be a man page revision by Kirk McKusick dating back from 1985. 1: the ...


56

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, ...


55

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 ...


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