Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: UNIX / Command Line tutorial for non-dummies
14 points by crux on Jan 7, 2009 | hide | past | favorite | 15 comments
Dear HN:

I've recently begun the process of hosting a website for a friend on mine. He'll just be running a wordpress install, but I'm giving him shell access and it would be nice if he was able to do basic php and css config himself if he needs to. That said, he has basically no UNIX experience. He's not a computing novice - he's currently working through a python programming course, for instance - but he's never used GNU/Linux, and whatever OS X experience he has is pretty superficial.

Do you all have any favorite tutorials to get him up to speed with sshing into GNU/Linux shell account running bash?




Please set up automatic system imaging for your server (e.g. Slicehost backups). The biggest barrier to learning is fear, so it helps him to know that he can press the "undo button" for the entire system at any time.

Other than that, I recommend letting him watch you use the terminal for 20 minutes to show him what proficient console use looks like. Advanced commands can be Googled later, and those "Unix Cheat Sheets" and cram tutorials were always simultaneously too complex and too simplistic for me to ever find useful. A working understanding would be more valuable.


Make your own. Most Unix tutorials are particularly poor: as Unix attracts people who like technology (good thing), documentation is technology focused rather than task focused (bad thing).

* Logging in

* Making a test file. Making folders, copying, moving, removing files and folders.

* Show how the filesystem standard sorts files by type (binary, system binary, library, config files and service scripts) and by importance (required to recover the system in an emergency).

* Disk management - learning how volumes are attached to different folders (the filesystem table), and how volumes are named

* Installing software packages

* Starting, stopping, restarting, and checking the status of services

* Managing processes, using kill/killall and kill -KILL/killall -KILL


For normal people, diagrams help.

A tree diagram of the file system, labeled with what goes where and why, seems to fix about 99.99% of problems new users have getting to grips with Linux.

/bin/what ???


Oh and two more:

* Ensure they know that commands are assumed to work, and won't show show any output if they do work - eg, a file copy. If they don't work, they'll see an error message.

* Tell people what things mean. Copy, list, move. Binary. Variable. Et Cetera. Init table. Filesystem table.

By showing people that these aren't arbitrary letter combinations, but actually have real meaning, you'll make them easier to remember.


While it doesn't cover all the topics you mentioned, http://www.linuxcommand.org/ is definitely worth a look as it has more of a task-based approach. The SuperMan pages are great; they organize all the man pages for common packages into categories based on functionality (eg, text processing, multimedia, networking, etc).


Note: This is more of a long-term-understanding answer than a quick-tutorial answer.

If he wants to understand Unix, The Unix Programming Environment by Kernighan and Pike is good (as parenthesis also noted). Also, say what you will about ESR, his The Art of Unix Programming (http://www.faqs.org/docs/artu/) explains the rationale behind most of the design ideas common in Unix, as well as various historical accidents that have influenced it. (It more about Unix's design/culture than programming, IMHO.) Plus, free online.

In particular, Unix will probably seem really awkward and limited until he really deeply gets the idea of doing things by composing relatively simple programs. There are a few other idioms fundamental to Unix, but that's probably the big one. (That would probably be easier if he had experience with Haskell, incidentally; Unix pipe IO can be very similar to monads.)

A general (perhaps very general) understanding of C will also go a long way, particularly with understanding the mindset behind the man pages.


Does he actually want to know more about the command line? If he's not, I wouldn't waste your effort. Some people aren't learners, they just want to accomplish a task.

If he is, definitely hook him up with a tutorial. I like the idea of letting him peek over your shoulder as you work.

Ultimately, there are very few commands you need to know to get started. This might work:

  - Move around the file system, echo the current path
  - List the files (in the various ways you can do this)
  - Create and edit a file (nano?)
  - Move and delete the file
  - Very brief overview of permissions
  - A primer on user directories and how to get back there easily
I think that would get the average Joe enough tools to get going.


Get a copy of http://www.amazon.com/Power-Tools-Third-Shelley-Powers/dp/05... and experiment with interesting topics in it.


The first few chapters of The Unix Programming Environment by Kernighan and Pike give an excellent introduction to basic Unix concepts and usage.


For bash have a look at http://tldp.org/LDP/abs/html/


Can anyone without shell/cli knowledge really be called an experienced user?


He's definitely not an experienced user, at least not with Linux or the command-line. He just has a lot of experience with computers. My point was that this isn't a grandma situation: 'Ok, so this is called a FILE. Your website is made up of lots of different files. Files are kept in directories, which are like folders, and end with /…'

PS: This actually makes me think interesting thoughts about the meaning of the word 'user', the many different senses in which we use it, and the many overlapping ways one could be said to be an experienced user, such that many experienced users all have entirely distinct skill sets with no overlap.


Even on Windows, I find it hard to think of a power user who isn't at least passingly familiar with the command prompt.

I'd recommend either O'Reilly's bash shell book or 'classic shell scripting' which covers a bit more than just a shell like bash.


You can do a lot of stuff without ever touching the shell, and there's a good chance he's even used the shell before, just not in a Unix environment (probably Windows, which is significantly different, though the transition isn't too hard). Besides, nobody said he was "experienced", just that he wasn't a novice.


A longtime smalltalker is definitely an experienced user.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: