
The Command Line Crash Course Controlling Your Computer From The Terminal - goodweeds
http://learncodethehardway.org/cli/book/cli-crash-course.html
======
jimmyjim
> The next warning is stay off IRC or other places where "hackers" hang out.
> They think it's funny to hand you commands that can destroy your computer.
> The command rm -rf / is a classic that you must never type. Just avoid them.
> If you need help, make sure you get it from someone you trust not from
> random idiots on the internet.

I don't really agree with that. I know for sure that popular channels in OFTC
and Freenode are monitored by very smart and responsible people that would
never let this happen. In my many years on IRC I have not seen a single novice
guy looking for help actually get had by someone intentionally trying to
mislead/screw over.

I would instead encourage novices to read this:
<http://catb.org/~esr/faqs/smart-questions.html#usefora> (' _How To Ask
Questions The Smart Way: Web and IRC forums directed towards newbies often
give the quickest response_ ')

~~~
dangrossman
My first experience on IRC was looking for help with my first Linux install.
Someone in the channel telnet'd into my computer and wiped my hard drive while
I was chatting.

I was 9 or 10 years old at the time and my root password was one of those
common strings (12345, abcde, I don't remember at this point). It had taken me
3 days to learn how to download Linux, make a stack of installation floppies,
find and use partitioning tools, install Linux and set up a boot loader, etc.
I cried when I realized what had been done to me.

~~~
dredmorbius
Unless someone 'fessed up to it, you really have no way of knowing who did
this. It could just as easily have been a drive-by script.

And regardless, it was a hard, cheap, early lesson in the importance of
ensuring fundamental levels of system security. I've ... suffered worse.

I strongly suspect you'll never forget this.

~~~
dangrossman
This being more than a decade and a half ago, I doubt it was a drive-by
script. I was dialed into AOL on a 4 letter screen name. I had just informed a
channel of Linux users, who knew my public IP, that I had just installed Linux
for the first time. The chances it wasn't someone from that IRC channel are
near zero.

~~~
jebberjeb
stop crying

~~~
jebberjeb
Hah! Downvote it all you want, you know it's true. He needs to stop crying.

------
qjz
File and directory names can contain spaces and require special treatment.
This should be addressed up front, before introducing commands with side
effects.

~~~
zedshaw
Oh yeah, thanks I need to put that early in the exercises.

~~~
keithpeter
How about including some examples of globbing all files of a given type
including filenames with spaces?

e.g. 1) Find all file names in a directory that contain spaces and replace
spaces with _

2) E.G save mp3 format sound out of a directory full of flv files using
ffmpeg, flv files can have arbitrary file names, mp3 file names saved with no
spaces

That kind of activity would be interesting to younger proto-hackers

I'm a teacher. A group of teenagers in a computer room (which is not your
target audience) would not actually _read_ your tutorial in an a to b fashion,
but, when set a task would raid your work for the bits that help then achieve
the task. I'd then follow up with a multi-choice quiz in Moodle or something
similar to structure recall like your flashcards.

------
jseliger
I just wrote to Zed:

