When I was first interested in trying out Linux, the whole geek culture surrounding it seemed gargantuan, judgmental, and scary. It’s very hard to get a straight, simple answer out of these people. They’re tribal and prone to speak in exact phraseology with caveats and “It depends”.
Here is a bare-bones, one-liner guide to answer the question: I want to try Linux. What flavour of Linux should I try?
- I just want the easy default. Use Ubuntu.
- I want to get an old, crappy, cheap computer up and running. Use TeenPup or BrowserLinux.
- My hard drive is kaput. I want to use Linux to view my old files and try to recover as much as I can. Use Damn Small Linux.
- I want a focussed, serious environment in which to write computer programs. Use ArchBang.
- I want to be a bad_ss hypergeek. There are a zillion weird, customisable options for you. Start your googling, you’ll be able to keep busy reading man pages for the next 71 years.
All of the above “distros” can be installed by: (1) downloading an
.iso file, (2) burning the
.iso file to CD, and (3) popping that CD into your computer before you turn it on.
That narrows your distro choice down. (If you still haven’t decided yet: choose Ubuntu.) Now all the web browser stuff (gmail, facebook) will be basically the same in Linux as in Windows. What will be different is that the command line (
Run > cmd in Windows—your MS-DOS prompt) is much more extensive and besides Linux being free, the other reason to use it is to get access to these tools. [NB: If you own a Mac rather than Windows, there’s less reason to switch to Linux at least on this computer. But your Terminal will still run these same commands so even without switching you can do all of the below.]
Here are a few things to get used to with the Linux terminal (command-line) environment:
lslists the files in the current directory,
.means “this directory” and
..means “the parent directory”.
<tab>completes the word you’re typing, so you can avoid typoes.
<up>cycles through commands you’ve just typed in.
rmdeletes things forever, so never use that. Make a
delcommand as below and use that instead.
mvrenames files as well as moving them to a different folder.
mvboth it is very easy to accidentally delete something you don’t want to delete. The solution is to run the following command first thing you do in Linux:
cat >> ~/.bash_aliases <::ENTER key::> alias mv='mv -i' <::ENTER key::> alias rm='rm -i' <::ENTER key::> alias del='gvfs-trash' <::ENTER key::> <:: Ctrl+D: hold in CTRL key, stroke D key, let go of CTRL key::>
- A hyphen following a command (like
mv -i) is a “flag”
/home/jamalis where your files are.
~is short for
/usr/share/bin, and even
/etc/init.d/sshcan contain program files, like
C:/progra~1/did on Windows.
/var/logis where system logs are.
/var/wwwcontains public files that a web server would show, to anyone who can connect through the internet to a communication socket to your computer.
sudo apt-get install MyLittlePonyis how you install the program MyLittlePony.
- Some common commands:
history | grep,
mv -ito rename or move a file,
tar -xvfto “unzip”
nanofor a Linux equivalent of Windows Notepad,
ssh email@example.com log into a free remote Unix computer,
rsync -avzto transfer files from one computer to another,
chmod u+x programname.perlto make
./programname.perlto execute it;
df -hto see your available disk space,
free -mto see how much RAM (=memory = “thinking space”) is available,
wget http://www.gutenberg.org/cache/epub/16955/pg16955.txt > qu'ranor
curl http://www.gutenberg.org/cache/epub/16955/pg16955.txt > qu'ranto download a copy of the Qu’ran.
command -a -b filename -c setting -dstyle is really common. It is a different way of running programs than clicking on
File > Options > Preferenceslike the familiar graphical menu interface. Technically this way
wget --random-wait -r -p -e robots=off -U mozilla http://isomorphismes.tumblr.commeans “Run the program called
wget(it’s a program that downloads from the web). Turn on the
random-waitoption. Turn on the
roption and the
man wget, then type
/-pto find out what they do.) The drop-down menu would normally have prompts or boxes for you to fill in on a
File > Options > Preferencesstyle menu interface. But here you first look up what
man wgetand then type in the options and what they should be set to, yourself. Finally the “argument” of the
wget“function” is the web address you want to download. Incidentally, this command backs up my tumblr blog to your computer.
cd ~; ls | grep bash. It will not display the
.bash_aliasesfile because it’s hidden. Now try
ls -a | grep bash. It will display the
ls -ameans “list all, even hidden files with a
.in front of them”.
- Google “Unix for Poets”. In about 20 pages it will show you how the command line can be used to process text. For example how to count which words were used most in your thesis or the Bible. Commands like
trto usefully transform plain text files.
- You can learn
hgand use it to keep track of changes in your thesis. Or learn
sedand massively edit changes to a large document, all at once.
- I also like
tmuxwhich allows me to manage “windows” within the terminal console.
Ctrl+Dmeans “I’m done”. For example in writing over the
~/.bash_aliasesfile. Also for example if you want to log out of
ssh firstname.lastname@example.org an
Ctrl+Cmeans “Cancel that!” If something is happening that you want to stop immediately, with no politeness or “I’ll wait until you’re finished”. For example if you
sudo apt-get installsomething and then realise you didn’t want to, hit
Ctrl+C. Or if you’re playing some music with
zomgand immediately need to quit!!! then you can force-quit with
Why would you want to switch from Windows to Linux in the first place?
- You want to learn to program. Programming “just works” in linux and there are a lot of annoying steps even before Step One in
- You want to learn to sysadmin. Most servers run Linux (CentOS, SuSE, and Redhat are common). You may as well play around and learn on your own machine first.
- You don’t want to pay for your OS. It actually doesn’t take that much patience to get Ubuntu or Puppy up and running these days.
There are other reasons (like maybe you hate corporations) but I find the above the most compelling.
I’ll do another post about “Which programming language should I learn?” in a similar brief style.