- Portals
- The Current Year
- ED in the News
- Admins
- Help ED Rebuild
- Archive
- ED Bookmarklet
- Donate Bitcoin
Contact an admin on Discord or EDF if you want an account. Also fuck bots.
UNIX: Difference between revisions
imported>Loliphile Fix few typos, add another use for cat, explain && section |
imported>Loliphile No edit summary |
||
Line 128: | Line 128: | ||
This appends the content of ''faggot.txt'' to ''copypasta.txt'' | This appends the content of ''faggot.txt'' to ''copypasta.txt'' | ||
$ cat file0.bin file1.bin > output.bin | $ cat file0.bin file1.bin > output.bin | ||
This makes a file "output.bin" and writes the contents of "file0.bin" then "file1.bin" to it. This is particularly useful for making a whole file after it's been split like to 4GB parts. | This makes a file "output.bin" and writes the contents of "file0.bin" then "file1.bin" to it. This is particularly useful for making a whole file after it's been split like to 4GB parts. | ||
Latest revision as of 15:07, 20 October 2021
UNIX, an acronym for Unix Is Not Unix, is an overcomplicated operating system invented at Bell Labs by Bill Gates' twin brother. It's pronounced exactly like "eunuchs"; this is appropriate, since one must abandon all hope of ever getting laid when one uses it. It has been proven through rigorous scientific study that if enough people used UNIX, AIDS will be cured. Mostly people don't use it for this fact to increase lulz.
UNIX
An Operating System, A Philosophy, A Lifestyle, A Source of Drama.
An ancient, outdated, outmoded, and outperformed OS that has refused to die, despite the evidence of its age showing through every day. UNIX file permissions are beaten by ACLs, UNIX as a server requires arcane knowledge of the system you're working on, programming has splintered to the point where simple essential utilities won't compile on supposedly similar versions of UNIX.
It is owned by SCO and its only reason for living is so that litigation against IBM will continue.
UNIX commands written by 13-year-old boys
- man, which can be used before any of the following commands
- fsck
- latex
- cp
- finger (followed by a username)
- grep
- head
- mount
- strip
- touch
- ps -fu (followed by a username)
- sniff
- ssh
Another recommended command is `su -c rm -rf /*`, a sanctifying spell cast by only the smartest sysadmins to protect their 1337 box from h@x0rz.
Basic file operations
This section provides information on how to use the command line interface in UNIX. Note that all of these can be ignored in Windows NT because Microsoft lives in the modern world, where computers don't take up a whole room.
man
If you don't know something - RTFM! man stands for manual. And what you were thinking of?
Type
$ man <command>
If you want to have information about <command>. Example:
$ man ls LS(1) NetBSD General Commands Manual LS(1) NAME ls -- list directory contents
SYNOPSIS ls [-AaBbCcdFfghikLlmnopqRrSsTtuWwx1] [file ...]
DESCRIPTION For each operand that names a file of a type other than directory, ls displays its name as well as any requested, associated information. For each operand that names a file of type directory, ls displays the names of files contained within that directory, as well as any requested, asso- ciated information.
If no operands are given, the contents of the current directory are dis- played. If more than one operand is given, non-directory operands are displayed first; directory and non-directory operands are sorted sepa- rately and in lexicographical order.
The following options are available: ...
yes
Yes is far the most useful UNIX command
yes "niggers suck"
Yes prints a string at least 100 times before it's killed and is used to hide the console sex games that programmers and engineers play during work hours.
cd
Change Directory Use is very simple, and just like use of `cd` in DOS
cd ~/l33t/h4x/
Note that ~ is your home directory, if you need to see where you are (if your prompt doesn't display it, use:
pwd
print working directory
mv
Move or rename a file
mv oldname.dix newname.dix
mv ~/olddirectory/file ~/newdirectory/file
Note that on *nix, moving and renaming files is essentially the same thing, as the entire path is considered part of the file name
cp
Captain Planet. I mean... Copy
cp ~/old ~/new
Options
cp -R
Copies everything in a directory and subdirectories
scp
SFTP Copy Like cp, but allows copying from one machine to another.
scp [email protected]:~/list.txt ./
If you wanted to copy an entire directory:
scp -r [email protected]:~/cake ./cake
Note that ./ is the current directory.
cat, more etc
Note, that you can use Unix operands with this commands
cat
Printing the whole file to the screen.
$ cat some.file i am faggot hhahahah gsgffsdf agfsd.. (file content)
Now, try this:
$ cat faggot.txt >> copypasta.txt
This appends the content of faggot.txt to copypasta.txt
$ cat file0.bin file1.bin > output.bin
This makes a file "output.bin" and writes the contents of "file0.bin" then "file1.bin" to it. This is particularly useful for making a whole file after it's been split like to 4GB parts.
head
Showing the beginning of the file
$ head ussr.txt Союз нерушимый республик свободных сплотила на веки великая Русь!
tail
OMG, works like head, but in opposite way!
~/vk% tail album.pl unless $response->is_success or $response->code == 302; print "Success.\n";
$response = $ua->get("$url\?gid=$gid"); $_ = $response->content; @_ = /\"photos.php\?act=album&id=(\d+)\"/gm; # return album ID return $_[$#_]; }
more & less
Useful for working with big txt files. With this tool you can scroll the content.
$ more big.fil3
ls
Just listing file in current dirrectory
~% ls Mail codes mail mbox vk centericq.core dead.letter mails public_html zed
Options
Note, that options can be combined.
ls <dir>
Listing files in <dir> directory.
~% ls vk album.pl graffiti.pl img
ls -a
Listing ALL files (include hidden).
~% ls -a . .emacs.d .ssh codes vk .. .irssi .subversion dead.letter zed .bash_history .libetpan .vifm mail .bash_profile .links .zshrc mails .elinks .mc Mail mbox .elm .pinerc centericq.core public_html
ls -l
Showing items in nice list format.
~% ls -l total 4292 drwx------ 2 dany users 512 Apr 3 2007 Mail -rw------- 1 dany users 2138112 Oct 29 2007 centericq.core drwxr-xr-x 3 dany users 512 Sep 1 17:54 codes -rw------- 1 dany users 1 May 2 2007 dead.letter drwx------ 2 dany users 512 Apr 9 2007 mail drwxr-xr-x 2 dany users 512 Apr 2 2007 mails -rw------- 1 dany users 16926 Oct 29 2007 mbox drwxrwxrwx 5 dany users 512 Sep 10 16:20 public_html drwxr-xr-x 3 dany users 512 Jun 26 20:14 vk -rwxrwxrwx 1 dany users 1408 Jan 26 1999 zed
What is an operator
An operator is a command which tells your PC exactly what you want it to do. This is not to be confused with a operand, an operand is an arguement for the operator. For example, in the expression "1+2", 1 and 2 are operands and "+" is an operator.
Input/output operators
>
Write program output to a file, is used as follows:
echo hello world > helloworld
this writes anything that the command "echo hello world" says into the file "helloworld." Will overwrite the contents of helloworld if the file already exists.
>>
Append all output to a file, is used as follows:
echo hello world >> helloworld
this appends any data output from the command "echo hello world" into the file "helloworld." All information will be placed at the end of the file and no information from "helloworld" will be overwritten
<
Fill the input stream of a program with the content of a file (usually the input stream is connected to the commandline)
someprogram < somefile
will work as if you started 'someprogram' and typed the content of 'somefile' into the program's commandline by your own hands
|
Write the output stream of a program to the input stream of another program
Using this operator (usually called 'pipe') you can build a chain of over9000 programs using the output of the previous program as input and doing magic with it
Job control operators
&
Start a program in background, so you can continue using the shell while it's running. Whenever you start a program with the '&' operator appended, it will be assigned a job number which is displayed in square brackets. You can use this job number to bring the program back into foreground by invoking 'fg jobnumber'. To get the job into background again, you can use 'Ctrl-Z' to interrupt the program and 'bg jobnumber' to continue in background.
Logical operators
In unix systems, there are two possible values of boolean logic. Unlike in most languages, TRUE and FALSE are represented by 0 for TRUE and any number other than 0 for FALSE. However, this is actually useful here since every program has a return value which indicates if the program ran successful or not, with zero indicating success and a nonzero number failure. Therefore, a program's exit code interpreted as a boolean would be whether it was successful or not.
&&
The AND operation is true if both input values are true. Since both values must be TRUE to make this operand return TRUE, the 2nd value won't be considered anymore if the first one already was FALSE. So we can use this operator to start a 2nd program only if the 1st one we started ran successful:
program1 && program2
will start 'program2' only if program1 runs successful.
To start a 2nd program after the 1st one no matter, if it was successful, we can use ';' as delimiter between the commands.
program1 ; program2
will run 'program1' and 'program2' after 'program1' finished.
A brief history of UNIX
... floating around again ... ... originated in rec.humor.funny - January 1993 ... ... Ian Horswill ([email protected]) ...
Unix was a program gone bad. Born into poverty, its parents, the phone company, couldn't afford more than a roll of teletype paper a year, so Unix never had decent documentation and its source files had to go without any comments whatsoever. Year after year, Papa Bell would humiliate itself asking for rate increases so that it could feed its child. Still, Unix had to go to school with only two and three letter command names because the phone company just couldn't afford any better. At school, the other operating systems with real command names, and even command completion, would taunt poor little Unix for not having any job or terminal management facilities or for having to use its file system for interprocess communication and locking.
Then, bitter and emasculated by its poverty, the phone company began to drink. During lost weekends of drunken excess, it would brutally beat poor little Unix about the face and neck. Eventually, Unix ran away from home. Soon it was living on the streets of Berkeley. There, Unix got involved with a bad crowd. Its life became a degrading journey of drugs and debauchery. To keep itself alive, it sold cheap source licenses for itself to universities which used it for medical experiments. Being wantonly hacked by an endless stream of nameless, faceless undergraduates, both men and women, often by more than one at the same time, Unix fell into a hell-hole of depravity.
And so it was that poor little Unix began to go insane. It retreated steadily into a dreamworld, the only place where it felt safe. It took heroin and dreamed of being a real operating system.
It took LSD and dreamed of being a raspberry flavored three-toed yak.
It liked that better. As Unix became increasingly attracted to LSD, it would spend weekends reading Hunter Thompson and taking cocktails of acid and speed while writing crazed poetry in which it found deep meaning but which no one else could understand:
$sed <$mf >$mf.new -e '1,/^# AUTOMATICALLY/!d' make shlist || ($echo "Searching for .SH files..."; \ $echo *.SH | $tr ' ' '\012' | $egrep -v '\*' >.shlist) if $test -s .deptmp; then for file in `cat .shlist`; do $echo `$expr X$file : 'X\(.*\).SH'`: $file config.sh \; \ /bin/sh $file >> .deptmp done $echo "Updating $mf..." $echo "# If this runs make out of memory, delete /usr/include lines." \ >> $mf.new $sed 's|^\(.*\.o:\) *\(.*/.*\.c\) *$|\1 \2; '"$defrule \2|" .deptmp \ >>$mf.new else make hlist || ($echo "Searching for .h files..."; \ $echo *.h | $tr ' ' '\012' | $egrep -v '\*' >.hlist) $echo "You don't seem to have a proper C preprocessor. Using grep instead." $egrep '^#include ' `cat .clist` `cat .hlist` >.deptmp $echo "Updating $mf..." <.clist $sed -n \ -e '/\//{' \ -e 's|^\(.*\)/\(.*\)\.c|\2.o: \1/\2.c; '"$defrule \1/\2.c|p" \ -e d \ -e '}' \ -e 's|^\(.*\)\.c|\1.o: \1.c|p' >> $mf.new <.hlist $sed -n 's|\(.*/\)\(.*\)|s= \2= \1\2=|p' >.hsed <.deptmp $sed -n 's|c:#include "\(.*\)".*$|o: \1|p' | \ $sed 's|^[^;]*/||' | \ $sed -f .hsed >> $mf.new <.deptmp $sed -n 's|c:#include <\(.*\)>.*$|o: /usr/include/\1|p' \ >> $mf.new <.deptmp $sed -n 's|h:#include "\(.*\)".*$|h: \1|p' | \ $sed -f .hsed >> $mf.new <.deptmp $sed -n 's|h:#include <\(.*\)>.*$|h: /usr/include/\1|p' \ >> $mf.new for file in `$cat .shlist`; do $echo `$expr X$file : 'X\(.*\).SH'`: $file config.sh \; \ /bin/sh $file >> $mf.new done fi
Eventually, Unix began walking down Telegraph Avenue talking to itself, saying "Panic: freeing free inode," over and over again.
Sometimes it would accost perfect strangers and yell "Bus error (core dumped)!" or "UNEXPECTED INCONSISTENCY: RUN FSCK MANUALLY!" at them in a high pitched squeal like a chihuahua with amphetamine psychosis. Upstanding citizens pretended it was invisible. Mothers with children crossed to the other side of the street.
Then one evening Unix watched television, an event which would change its life. There it discovered professional wrestling and knew that it had found its true calling. It began to take huge doses of corticosteroids to build itself up even bigger than the biggest of the programs which had beaten it up as a child. It ate three dozen pancakes and four dozen new features for breakfast each day. As the complications of the steroids grew worse, its internal organs grew to the point where Unix could no longer contain them. First the kernel grew, then the C library, then the number of daemons. Soon one of its window systems was requiring two megabytes of swap space for each open window. Unix began to bulge in strange, unflattering places. But Unix continued to take the drugs and its internal organs continued to grow. They grew out its ears and nostrils. They placed incredible stresses on Unix's brain until it finally liquefied under pressure.
Soon Unix had the mass of Andre the Giant, the body of the Elephant Man, and the mind of a forgotten Jack Nicholson character.
The worst strain was on Unix's mind. Unable to assimilate all the conflicting patchworks of features it had ingested, its personality began to fragment into millions of distinct, incompatible operating systems. People would cautiously say "good morning Unix. And who are we today?" and it would reply "Beastie" (BSD), or "Domain", or "I'm System III, but I'll be System V tomorrow." Psychiatrists labored for years to weld together the two major poles of Unix's personality, "Beasty Boy", an inner-city youth from Berkeley, and "Belle", a southern transvestite who wanted a to be a woman. With each attempt, the two poles would mutate, like psychotic retroviruses, leaving their union a worthless blob of protoplasm requiring constant life support to remain compatible with its parent personalities.
Finally, unbalanced by its own cancerous growth, Unix fell into a vat of toxic radioactive wombat urine, from which it emerged, skin white and hair green. It smelled like somebody's dead grandmother.
With a horrible grin on its face, it set out to conquer the world.
UNIX admins
UNIX administrators are a charming lot, known for the luxurious growth of their neckbeards, their adept social skills and their patient and mentoring manner. It's a rare lady who doesn't dream of being courted by an administrator, and a rarer lady still who can resist his manly, musky embrace. The power of file and device permissions is not to be handled lightly, and so it is a rare breed who is trusted with the cornerstone of the company.
Administrators are most often sighted at gay social galas, in the intellectual parlors, and participating in high-profile community events. They love to play Nethack.
Video
See also
- *nix
- eunichs – most unix users
- UNIX beard
- Linux
- Linux for Niggers™
- Rogue – one of the few games made for Unix
External links
- The UNIX-HATERS Handbook
- Source of Unix was a Program Gone Bad, credited as A History of UNIX above.
UNIX is part of a series on Visit the Softwarez Portal for complete coverage. |