I haven't read past section 0 yet, but I do have a suggestion for people who
want to learn how to memorize things faster: use SuperMemo or a modern
equivalent, like <http://ankisrs.net/> . Such programs use spaced repetition
techniques to improve memory speed. I used Anki for improving my French and
recommend it. If you'd like to learn more, see
[http://www.wired.com/medtech/health/magazine/16-05/ff_woznia...](http://www.wired.com/medtech/health/magazine/16-05/ff_wozniak?currentPage=all)
.

Cheers,

~~~
mekoka
Anki and Mnemosyne (<http://www.mnemosyne-proj.org/>) are both available from
the Ubuntu repos.

------
minikomi
I was recently given a small netbook and took the plunge with arch / xmonad
and it has been pretty eye opening.. Going from "I need more control over
screen brightness", to being able to assign keys that control the display
precisely how I want has been frustrating and satisfying in just the right
way. Thanks Zed for another great source!

------
gbog
On page 3, about "whoami"

> type this command 20 times and say it out loud

I have many years of daily command line use behind me and never needed to use
this command. I don't like being taken for a child.

~~~
grannyg00se
I agree. The tone is not for me and it sounds really put on.

"The only piece of advice I am going to give you is this:

Shut the hell up and type this in then try to understand it.

Sorry to be mean, but that's what you have to do. You have an irrational fear
of the command line and the only way to conquer an irrational fear is to just
shut up and fight through it."

Why say "shut the hell up"? Why assume that the reader has an irrational fear?
Most people are just trying to learn because they currently don't know. Not
because they are afraid. They don't need some kind of drill sergeant to
aggressively push them into it. They've already taken the initiative to seek
out the knowledge and begin reading it.

~~~
zedshaw
Is it the word "hell" you disagree with or being told to do something? If it's
"hell" I can remove that. If it's just because you don't want to be told to do
something then don't read my book. You won't learn anything from it since the
entire book is me telling you to do repetitive boring tasks.

As for why I wrote it: _You_ may not have an irrational fear but a huge number
of Windows and OSX users do. They've been told that the CLI is dangerous and
antiquated so they avoid it and panic over it. Having someone like me just
push them through actually gets them past that and on to learning how to use
it.

~~~
grannyg00se
First off, thanks for writing something like this in the first place. I do
believe that overall it is a helpful addition to the vast collection of
instructional material that is available online.

Regarding the tone of the text, it's not the word hell specifically - it's the
overall tone, which is echoed elsewhere. You could've said "Shut your yap..."
and that would have been just as bad. Why are you browbeating or scolding your
readers as though they are misbehaved children? Telling someone to shut it is
condescending, dismissive, offensive, and simply rude.

It's like you're trying to help me, but you've been pushed into it and are now
pissed off. And god damnit we're going to get through this one way or the
other and if you have to beat me into submission and force my hand then that's
what you'll do.

It's just a personal opinion. I find it makes the experience less pleasant
with that kind of writing.

------
8ig8
I know the OP is not the author, Zed Shaw, but I simply wanted to say Thanks
to Zed for this.

~~~
zedshaw
You're welcome.

------
sc00ter
pushd / popd where have you been all my life?! How did I not know this? Thanks
Zed!

~~~
dboyd
Related to that... the 'cd' section seems to be missing "cd -" (ATM).

    
    
        $ cd /some/really/long/dir
        $ pwd
        /some/really/long/dir
        $ cd ~
        $ pwd
        ~
        $ cd -
        $ pwd
        /some/really/long/dir
    

I'm pretty sure "cd" and "cd -" are my most used commands. CDPATH ranks pretty
important too.

~~~
kkwok
What is the difference between the three?

~~~
oscardelben
~ is your home directory. - is the last directory you ran cd from. For CDPATH
see this <http://www.caliban.org/bash/#bashtips>

------
robert_nsu
I've been watching this for a little while. With powershell, a lot of the *nix
commands have been or can be aliased to the windows commands (e.g. ls and Get-
ChildItem). Judging from his notes so far, he isn't taking advantage of this,
but hopefully he will.

------
jgmmo
I got 1 upvote for anyone that can provide me a pdf of this thing.

~~~
brewerja
<http://dl.dropbox.com/u/8605032/cli-crash-course.pdf>

git clone git://gitorious.org/the-cli-crash-course/the-cli-crash-course.git

Use dexy with a Tex install and it's a cinch. Only hiccup might be a few
specialized Tex packages it complains about needing.

~~~
jgmmo
I was very psyched to see this, however, I am afraid to tell you that this is
missing parts of the text. It is missing the 'Do This/Source Examples' - a
vital part of the text for sure. Replace with fixed copy and report back!
Thank you kind sir!

~~~
brewerja
Updated to the latest version of dexy and all appears to be well. The link
should now have a working copy.

~~~
jgmmo
Very good, thank you!

------
eliben
Zed's productivity is truly inspiring

------
xradionut
Am I just a cranky old geek or does anyone else find Zed teaching CLI skills
mildly amusing? Or is there truly a large population mentally bound by the
graphical interface?

Know the basic commands of getting things done isn't just for the experienced
admins/developers like myself who have been using keyboards and terminals
since the early DOS and VMS days. Ordinary users were able to create
documents, check mail and write simple Excel macros, etc. Coworkers shared
tips, people had books and kept notes. None of this has ever been rocket
science.

~~~
zedshaw
Yes, sadly Microsoft (and to a certain extent Apple) have done an excellent
job convincing people that the CLI is both dangerous and antiquated. So when
they come to my other books and I tell them to use the CLI they have major
problems. I'm writing this mostly as a quick way to get them over that speed
bump then on to more useful programming topics.

------
JJMalina
I've been waiting for something like this. Thanks a lot Zed!

------
jisaacstone
Once again - another resource with almost no windows support. At least he has
a todo. . .

Back when I just did PHP and never used a command line having a widows box was
painless. Recently I have been learning UNIX at work and Python at home and
have been impressed by the lack of resources/support for working with Windows.

I suppose I should stop complaining and just blog what I've learned so far . .
. though admittedly it isn't much.

~~~
readme
No problem, just install mingw. Or install msysgit and you get git-bash which
comes with it. CMD.exe is a pile of garbage. I would understand if you wanted
to learn about powershell, though. That's definitely on my todo list.

Also, CMD.exe has copy + paste, you know? You can right click to start a mark,
then left click and drag. Enter performs the copy. However, it doesn't
understand newlines or line wrapping, so you end up getting artificial
newlines where the end of the terminal is (which is unfortunately capped at 80
chars, so if you wanted to make it bigger, you couldn't)

------
aridiculous
I like the tone of the books. It makes things interesting and you feel like
stuff is getting done. Just wanted to throw that out there since most of the
comments are complaining about it. I don't want you, Zed, to get the
perception that everyone is sheepish about it.

------
achompas
Was talking about going Linux soon, and this'll help me work from Terminal
exclusively. Thanks!

~~~
pault
I use a macbook as my main workstation, but all my development happens in
linux VMs. It only takes a few minutes to install a headless ubuntu in VMWare,
so I create a new one for every project I start. This has several advantages:

\- No configurations/installs from previous projects screwing things up (I
know you can use tools like RVM and virtual-env, but in my experience starting
from scratch is easier).

\- Snapshots. It's great to be able to restore from a snapshot when you bork
an upgrade.

\- I've become very good at configuring a basic LAMP stack from memory.

Screen+Vim and the ability to suspend/resume machine images makes for an
extremely flexible and ubiquitous development environment. I've considered
doing this with AWS but there are still odd times where I find myself without
an internet connection.

~~~
cturner
Hey - I like doing this but find the power consumption of my laptop goes
through the roof, and it gets uncomfortably warm. Does anyone have any tricks
for beating this? I've just upgraded to latest vmware but haven't deliberately
tested this yet.

------
gcb
always considered myself an ace of the command line... heck for some time i
even used X only for webbrowser (while cursing) and used TTY1 for vim and TTY2
for a shell where i'd run version control commands and build...

but yesterday, installing debian-testing on a new notebook, the radeon cards
didn't worked out even with the vesa drivers and i had to use the console for
a few hours...

i panicked when i realized I had no idea how to bring the wifi up.

...and everytime something like this happens (previous one was some punk
changing the kernel parameter "single" or "1" or "init 1" to "text")... i feel
old and outdated. it hurts.

~~~
Adaptive
I find wifi on the command is still surprisingly hard if using just primitives
like iproute2. I'm trying to force myself to use just that for a bit to learn
the new(ish) ip / iw commands.

Really, though, wpa_supplicant seems to be the most troublesome critical
wireless "primitive". Not fun command line syntax.

~~~
tsm
I've had successful experiences with ceni--a relatively unknown interactive
network manager. <http://ubuntuforums.org/showthread.php?t=918442>

