Hello! This is the Linux thread. Herein, we discuss all sorts of nerdy crap related to GNU/Linux, as well as other more esoteric operating systems.
Bits of this OP stolen from previous OPs and contributions by Visti
What is Linux?
Linux is an operating system, like Windows or Mac OS X. It's popular with many for both practical reasons (stability, performance and reliability) and 'political' reasons (its freer, open-source nature).
GNU/Linux (its proper name) is a base operating system with countless variations (known as Linux distributions). GNU – a recursive acronym for “GNU's Not Unix” - is where most of the userland 'linux tools' come from. While technically not code compatible with Unix, it is for all practical purposes a Unix clone. Linux is its kernel, which handles all of the 'behind-the-scenes' stuff for the operating system. People often refer to GNU/Linux as simply 'Linux' because, let's be honest, “Linux” sounds a lot cooler that “guh-noo-linux”. GNU's been around since the 80s, but had never been part of its own 'real' operating system until the release of the Linux kernel in 1991.
What sucks about Linux?
Fewer games, no Final Cut or iTunes.
Then why should I use Linux?
It's famously stable (it runs most of the internet), it's high-quality software, no defragging, no bloat, no viruses. Also, it respects your freedom.
Okay, I'm interested. Now what?
It's generally recommended that newcomers start off with Ubuntu GNU/Linux. Ubuntu (and its derivatives) is basically Linux made easy, and very popular for that reason. It's also just a good operating system, despite what its detractors will tell you.
Tell me about other Linux distributions!
Happily. While Ubuntu is perfectly fine, there are a number of other popular distros that may better suit your tastes.
Quit holding out on me. I want some hardcore Linux!
Mint is an Ubuntu-based distribution with even more 'good stuff' included by default.
Fedora Linux is Red Hat's free, 'bleeding edge' distribution. A word of caution: Fedora doesn't ship with all the proprietary good stuff that Ubuntu and Mint do, which means that playing MP3s or using Flash is more of a hassle.
openSUSE is your run-of-the-mill Linux distro, quite good but seemingly targeted more at small busineses than the previously listed distros. openSUSE has never blown my mind, but it's always been perfectly serviceable and I note that its proponents are often very loyal.
Debian Linux is one of the older distributions, and of the still-existing distributions around today, is predated only a number of months by Slackware Linux. Unlike Slackware however, Debian is very easy to install and use for your average, every-day user. The software it provides isn't bleeding edge by any measure (its most recent official release still ships with Firefox 3.5), but this is a tradeoff for its famous stability. It's a very boring distribution, but if you need something that will just keep going forever, here you go.
Oh you do, do you? Feeling that neckbeard growing in good and thick? Alright, here are a few other distributions that may suit you a little better.
Any other distros you'd like to throw at me?
Arch is a modern, minimalist rolling-release distribution.
Slackware is a very old, very stable distribution.
Gentoo is the nerdiest of almost all distros, with the possible exception of Linux From Scratch.
Alright, so there are a lot of distros. But what does it look like?
Crunchbang (#!) is a minimalist, Debian-based Linux distribution that ships with the Openbox window manager.
I'm not a huge fan of Puppy Linux myself, but if you've got older hardware then this is the OS you've been looking for.
Trisquel is an Ubuntu-based distro with all non-free (free as in speech) software removed. Its goal is to provide an operating system that's quality software while still consisting of nothing but Free software with a capital F.
I'm glad you asked. In Linux-land, you can theme your desktop however you'd like. Hell, you can even live on the command-line with no GUI whatsoever if you want. But for most people, they're interested in what Desktop Environment (or Window Manager) looks like.
Each Linux distro tends to ship with one or more DEs/WMs. Usually just one. If you don't want to mess with the way things look, you're fine just using whatever your distribution ships with. Fear not, however: If you so desire, making use of additional DEs/WMs is usually just a matter of finding it in the repository and installing it. You can have as many as you want installed, switching between them whenever you feel like. That's what I do.
Here are a few examples to give you an idea of what to expect. I've organized them into three categories: Fancy (modern), Traditional and Other. For simplicity's sake (and for the sake of not hitting the character limit for this post), I'm going to skip over quite a lot. I guess you could say these are the 'big ones'.
Gnome Shell (Gnome 3)
Highly polished 'tablet-esque' interface. Not as bad as people say.
A nicely polished, traditional desktop environment. Think Windows Vista except better.
Ubuntu's new desktop environment. Think Mac OS X mixed with Gnome with the Windows 7 taskbar tilted sideways. Not bad.
A good, somewhat lightweight desktop environment
A decent, stable desktop environment
Lightweight desktop environment
You know, I'm not quite sold on Linux. What other Operating Systems you got?
Minimalist stacking window manager
Slick, lightweight stacking window manager
Lightweight dynamic (tiling/stacking) window manager
While I myself am most partial to Linux, I realize that perhaps not everyone is. And hey, that's fine. It's a big wide world where we can all use whatever the hell we want to... at least, for now. So without further ado, other operating systems:
: A popular BSD variant.
: A 'normal people' desktop OS based off of FreeBSD.
: A fork of FreeBSD 4.8, created for 'performance reasons'
: Another popular and incredibly secure Unix.
(formerly Opensolaris): Used to be more popular, but now Oracle owns it. As far as I know, it's still free of cost but consists of both open and closed source components.
Handy command and shortcuts:
: An OS loosely based on BeOS. I've tried it, and it's not bad. But don't take my word for it... let this
guy sell it to you.
: An OS designed to be binary-compatible with Windows in every way. Essentially, a drop-in replacement for Windows.
: An AROS operating system... sort of a modern Amiga OS.
: A neat hobby OS written entirely in assembly language. It's impressive how much you can cram into 37mb when you're writing in assembly.
: Another Assembly-language-built OS. In fact, a fork of Menuet OS.
These are only useful to you if you're already knee-deep in Linux. If you're new to it all, skip right on by.
Keep in mind that these are only the most basic forms of each command, and that they all have dozens of switches and caveats that enable you to do awesome things with them.
cd <directory> : change current directory to <directory>
ls : list directory contents
ls -a : list directory contents including hidden files
ls -l : list directory contents in detailed list format
mkdir <dirname> : make subdirectory <dirname> (can also specify full directory e.g. mkdir /home/thesquid/giantAngryBear)
rmdir <dirname> : deletes empty subdirectory <dirname>
cp <file> <dest> : copy <file> to <dest>
cp -r <directory> <dest> : copy <directory> and everything inside it to location <dest>
mv <file> <dest> : moves <file> to <dest>
rm <file> : removes (deletes) <file>
rm -r <directory> : removes (deletes) <directory> and everything inside it
chown <user> <file> : change user ownership of <file> to <user>
chgrp <group> <file> : change group ownership of <file> to <group>
chmod XXX <file> : change permissions of <file> to octal number XXX (probably best to 'man' this one)
touch : change file timestamp (and will create an empty file if it doesn't exist)
man : gives the manual page on any command including all of these ones (lol man mount)
man -k <string> : gives a list of all man pages with <string> in the title or short description
less : an extremely simple viewer of plaintext files, has regex searching and up/down movement
more : an even simpler viewer than less (now you get the less is more than more gag in bash)
view : a read-only version of vim, so has all the vim commands, but you can't edit the file
vim / emacs / pico / vi / nano : complex text editors that support enormously complicated yet awesome shortcuts, syntax colouring, the whole shebang
SYSTEM STUFF: (you will probably need to be root to take advantage of these)
top : display Linux tasks (equiv. to Task Manager) htop is a widely preferred and more interactive alternative
ifconfig : for configuring network interfaces (setting ip address, activating and deactivating network cards)
iwconfig : for configuring wireless network interfaces
iwlist : getting more info from a wireless network interface (especially seeing wireless networks in range)
route : show / manipulate the IP routing table
dhclient : DHCP client
lshw : list hardware
lspci : list all PCI devices
lsmod : list modules in Linux kernel
modprobe : add / remove <module> from Linux kernel
mount : mount a file system
umount : unmount a file system
wpa_supplicant : for connecting to WPA networks. Requires several reads of the man page, editing of a configuration file by looking at several example files for clarity, and possibly carving arcane symbols into your face.
tar : for making tarballs of a directory / several files
gzip : for compressing said tarball using *.gz
gunzip : for uncompressing a gzipped file
bzip2 : for compressing said tarball using *.bz2
bunzip : for uncompressing a bzipped file
tar xvfz <file> : for uncompressing a *.tar.gz file
tar xvjf <file> : uncormpressing a *tar.bz2 file
date : printing the date and time
ping : to ping
pwd : print out current directory name
killall <process> : kills all processes of name <process>
ps -aux : prints a snapshot of all current running processes
kill <jobid> : kills process of job id <jobid>. <jobid> can be found with ps -aux or top
which : locates a command
Once again, newbs should just ignore this section.
Other random Linux(ish) resources:
Videos (or Linux shows):
Nixie Does Linux
TWIL (This Week in Linux)
Searching for a file based on file name:
e.g. I want to find all the files in the current directory and any subdirectories that start with Photo and end in jpg, such as Photo322.jpg.
Command: find . -iname "Photo*.jpg"
English translation: find, starting in the the current directory (the "." argument), any files that match the name "Photo*.jpg" in a case insensitive fashion (the "-iname") argument.
Notes: It is very important if you are passing wildcards to find that you escape the wildcards by using \ or ". If you do not, then the shell will expand the wildcards on the command line and your command will then be the equivalent of:
find . -iname
Doing the same operation on a bunch of files
e.g. I want to gzip up each text file in the current directory into their own separate archive
Command: for eachFile in *.txt; do gzip "$eachFile"; done
English translation: Take the list of files that are returned by *.txt. Go through each of those filenames in the list one by and one, and each time
1.) Assign the current filename to the variable called "eachFile". This can be accessed by $eachFile.
2.) Execute the command between "do" and "done". In this example, it is gzip "$eachFile".
Notes: "$eachFile" is enclosed in quotation marks so that any filenames with spaces get passed correctly to gzip. The semi-colons tell the shell that a command is done and to treat anything after the semi-colon as a new command. If you wanted to, you could have the loop do more than one command on a single line, like so:
for eachFile in *.txt; do gzip "$eachFile"; mv "$eachFile".gz .. ; done
Any more complexity, and you're probably at the stage where you should be writing a script instead of trying to fit it into one line.
* Displaying the contents of files/simple manipulation of standard input
Head will show, by default, the first 10 lines of a file, or if no filename is provided, then standard input.
Tail will show, by default, the last 10 lines of a file, or if no filename is provided, then standard input. Useful for looking at log files.
cat will dump the entire contents of a file to standard output (typically the screen, but often not). If no filename is provided, then it will basically echo standard input to standard output.
This is useful in creating simple files. e.g. I want to create a file called "hello.txt" containing the line "This is a test"
cat > hello.txt
This is a test
(Ctrl-D signals end-of-file).
To *append* something to an existing file:
cat >> hello.txt
This will be the second line of the file
Note the >>! If you just use >, you will overwrite the file, instead of appending.
* Displaying something to screen
echo Hello world!
The echo command will echo whatever arguments is passed to it back to the standard output. Typically used in scripts to show status reports.
Chaining it all together!
Let's list the first ten lines of every text file in the current directory and pretty it up with a header.
for eachFile in *.txt; do echo "*** Ten lines of $eachFile ***"; head "$eachFile"; done
Oh crud, it went by too fast to see it! Hang on - we know that we can use 'less' to view text files
for eachFile in *.txt; do echo "*** Ten lines of $eachFile ***"; head "$eachFile"; done | less
Tada! (push 'q' to quit from less, by the way).
Replace with appropriate options for those times you want to sort mp3 files, or photos, or whatever.
(he also has a twitter feed
Linux Action Show (Jupiter Broadcasting)
Welcome to Vim (Derek Wyatt's video series)
Podcasts: (here's another list with even more shows)
GNU World Order
The Linux Link Tech Show
Hacker Public Radio
Interesting or useful texts:
The Cathedral and the Bazaar
In the Beginning was the Command Line
The Coming War on General Purpose Computation
The Art of Unix Programming
A Brief History of Hackerdom
The Jargon File
Unix for Beginning Mages
Nope! Just get your hands dirty and you'll find that you have the hang of this in no time. If you have any questions, you can either ask in this thread or consult these other resources:
...and also, this: