This commit is contained in:
Miloslav Ciz 2025-03-02 21:01:56 +01:00
parent 2b011199db
commit 638265b6fe
10 changed files with 1962 additions and 1929 deletions

View file

@ -1,6 +1,6 @@
# ASCII
ASCII ([American](usa.md) standard code for information interchange) is a relatively simple standard for digital encoding of [text](text.md) that's one of the most basic and probably the most common format used for this purpose. For its simplicity and inability to represent characters of less common alphabets it is nowadays quite often replaced with more complex encodings such as [UTF-8](utf8.md) who are however almost always backwards compatible with ASCII (interpreting UTF-8 as ASCII will give somewhat workable results), and ASCII itself is also normally supported everywhere. ASCII is the [suckless](suckless.md)/[LRS](lrs.md)/[KISS](kiss.md) character encoding, recommended and [good enough](good_enough.md) for most programs.
ASCII ([American](usa.md) standard code for [information](information.md) interchange) is a relatively simple standard for [digital](digital.md) encoding of [text](text.md) that's one of the most basic and probably the most common format used for this purpose. For its simplicity and inability to represent characters of less common alphabets it is nowadays quite often replaced with more complex encodings such as [UTF-8](utf8.md) who are however almost always backwards compatible with ASCII (interpreting UTF-8 as ASCII will give somewhat workable results), and ASCII itself is also normally supported everywhere. ASCII is the [suckless](suckless.md)/[LRS](lrs.md)/[KISS](kiss.md) character encoding, recommended and [good enough](good_enough.md) for most programs.
The ASCII standard assigns a 7 [bit](bit.md) code to each basic text character which gives it a room for 128 characters -- these include lowercase and uppercase [English](english.md) alphabet, decimal digits, other symbols such as a question mark, comma or brackets, plus a few special control characters that represent instructions such as carriage return which are however often obsolete nowadays. Due to most computers working with 8 bit bytes, most platforms store ASCII text with 1 byte per character; the extra bit creates a room for **extending** ASCII by another 128 characters (or creating a variable width encoding such as [UTF-8](utf8.md)). These extensions include unofficial ones such as VISCII (ASCII with additional Vietnamese characters) and more official ones, most notably [ISO 8859](iso_8859.md): a group of standards by [ISO](iso.md) for various languages, e.g. ISO 88592-1 for western European languages, ISO 8859-5 for Cyrillic languages etc. Also [IBM Code Page 437](cp437.md) is a famous unofficial extension of ASCII.

View file

