The Command Line Crash Course Controlling Your Computer From The Terminal
learncodethehardway.org
learncodethehardway.org
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')
The author's view is definitely too pessimistic. Most people on IRCs like Freenode aren't evil 'hackers' out to 'hack' you (this reminds me of an episode of Numb3rs.) Other smaller IRC servers can get rowdy, but I've yet to see that on Freenode et al.
I think much better advice would be to not randomly execute crap you see online without knowing what the program is and does, especially in root.
That doesn't mean that they're all saints, I just find it comforting that there are people out there who will gladly assist a complete stranger (in my case, me).
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.
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.
But scripted or not, someone did you a favor.
For a reference point, a (very technical) friend at a large tech company had to fire up a fresh Windows VM in order to complete some Windows/IE-only internal web app form.
He was p0wned within 5 minutes. On the corporate LAN. Stats I've seen are that an unpatched WinXP box (pre-SP2) was getting p0wned within 15 seconds, on average by the mid/late oughts. Scripted attacks are that fast and easy.
Scanning an IP range for open telnet ports (n00b move #1) and attempting root logins on same (n00b move #2) with weak passwords (third strike) is pretty trivial. Could have been another AOL user, could have been someone's IRC bot / autoattack.
While not blaming the victim, you discovered (on a freshly installed, no-real-data-present-yet box, hence, very inexpensively) that You Don't Do That[tm].
So: stop crying over this and put on your Big Boy pants. That asshole did you a favor. Really.
In what world do you think that
1) I'm 'still crying' over something that happened 17 years ago by relating it in a comment
2) It's appropriate to tell other professionals relating a story to 'stop crying'
It's certainly not this one.
I am saying that, yes, he did something stupid and got spanked for it.
I'm also saying (and in my highly downvoted follow-up providing additional examples of) that it's reasonably if not highly plausible that the attack was wholly scripted and automated.
I've been burned myself -- by systems stuff as well as meatspace events. Very often the key finding of a particular experiment is "don't do that".
That was my point.
It would be simpler just to tell the student to not run any command unless he or she can explain exactly what the program and arguments mean.
Lesson 1: Register with a female nickname: Jane123, KatyG, ... You'll see response time shorten dramatically.
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.
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... .
Cheers,
> 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.
The "learn by rote" method he's using here is designed to help people with little or no experience catch up quickly, and remember what they've learned without the many years of daily use.
If you just want to learn the odd helpful new trick, and basically know what you're doing, just ignore these parts.
> No, seriously, type it 20 times and say it out loud. Sssh. Just do it.
I supposed it was a kind of cold joke but it appears not to be. It is just very disrespectful for the reader. Grown up human beings are not to be taken by the hand like /this/ to learn something as serious and advanced as command line.
Also, smart people learn to skim and skip when needed. Writing like thus serves both cause the smarter ones skip.
(As any short description, my "portrait" maybe a bit of a caricature but I believe it expresses the meaning well enough.)
1. All geeks learned the command line at some point. Even Linus. Calling the next Linux a "wannabee geek" is wrong.
2. basic training is for all soldiers, not just infantry soldiers. You choose infantry for the baggage it carried, and you didn't care that you were flat wrong.
3. I find your use of "pavlovian reflex" wrong. It has a negative connotation, but is all reflexive action "pavlovian". If so, all of my command line use is pavlovian because I do it reflexively without conscious thought. With that in mind, the military style is perfect because it's designed to train people to do things reflexively when the time comes.
4. basic training teaches many great things. You're dismissal of it as teaching people to "run below a shower of bombs" is wrong. I learned CPR amongst many other good things in basic. Things that again require one to do them almost reflexively, just like I use the command line.
In short, you are wrong.
2. It was an example and he never said basic training was ONLY for infantry.
3. You say all reflexive action is pavlovian but then say that using the term pavlovian reflex is wrong. That is wrong.
4. He never indicated that basic training doesn't teach some decent things. However, it does also teach people to act on orders without thought. You may not like the reality communicated, but the reality is that one of the objectives for basic training is to indoctrinate and enforce conformity. So that when you do have to run below a shower of bombs and bullets you don't question it, you just do it.
In short, nothing he wrote was wrong. You just didn't like it.
He thought otherwise, and since this the core of the issue, I believe he is wrong on the primary point.
His wording was intended to imply negative things with loose language, and if you can't see that then you can't.
I'll give one example. I said, "Grown adults are taught in a manner similar this everyday in basic training for the army."
He said, "You can't seriously compare teaching command line kungfu to some wannabee geeks in their spare time with the hardcore brainwashing given to infantry troops so they acquire enough Pavlovian reflex to stand and run below a shower of bombs and bullets."
You claim he didn't say that basic is ONLY for infantry. True, but then I have no idea what he was saying. I said that basic is a good model for teaching reflexive action. He was responding to that, so he was either creating a straw man with the infantry thing, or he did get it wrong that basic is ONLY for infantry.
Right?
A wannabe (slang for "want to be") is a person with an ambition to be someone or something that she/he is not. The term is pejorative and intends to convey the foolish nature of the desire due to the incompetence of the "wannabe" to accomplish the goal.
Seriously. Shh. Just do it. Shh meaning stop all the opinionating. Just do it meaning only do that and not all the surrounding fuss and bluster.
It's not disrespectful, it's pragmatic, you're reading his book to learn, what are you doing thinking things like "I don't want to type it 20 times, I've typed it 5 times and I know it already, this is stupid, it's boring, I'm not saying it out loud, that's embarassing, blah blah blah"? You chose to read this book to learn, do what he says. No, shh, just do it.
"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.
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.
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.
Copy and pasting usually means you never knew what the code said anyway.
Typing it once means you will remember it till the end of the day but tomorrow? The day after?
Typing it 20 times and saying it out loud to yourself helps it stick. There is no need to run to Google to look up the command. You should know it after doing it this many times. Especially if in the following days you recap with some basic memory exercises.
I have always thought that this is what set's Zed Shaw's books apart. They teach you a language in a way that sticks.
If you don't find it useful or for your style of learning pick up a book focusing more on theory rather than doing.
That's a problem with you which you should fix, instead of getting all defensive and whiny.
I don't like "for the dummies" books either, I think this relatively new way to write books teaching something is no good for anyone. Showing a supposedly humorous disrespect for the reader seems to be acceptable in some cultures. It is not in mine. A very strong bullshitting of the reader is ok in some literary works, as it is part of the facture of the book (I am thinking LF Celine), but it is not ok in utilitarian literature.
But, you'd tell me, it is a first-world problem, I can live with this new trend (it will be replaced soon enough), as long as I am allowed to express out-fashioned point of views in places like HN.
Though you see that your culture is not everyone's, not acceptable within your culture is not equivalent to not acceptable full stop.
Not everyone agrees with your permissions rule distinctions between instructional works and literary works, but this does not mean that what they are doing is not ok.
Being criticized is not the same as not being allowed to express yourself.
P.S.: Characterizing all possible arguments against your position as soon to be replaced trendiness disqualifies anyone from having a discussion on this subject with you, and pre-insults anyone who would want to.
Just a note: When I said "Showing disrespect for the reader seems to be acceptable in some cultures. It is not in mine.", it was just a polite way to say. (To say what? I just wrote it, but after some thought I yanked the thing. It was talking about culture as universal need for cultivation of oneself, aka education, aka civilization.)
I'm sure better tutorials have been available for years. E.g. http://linuxcommand.org/learning_the_shell.php
What happened: People reporting of being insulted.
So you failed, why not use the feedback to improve the thing instead of making it personal.
I don't think that's part of the goal.
$ 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.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.
But, PLEASE, do not pass the PDF around to newbies until I say it's ready. Having old versions with potential errors floating around or that are half-done is really bad for them.
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.
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.
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)
It's worth it. It really is. At some point you will marvel that you ever thought it was a good idea to navigate filesystems with the mouse, or edit text in a non-modal editor.
- 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.
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.
Really, though, wpa_supplicant seems to be the most troublesome critical wireless "primitive". Not fun command line syntax.