Questions tagged [unix-philosophy]

49 questions
72
votes
12 answers

What's the philosophy behind delaying writing data to disk?

In Linux, a finished execution of a command such as cp or dd doesn't mean that the data has been written to the device. One has to, for example, call sync, or invoke the "Safely Remove" or "Eject" function on the drive. What's the philosophy behind…
marmistrz
  • 2,732
  • 4
  • 23
  • 30
71
votes
1 answer

Why a "login" shell over a "non-login" shell?

I have a basic understanding of dotfiles in *nix system. But I am still quite confused about this Difference between Login Shell and Non-Login Shell? A bunch of different answers (including multiple duplicates) have already addressed the following…
Allen
  • 925
  • 1
  • 7
  • 8
66
votes
3 answers

Why is Unix 'self-supporting'?

I was reading Ritchie and Thompson's paper about the Unix file system. They write, 'It is worth noting that the system is totally self-supporting'. Were the systems before Unix not self-supporting? In what ways?
aupreti
  • 669
  • 1
  • 5
  • 6
54
votes
3 answers

A layman's explanation for "Everything is a file" — what differs from Windows?

I know that "Everything is a file" means that even devices have their filename and path in Unix and Unix-like systems, and that this allows for common tools to be used on a variety of resources regardless of their nature. But I can't contrast that…
Mohamed Ahmed
  • 1,363
  • 6
  • 17
  • 23
32
votes
2 answers

Why is sort -o useful?

UNIX philosophy says: do one thing and do it well. Make programs that handle text, because that is a universal interface. The sort command, at least GNU sort, has an -o option to output to a file instead of stdout. Why is, say, sort foobar -o…
strugee
  • 14,723
  • 17
  • 73
  • 119
26
votes
4 answers

Are Unix Internet sockets files?

I understand that "Everything is a file" is one of the major concepts of Unix, but sockets use different APIs that are provided by the kernel (like socket, sendto, recv, etc.), not like normal file system interfaces. How does this "Everything is a…
user3718463
  • 725
  • 6
  • 9
26
votes
4 answers

Is it correct to use certain special characters when naming filenames in Linux?

Is it correct to use certain special characters, as +, &, ', . (dot) and , (comma), basically, in filenames. I understand that you can use - and _ with no problem, but doing some research I have been unable to find something definite about the…
Chris Klein
  • 261
  • 1
  • 3
  • 3
21
votes
2 answers

What makes an operating system "Unix-Like"?

I frequently come across the term "unix-like" on many web sites. There is no standard; it is just in the way it behaves. But if I were to develop a kernel from scratch, what would make it considered "unix-like"? Basically, what are the things that…
13
votes
2 answers

Why is the primary admin UID 501?

I understand* the primary admin user is given a user ID of 501 and subsequent users get incremental numbers (502, 503, …). But why 501? What’s special about 50x, what’s the historical/technical reason for this choice? * I started looking into this…
user137369
  • 477
  • 2
  • 4
  • 13
13
votes
2 answers

Should I output program's name when warning or error occurs?

If I'm writing a script or a program, should I output to stderr its name together with warning or error message? For example: ./script.sh: Warning! Variable "var" lowered down to 10. or: ./prog.py: Error! No such file: "file.cfg". I understand…
gsarret
  • 143
  • 5
10
votes
3 answers

What is the practical purpose of "./" in front of relative file paths (in the output from "find")?

Why are some relative file paths displayed in the form of ./file, instead of just file? For example, when I do: find . I get this output: ./file1 ./file2 ./file3 What is the practical purpose, other than making the path more confusing? It's not…
400 the Cat
  • 819
  • 4
  • 37
  • 85
10
votes
2 answers

How could one determine UID/GID of running process

Is there any way to retrieve UID/GID of running process? Currently, I know only way of looking it up in htop. But I don't want to depend on third-party tool, prefer to use builtin unix commands. Could you suggest a few useful oneliners? This didn't…
Bulat M.
  • 397
  • 2
  • 5
  • 14
10
votes
1 answer

What does Unix programming mean, exactly?

I thought I understood what the term Unix programming meant, but now, after reading about it in a kernel/C programming context, I feel like I need to clarify the meaning of this term. It is not clear to me if it means: Shell programming, Unix…
Brandt
  • 282
  • 1
  • 2
  • 10
8
votes
1 answer

Why index files?

I installed Linux on something like 3 or 4 different machines last year, and in two cases, I had a serious urge to vomit after noting that file indexers such as virtuoso (Debian testing with the latest KDE) and libtracker-miner were installed by…
ixtmixilix
  • 13,040
  • 27
  • 82
  • 118
7
votes
2 answers

Has the Unix Philosophy been abandoned in web application design?

The Unix Philosophy encourages the use of small, generically reusable cooperating programs that collaborate with forms of inter-process communication like pipes, fifos, sockets, as opposed to shared memory space and linkage. The programs MH and uzbl…
dan
  • 4,007
  • 5
  • 26
  • 34
1
2 3 4