@ -8,14 +8,16 @@ Such a specimen of atheist is one of the best quality examples of a [pseudoscept
Favorite topics of atheists include argument fallacies (which they also like to practice), cognitive biases (same), their own intelligence, [Occam's razor](occams_razor.md), Murphy's laws, the number [42](42.md), [quantum physics](quantum.md), proving over and over that Earth isn't flat (at least 10 times every day just to keep themselves in shape), correlation that does not imply causation, finding contradictions in Bible, asking other people for citations, [binary](binary.md) or even [hexadecimal](hexadecimal.md) numbers, "programming in HTML", living in a simulation and disproving religion with books about [Evolution](evolution.md) or something.
On a bit more serious note: we've all been there, most people in their teens think they're literal [Einsteins](einstein.md) and then later in life cringe back on themselves. However, some don't grow out of it and stay arrogant, ignorant fucks for their whole lives. The principal mistake of the stance they retain is they try to apply "science" (or whatever it means in their world) to EVERYTHING and reject any other approach to solving problems -- of course, [science](science.md) (the real one) is great, but it's just a tool, and just like you can't fix every problem with a hammer, you can't approach every problem with science. In your daily life you make a million of unscientific decisions and it would be bad to try to apply science to them; you cross the street not because you've read a peer-reviewed paper about it being the most scientifically correct thing to do, but because you feel like doing it, because you believe the drivers will stop and won't run you over. Beliefs, intuition, emotion, non-rationality and even spirituality are and have to be part of life, and it's extremely stupid to oppose these concepts just out of principle. With that said, there's nothing wrong about being a well behaved man who just doesn't feel a belief in any god in his heart, just you know, don't be an idiot.
On a bit more serious note: we've all been there, most people in their teens think they're literal [Einsteins](einstein.md) and then later in life cringe back on themselves. However, some don't grow out of it and stay arrogant, ignorant fucks for their whole lives. The principal mistake of the stance they retain is they try to apply "science" (or whatever it means in their world) to EVERYTHING and reject any other approach to solving problems -- of course, [science](science.md) (the real one) is great, but it's just a tool, and just like you can't fix every problem with a hammer, you can't approach every problem with science. In your daily life you make a million of unscientific decisions and it would be bad to try to apply science to them; you cross the street not because you've read a peer-reviewed paper about it being the most scientifically correct thing to do, but because you feel like doing it, because you believe the drivers will stop and won't run you over. Atheists will likely take no issue with taking an [optimist](optimism.md) mindset when encountering hardships in life, but what else is optimism than BELIEVING there will be a happy ending, perhaps despite it being the less probable outcome? How is this different from a dying man choosing to believe something good awaits him after death? Beliefs, intuition, emotion, non-rationality and even spirituality are and have to be part of life, and it's extremely stupid to oppose these concepts just out of principle. With that said, there's nothing wrong about being a well behaved man who just doesn't feel a belief in any god in his heart, just you know, don't be an idiot.
Many atheists (and, to be fair, not all) fall a victim to the fatal oversimplification of "god = religion = bad", but indeed reality is not so simple and blindly following such a simple rule of thumb does more harm than good. If our goal is to reduce [evil](evil.md), we must first turn off [shortcut thinking](shortcut_thinking.md) and examine the situation in more depth. Doing so we find that faith in god or higher power doesn't equate religion, that religion is much more than belief in god (it is [culture](culture.md), set of [moral](morality.md) guidelines, tradition and folklore, wisdom, ...), that not all religions are hierarchical mass religions, and that on the other hand many modern social phenomena, despite not being "officially" classified as religion, are closer to the "evil" kind of religions of the old times -- for example many of the [capitalist](capitalism.md) religions such as the [productivity cult](productivity_cult.md), [corporate](corporation.md) world worshiping legendary [entrepreneurs](entrepreneur.md) basically as [gods](hero_culture.md) or the worship of economy as the highest, unpredictable, mysterious force to which everyone must bow. The world has changed and the role of mass religion as the great oppressor has been taken on by others. And so to truly evade evil we must adapt to the change: rather than bullying a poor [Buddhist](busshism.md) for daring to believe in reincarnation, it's better to for example address the concerning fact that too many people believe [Elon Musk](elon_musk.md) is a savior of mankind, capable of being expert in every field of science while performing miracles such as running 20 companies while casually reaching professional skill levels at several video games.
Although they think they do, these atheists don't really believe in science but rather [soyence](soyence.md), they have merely chosen to subscribe to a new religion than the old one. Compare these scenarios:
- A medieval peasant believes what the priest tells him because only the priest has high enough education to know the language of the scripture. The priest tells the peasant God's miracles happen and other priests confirm this, they even show him the page in the holy book where it is written, it was reviewed by hundreds of priests. The peasant believes them, he didn't see the miracles (in fact he doesn't even know anyone who did) but someone with higher education assured him it is so and other people with such education approve of the message. Why would they lie? Certainly there is no politics and business in religion. Besides this, questioning the priests is socially punished, it's better to not do it.
- A [21st century](21st_century.md) internet peasant believes what PhD in biology tells him about human [races](race.md) because he himself doesn't have such qualification nor the means to run his own research. The PhD science popularizator tells the guy races are an illusion and other such PhDs confirm this, they even make their mutually reviewed papers available on the internet. The guy believes them, he didn't make the research himself (in fact what they say contradicts his everyday observations) but someone with higher education assured him it is so and other people with such education approve of the message. Why would they lie? Certainly there is no politics and business in science. Besides this, questioning these PhDs is socially punished, it's better to not do it.
- A [21st century](21st_century.md) internet peasant believes what [PhD](phd.md) in biology tells him about human [races](race.md) because he himself doesn't have such qualification nor the means to run his own research. The PhD science popularizator tells the guy races are an illusion and other such PhDs confirm this, they even make their mutually reviewed papers available on the internet. The guy believes them, he didn't make the research himself (in fact what they say contradicts his everyday observations) but someone with higher education assured him it is so and other people with such education approve of the message. Why would they lie? Certainly there is no politics and business in science. Besides this, questioning these PhDs is socially punished, it's better to not do it.
We see there is zero difference besides changed names.
We see practically zero difference besides changed names.
There is a famous quote (sometimes attributed to Werner Heisenberg, accuracy of which is questioned) stating that "The first gulp from the glass of natural sciences will make you an atheist, but at the bottom of the glass God is waiting for you". Whoever said it, it captures the reality of the situation: in our society obsessed with shallow worship of [soyence](soyence.md) most people only ever take the first sip (through mass media, Internet, "science popularization" etc.), and so most end up remaining atheists. A few manage to drink a bit more and become agnostic, but by definition only a tiny minority of the smartest get near the very bottom of the glass. Indeed, among greatest minds it is hard to find true atheists, even though they typically have a personal and not easy to describe faith, they tend to think for themselves and by this usually reject consuming prepackaged religion, but the more convincing it is then that they independently arrive at accepting some kind of God -- it is because truly deeply engaging in rational thinking for one's whole life inevitably reveals there ARE limits to the rational: greatest thinkers stand at the very top of where humans can get with their thinking and then witness that still there are things they will never know, and the only thing remaining beyond is faith. [Newton](newton.md) for example was a Christian and [Einstein](einstein.md) often used the word "[God](god.md)" instead of "nature" or "universe"; even though he said he didn't believe in the traditional personal God, he also said that the laws of physics were like books in a library which must have obviously been written by someone or something we can't comprehend. Obviously: science is rational and works, but who made it so? This can never be answered by science itself. [Nikola Tesla](tesla.md) said he was "deeply religious, though not in the orthodox sense". There are also very hardcore religious people such as [Larry Wall](larry_wall.md), the inventor of [Perl](perl.md) language, who even planned to be a Christian missionary -- as hinted above, this is not rare in him believing in God, but rather in accepting a kind of "mainstream" faith. The "true atheists" are mostly second grade "scientists" (often called "science promoters") who make career out of the pose and make living by writing books about atheism rather than being scientists.

View file

@ -4,7 +4,7 @@ WIP kind of
{ There's most likely a lot of BS, math people pls send me corrections, thank u. ~drummyfish }
Numbers (from Latin *numerus* coming from a Greek word meaning "to distribute") are one of the most elementary [mathematical](math.md) objects, building [stones](rock.md) serving most often as quantitative values (that is: telling count, size, length, order etc.), in higher math also used in much more [abstract](abstraction.md) ways which have only distant relationship to traditional counting. Examples of numbers are minus [one](one.md) half, [zero](zero.md), [pi](pi.md) or [i](i.md). Numbers constitute the basis and core of mathematics and as such they sit almost at the [lowest level](low_level.md) of it, i.e. most other things such as algebra, [functions](function.md) and [equations](equation.md) are built on top of numbers or require numbers to even be examined. In modern mathematics numbers themselves aren't on the absolute bottom of the foundations though, they are themselves built on top of [sets](set.md), as set theory is most commonly used as a basis of whole mathematics, however for many purposes this is just a formalism that's of practical interest only to some mathematicians -- on the other hand numbers just cannot be avoided anywhere, by a mathematician or just a common folk. The word *number* may be the first that comes to our mind when we say *mathematics*. The area of [number theory](number_theory.md) is particularly focused on examining numbers (though it's examining almost exclusively integer numbers because these seem to have the deepest pattern related e.g. to divisibility).
Numbers (from Latin *numerus* coming from a Greek word meaning "to distribute") are one of the most elementary [mathematical](math.md) objects, building [stones](rock.md) serving most often as quantitative values (that is: telling count, size, length, order etc.), in higher math also used in much more [abstract](abstraction.md) ways which have only distant relationship to traditional counting. Examples of numbers are minus [one](one.md) half, [zero](zero.md), [pi](pi.md) or [i](i.md). Numbers constitute the basis and core of mathematics and as such they sit almost at the [lowest level](low_level.md) of it, i.e. most other things such as algebra, [functions](function.md) and [equations](equation.md) are built on top of numbers or require numbers to even be examined. In modern mathematics numbers themselves aren't on the absolute bottom of the foundations though, they are themselves built on top of [sets](set.md), as set theory is most commonly used as a basis of whole mathematics, however for many purposes this is just a formalism that's of practical interest only to some mathematicians -- on the other hand numbers just cannot be avoided anywhere, by a mathematician or just a common folk. The word *number* may be the first that comes to our mind when we say *mathematics*. The area of [number theory](number_theory.md) is particularly focused on examining numbers (though it's examining almost exclusively integer numbers because these seem to have the deepest pattern related e.g. to divisibility). Interest in numbers isn't exclusive to mathematics -- numbers also play an important role in [culture](culture.md) and religion for example; some even believe in "[magical](magic.md)" power of numbers (see [numerology](numerology.md)).
Do not [confuse](often_confused.md) numbers with digits or figures (numerals) -- a number is a purely abstract entity while digits serve as symbols for numbers so that we can write them down. One number may be written in many ways, using one of many [numeral systems](numeral_system.md) (Roman numerals, tally marks, Arabic numerals of different [bases](base.md) etc.), for example 4 stands for a number than can also be written as IV, four, 8/2, 16:4, 2^2, 4.00 or 0b100. There are also numbers which cannot be exactly expressed with our traditional numeral systems, for some of them we have special symbols -- most famous example is of course [pi](pi.md) whose digits cannot ever be completely written down -- and there are even numbers lacking any symbolic representation, ones not well researched yet, only described by equations to which they are the solution. Sure enough, a number by itself isn't too interesting and probably doesn't even make sense, it's only in context, when it's placed in relationship with other numbers (by ordering them, defining operations and properties based on those operations) that patterns and useful attributes emerge.

View file

@ -14,6 +14,6 @@ At the dawn of personal computer era, the culture of [hackers](hacking.md) who h
One paper from 2020s found that men (curiously unlike [women](woman.md)) exposed to anti-piracy propaganda will increase their pirating by 18% :D One example of publicly embracing piracy in the mainstream is e.g. the [Pirate party](pirate_party.md) that has risen to popularity in a few countries now.
**Where To Pirate Stuff?** The following information is for FOR SCIENTIFIC RESEARCHERS only :'D We merely mention places where pirating oftentimes happens AS A CURIOSITY and interesting fact, without telling you what you should or shouldn't do, OK? [Web](www.md), as any mainstream place, is extremely censored, not much can be found there except for a few bastions of freedoms such as Anna's archive, library of genesis, [abandonware](abandonware.md) sites etc. Web can perhaps offer some good pointers, e.g. https://old.reddit.com/r/Piracy/wiki/megathread and https://piracy.vercel.app. It is possible to try try some clever search hacks (special search options like "filetype=pdf" etc., using non-Google search engines, ...) but it's usually fruitless. In general it is a noob mistake to try to Google things on the web, using underground non-web networks is what will yield results. These include [torrents](torrent.md), [FTP](ftp.md) search engines, [I2P](i2p.md), [IPFS](ipfs.md), [gopher](gopher.md), maybe even [darknet](darknet.md) etc.
**Where To Pirate Stuff?** The following information is for FOR SCIENTIFIC RESEARCHERS only :'D We merely mention places where pirating oftentimes happens AS A CURIOSITY and [interesting](interesting.md) fact, without telling you what you should or shouldn't do, OK? [Web](www.md), as any mainstream place, is extremely censored, not much can be found there except for a few bastions of freedoms such as Anna's archive, library of genesis, [abandonware](abandonware.md) sites etc. Web can perhaps offer some good pointers, e.g. https://old.reddit.com/r/Piracy/wiki/megathread and https://piracy.vercel.app. It is possible to try try some clever search hacks (special search options like "filetype=pdf before:2010" etc., using non-Google search engines, ...) but it's too often fruitless. A cool trick to discovering places that hold piratable content is this: one downloads something proprietary and normally publicly inaccessible, for example some kind of ISO standard (which can be done through Anna's archive or something), and then one searches for a verbatim long sentence (i.e. in double quotes) from the document -- this finds places where this "inaccessible" document is publicly uploaded, which will likely also have other "inaccessible" documents. In general it is a noob mistake to try to Google things on the web, using underground non-web networks is what will yield results. These include [torrents](torrent.md), [FTP](ftp.md) search engines, [I2P](i2p.md), [IPFS](ipfs.md), [gopher](gopher.md), maybe even [darknet](darknet.md) etc.
TODO: more history etc.

View file

@ -181,3 +181,9 @@ You'll get the SDL version.
A great example of this kind of portable design can be seen e.g. in well written **[compilers](compiler.md)** that separate their architecture into an frontend and backend -- imagine we are writing for example a [C](c.md) compiler. The parser of C syntax can be easily written in a portable way, we simply write functions that work with text, however we find difficulty in asking what [instruction set](isa.md) we will compile to. If we choose one, such as [x86](x86.md), then we will not only write an x86 specific code generator, but also e.g. an x86 specific [optimizer](optimization.md); the part of the compiler that may get so complex that it ends up being bigger than the rest of the code. What if then we also want to support another ISA such as [Arm](arm.md) or [RISC-V](risc_v.md), will we have to rewrite our painstakingly written optimizer for those architectures from scratch? The solution is the same as explained above in regards to I/O: we make an abstraction above the instruction set, here called an [intermediate representation](intermediate_representation.md), usually some [bytecode](bytecode.md), i.e. the compiler first translates C to the abstract bytecode, then we may perform all the complex optimizations on this bytecode, and only then, in the last moment, we relatively simply translate this bytecode to whatever specific instruction set.
Programming languages, operating systems and other "platforms" also usually employ [self hosting](self_hosting.md) to greatly increase portability -- you will most often see a serious programming language written in itself and if not, then at very least e.g. its standard library will be written as such. See also [bootstrapping](bootstrapping.md).
## See Also
- [bootstrapping](bootstrap.md)
- [compatibility](compatibility.md)
- [futureproof](future_proof.md)

View file

@ -2,7 +2,7 @@
*"PRODUCE PRODUCE PRODUCE PRODUCE PRODUCE"* --[capitalism](capitalism.md)
Productivity cult (often connected to terms such as *self improvement*, *personal growth* etc.) is one of [modern](modern.md) [capitalist](capitalism.md) religions which praises human productivity above everything, even happiness, well being, sanity etc. Kids nowadays are all about "how to be more motivated and productive", they make daily checklists, analyze tables of their weekly performance, count how much time they spend taking a shit on the toilet, give up sleep to study some useless bullshit required by the current market fluctuation. Productivity cult is all about voluntarily making oneself a robot, a slave to the system that worships capital. As [Froge](froge.md) put it: "The world of self improvement gurus is a circlejerk of such magnitude it rivals several world religions".
Productivity cult (often connected to terms such as *self improvement*, *personal growth*, *personal development* etc.) is one of [modern](modern.md) [capitalist](capitalism.md) religions which praises human productivity above everything, even happiness, well being, sanity etc. Kids nowadays are all about "how to get more motivated and productive", they make daily checklists, analyze tables of their weekly performance, count how much time they spend taking a [shit](shit.md) on the toilet, give up sleep to study some useless [bullshit](bullshit.md) required by the current market fluctuation. Productivity cult is all about voluntarily making oneself a robot, a slave to the system that worships capital. As [Froge](froge.md) put it: "The world of self improvement gurus is a circlejerk of such magnitude it rivals several world religions".
A human is living being, not a machine, he should live a happy relaxed life, dedicated to spending time with his close ones, raising children, enjoying the beauties of nature, exploring secrets of the universe, without stress; he should create when inspiration or a truly great necessity comes to him and when he does, he should take his time to carefully make the art great, without hasting it or forcing it. Productivity cult goes all against this, it proclaims one should be constantly spitting out "something", torturing and forcing himself, maximizing quantity on detriment of quality, undergo constant stress while suppressing rest -- that one should all the time be preoccupied with competitive [fight](fight_culture.md), deadlines, that art he creates is something that can be planned on schedule, made on deadline and assigned a calculated price tag to be an ideal consumerist product. If such stance towards life doesn't make you wanna puke, you most likely lack a soul.

File diff suppressed because it is too large Load diff

51
unix.md
View file

@ -31,7 +31,7 @@ For [zoomers](genz.md) and other noobs: Unix wasn't like [Windows](windows.md),
UNDER CONSTRUCTION
*Note: here by "Unix" we will assume a system conforming to the POSIX standard from 2001.*
*Note: here by "Unix" we will more or less assume a system conforming to some version of the POSIX standard.*
This section will help complete noobs kickstart their journey with a Unix-like system such as [GNU](gnu.md)/[Linux](linux.md) or [BSD](bsd.md). Please be aware that each system has its additional specifics, for example [package managers](package_manager.md), init systems and so on -- these you must learn about elsewhere as here we may only cover the core parts those systems inherited from the original Unix. Having learned this though you should be able to somewhat fly any Unix like system. Obviously we'll be making some simplifications here too.
@ -43,13 +43,23 @@ PRO TIP: convenient features are often implemented, most useful ones include goi
You run a utility simply by writing its name, for example typing `ls` will show you a list of files in your current directory. Very important is the `man` command that shows you a **manual page** for another command, e.g. typing `man ls` should display a page explaining the `ls` utility in detail. Short help for a utility can also usually be obtained by writing `-h` after it, for example `grep -h`.
Unix utilities (and other programs) can also be invoked with **arguments** that specify more detail about what should be done. Arguments are written after the utility name and are separated by spaces (if the argument itself should contain space, it must be enclosed between double quotes, e.g. `"abc def"`). For example the `cd` (change directory) utility must be given the name of a directory to go to, e.g. `cd mydirectory`.
Unix utilities (and other programs) can also be invoked with **arguments** that specify more detail about what should be done. Arguments are written after the utility name and are separated by spaces (if the argument itself should contain space, it must be enclosed between double quotes, e.g.: `"abc def"` is a single arguments containing space, but `abc def` are two arguments). For example the `cd` (change directory) utility must be given the name of a directory to go to, e.g. `cd mydirectory`.
Some arguments start with one or two minus characters (`-`), for example `-h` or `--help`. These are usually called **flags** and serve either to turn something on/off or to name other parameters. For example many utilities accept a `-s` flag which means "silent" and tells the utility to shut up and not write anything out. A flag oftentimes has a short and long form (the long one starting with two minus characters), so `-s` and `--silent` are the same thing. The other type of flag says what kind of argument the following argument is going to be -- for example a common one is `--output` (or `-o`) with which we specify the name of the output file, so for instance running a C compiler may look like `c99 mysourcecode.c --output myprogram` (we tell the compiler to name the final program "myprogram"). Short flags can usually be combined like so: instead of `-a -b -c` we can write just `-abc`. Flags accepted by utilities along with their meaning are documented in the manual pages (see above).
To **run a program** that's present in the current directory as a file you can't just write its name (like you could e.g. in [DOS](dos.md)), it MUST be prefixed it with `./` (shorthand for current directory), otherwise the shell thinks you're trying to run an INSTALLED program, i.e. it will be looking for the program in a directory where programs are installed. For example having a program named "myprogram" in current directory it will be run with `./myprogram`. Also note that to be able to run a file as a program it must have the executable mode set, which is done with `chmod +x myprogram` (you may have to do this if you e.g. download the program from the Internet). **Programs can also take arguments** just like we saw with the built-in utilities, so you can run a program like `./myprogram abc def --myflag`.
Now to the very basic stuff: **browsing directories, moving and deleting files etc.** This is done with the following utils: `ls` (prints files in current directory), `pwd` (prints path to current directory), `cd` (travels to given directory, `cd ..` travels back), `cat` (outputs content of given file), `mkdir` (creates directory), `rm` (removes given file; to remove a directory `-rf` flag must be present), `cp` (copies file), `mv` (moves file, including directory -- note that moving also serves for renaming). As an exercise try these out (careful with `rm -rf`) and read manual pages of the commands (you'll find that `ls` can also tell you for example the file sizes and so on).
To **run a program** that's present in the current directory as a file you can't just write its name (like you could e.g. in [DOS](dos.md)), it MUST be prefixed it with `./` (shorthand for current directory), otherwise the shell thinks you're trying to run an INSTALLED program, i.e. it will be looking for the program in a directory where programs are installed. For example having a program named "myprogram" in current directory it will be run with `./myprogram`. Also note that to be able to run a file as a program it must have the executable mode set, which is done with `chmod +x myprogram` (you may have to do this if you e.g. download the program from the Internet). **Programs can also take arguments** just like we saw with the built-in utilities, so you can run a program like `./myprogram abc def --myflag`.
**Files and file system**: On Unices the whole filesystem hierarchy starts with a directory called just `/` (the root directory), i.e. every absolute (full) path will always start with slash. For example pictures belonging to the user *john* may live under `/home/john/pictures`. It's also possible to use relative paths, i.e. ones that are considered to start in the current (working) directory. A dot (`.`) stands for current directory and two dots (`..`) for the directory "above" the current one. I.e. if our current directory is `/home/john`, we can list the pictures with `ls pictures` as well as `ls /home/john/pictures` or `ls ./pictures`. Absolute and relative paths are distinguished by the fact the absolute one always starts with `/` while relative don't. There are several **types of files**, most importantly *regular files* (the "normal" files) and *directories* (there are more such *symbolic links*, *sockets*, *block special files* etc., but for now we'll be ignoring these). Unix has a [paradigm](paradigm.md) stating that **everything's a [file](file.md)**, so notably accessing e.g. hardware devices is done by accessing special device files (placed in `/dev`).
Files additionally have attributes, importantly so called **permissions** -- unfortunately these are a bit complicated, but as a mere user working with your own files you won't have to deal too much with them, only remember if you encounter issues with accessing files, it's likely due to this. In short: each file has an owner and then also a set of permissions that say who's allowed to do what with the file. There are three kind of permissions: *read* (`r`), *write* (`w`) and *execute* (`x`), and ALL THREE are defined for the file's owner, for the file's group and for everyone else, plus there is a magical value suid/sgid/sticky we won't delve into. All of this is then usually written either as a 4 digit [octal](octal.md) number (each digit expresses the three permission [bits](bit.md)) or as a 12 character string (containing the `r`/`w`/`x`/`-` characters). Well, let's not dig much deeper now.
TODO: more more more
@ -58,8 +68,9 @@ Here is a quick cheatsheet of the most common Unix utilities:
| name | function | possible arguments (just some) |
| ------------- | ------------------------------------------------------------------------ | ------------------------------------------- |
| alias | create or display alias (nickname for another command) | alias=command |
| [awk](awk.md) | text processing language (advanced) | |
| bc | interactive calculator | |
| c99 | C language compiler | file, -o (output file) |
| c99 | [C](c.md) language compiler (advanced) | file, -o (output file) |
| cd | change directory | directory name (`..` means back) |
| chmod | change file mode | +x (execute), +w (write), +r (read), file |
| cmp | compare files | -s (silent), file1, file2 |
@ -68,27 +79,47 @@ Here is a quick cheatsheet of the most common Unix utilities:
| df | report free space on disk | -k (use KiB units) |
| du | estimate size of file (useful for directories) | -k (use KiB units), -s (only total), file |
| echo | write out string (usually for scripts) | |
| ed | simple text editor | |
| [ed](ed.md) | ed is the standard text editor | |
| expr | evaluate expression (simple calculator) | expression (as separate arguments) |
| false | return false value | |
| grep | search for pattern in file | pattern, file, -i (case insensitive) |
|[grep](grep.md)| search for pattern in file | pattern, file, -i (case insensitive) |
| head | show first N lines of a file | -n (count), file |
| kill | terminate process or send a signal to it | processid, -9 (kill), -15 (terminate) |
| ls | list directory (shows files in current dir.) | -s (show file sizes in block) |
| man | show manual page | topic |
| [man](man.md) | show manual page for topic | topic |
| mkdir | make directory | name |
| mv | move (rename) file | -i (ask for rewrite), file, newfile |
| pwd | print working directory | |
| rm | remove files | -r (recursive, for dirs), -f (force) |
| sed | stream editing utility (for replacing text etc.) | script, file |
| sh | shell (the command line interpreter, usually for scripting) | -c (command string) |
| [sed](sed.md) | stream editing util (replacing text etc.), see also [regex](regex.md) | script, file |
| [sh](sh.md) | shell (the command line interpreter, usually for scripting) | -c (command string) |
| sort | sort lines in file | -r (reverse), -u (unique), file |
| tail | show last N lines of a file | -n (count), file |
| true | return true value | |
| uname | output system name and info | -a (all, output everything) |
| [vi](vi.md) | advanced text editor | |
| wc | word count (count characters or lines in file, can tell exact file size) | -c (character), -l (lines), file |
TODO: stdin/out/err, utils, shell, sh (running programs, ...), usual "workflows" (man pages, history, arrows, tab-completion, ...), often used commands, examples, permissions, variables and exit codes
NOTES on the utilities:
- Typically there are two ways of feeding input data to a utility: either by specifying a file to read from or by feeding the input on to the utility's standard input. This also applies to the output. Using standard input/output is a more "Unix" way as it allows us to chain the utlities with pipes, make one program feed its output to another an input.
- Utilities try to follow common conventions so that it's easier to guess and remember what flags mean etc., for example `-h` is commonly a flag for getting help, `-o` is one for specifying output file etc.
- Specific Unix systems will normally have more feature rich utilities, supporting additional flags and even adding new utilities. Check out manual pages on your system. You'll have to learn about common utils that aren't part of POSIX, e.g. [wget](wget.md), [ssh](ssh.md), [curl](curl.md), [sudo](sudo.md), [apt](apt.md) and more.
Now on to a key feature of Unix: **pipelines and redirects**. [Processes](process.md) (running programs) on Unix have so called **standard input** (*stdin*) and **standard output** (*stdout*) -- these are streams of data (often textual but also binary) that the process takes on input and output respectively. There may also exist more streams (notably e.g. *standard error output*) but again, we'll ignore this now. When you run a program (utility etc.) in the command line, standard input will normally come from your keyboard and standard output will be connected to the terminal (i.e. you'll see it being written out in the command line). However sometimes you may want the program to take input from a file and/or to write its output to a file (imagine e.g. keeping [logs](logging.md)), or you may even want one program to feed its output as an input to another program! This is very powerful as you may combine the many small utilities into more powerful units. See also [Unix philosophy](unix_philosophy.md).
Most commonly used redirections are done like this:
- `command > file`: redirects output of *command* to file *file* (rewriting its content if there is any).
- `command < file`: redirects input of *command* to come from *file*.
- `command >> file`: output of *command* will be appended (added to the end) to *file*.
**Example**:
TODO: stdin/out/err, utils, shell, sh (running programs, ...), usual "workflows" (man pages, history, arrows, tab-completion, ...), often used commands, examples, permissions, variables and exit codes, wildcards
## See Also

File diff suppressed because one or more lines are too long

View file

@ -3,12 +3,12 @@
This is an autogenerated article holding stats about this wiki.
- number of articles: 626
- number of commits: 978
- total size of all texts in bytes: 5100861
- total number of lines of article texts: 37037
- number of commits: 979
- total size of all texts in bytes: 5110607
- total number of lines of article texts: 37104
- number of script lines: 324
- occurrences of the word "person": 10
- occurrences of the word "nigger": 113
- occurrences of the word "nigger": 114
longest articles:
@ -35,60 +35,76 @@ longest articles:
top 50 5+ letter words:
- which (2816)
- which (2820)
- there (2207)
- people (2173)
- example (1775)
- other (1594)
- example (1779)
- other (1595)
- about (1421)
- number (1332)
- software (1266)
- because (1174)
- software (1267)
- because (1175)
- their (1104)
- would (1073)
- something (1053)
- program (1039)
- being (1027)
- program (1047)
- being (1029)
- things (962)
- language (936)
- called (931)
- language (937)
- called (933)
- without (865)
- function (863)
- simple (860)
- computer (843)
- function (864)
- simple (862)
- computer (844)
- numbers (831)
- different (796)
- these (780)
- these (781)
- however (779)
- programming (771)
- world (757)
- system (740)
- world (758)
- system (741)
- should (723)
- doesn (714)
- still (712)
- games (691)
- society (671)
- society (672)
- drummyfish (671)
- while (670)
- point (669)
- simply (656)
- possible (653)
- probably (645)
- using (641)
- always (630)
- course (611)
- possible (654)
- probably (646)
- using (643)
- always (631)
- course (612)
- similar (602)
- actually (591)
- actually (592)
- someone (587)
- https (587)
- though (582)
- basically (571)
- really (569)
- technology (554)
- usually (556)
latest changes:
```
Date: Sat Mar 1 19:31:47 2025 +0100
3d_rendering.md
bitreich.md
chess.md
compression.md
faq.md
go.md
how_to.md
jokes.md
number.md
political_correctness.md
random_page.md
stereotype.md
unix.md
wiki_pages.md
wiki_stats.md
Date: Sat Mar 1 13:35:54 2025 +0100
compression.md
free_culture.md
@ -106,28 +122,6 @@ Date: Sat Mar 1 01:35:35 2025 +0100
atan.md
bootstrap.md
chess.md
color.md
cope.md
copyright.md
corporation.md
determinism.md
doom.md
earth.md
elon_musk.md
faq.md
feminism.md
fork.md
free_culture.md
game.md
gnu.md
intellectual_property.md
kek.md
liberalism.md
log.md
main.md
math.md
newspeak.md
often_confused.md
```
most wanted pages:
@ -155,26 +149,26 @@ most wanted pages:
most popular and lonely pages:
- [lrs](lrs.md) (336)
- [lrs](lrs.md) (337)
- [capitalism](capitalism.md) (304)
- [c](c.md) (238)
- [bloat](bloat.md) (229)
- [free_software](free_software.md) (197)
- [bloat](bloat.md) (230)
- [free_software](free_software.md) (198)
- [game](game.md) (152)
- [suckless](suckless.md) (149)
- [proprietary](proprietary.md) (134)
- [modern](modern.md) (121)
- [minimalism](minimalism.md) (118)
- [modern](modern.md) (122)
- [minimalism](minimalism.md) (119)
- [censorship](censorship.md) (116)
- [computer](computer.md) (113)
- [kiss](kiss.md) (111)
- [programming](programming.md) (107)
- [programming](programming.md) (108)
- [fun](fun.md) (105)
- [math](math.md) (104)
- [fun](fun.md) (104)
- [gnu](gnu.md) (102)
- [shit](shit.md) (100)
- [linux](linux.md) (100)
- [shit](shit.md) (99)
- [woman](woman.md) (98)
- [woman](woman.md) (99)
- [fight_culture](fight_culture.md) (95)
- [corporation](corporation.md) (95)
- [bullshit](bullshit.md) (95)