Unix for newbies

I know there are some very knowledgable folk around here, so I'd like to pick your brains a little if I may... for my sins I do most of my daily dabbling on OS X, and would like to get more out of Terminal - anybody have any recommendations for a (print) book to get me started? I've tried reading the man pages but if there's a proper physical book I can slob on the sofa/train/etc with, any pointers towards particularly good ones would be kindly appreciated.
nathanscribe
User avatar

Unread post06 Apr 2012, 16:01

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
I found the best way to learn is noodling about, and exploring it. I also found switching over to mutt for my email taught me a lot as I worked out how to use it.

As for books, I found Unix Power Tools a great starter book, and still refer to it frequently.

I should add that I’m a total bumbler in *nix, an make frequent trips to Google and/or books to find solutions to problems that should be straightforward and simple.
koralatov
User avatar

Unread post06 Apr 2012, 16:09

User avatar
X
koralatov
 
Posts: 309
Joined: 10 Feb 2012, 14:31
Location: UK
 
Just lookup some books that have decent reviews on amazon, perhaps "Unix for dummies" is worth a shot? I agree with the previous poster, best way to learn is to use it.
Try to actually DO STUFF on it. Want to move/rename/delete a file? Do it from the terminal. Want to create a directory (folder) ? Do it from the terminal. Want to write some notes? Do it in the terminal with console text editors. Then learn how to look for files or for content in files, learn some shell scripting, etc.

By the way, I recommend bash as the unix shell to use, that's the default on OSX anyway.
Do not, I repeat, DO NOT go anywhere near csh or its derivatives.
http://www.shlomifish.org/open-source/anti/csh/
sordna
User avatar

Unread post06 Apr 2012, 18:02

User avatar
X
sordna
 
Posts: 319
Joined: 11 May 2011, 19:48
Location: USA
Main keyboard: Kinesis Advantage LF / Dvorak layout
Main mouse: Logitech M500
Favorite switch: Cherry MX Red
 
Without doubt the best way to really get to grips is to use it, but I do like a book to read to help me get there. FWIW, I've never really got on well with the "dummies" series, but I've had a few SAMS and O'Reilly on various other topics, with mixed results. That Unix Power Tools looks like a pretty serious tome! I spotted the Nutshell guide from O'Reilly, and a few others - local bookshops don't seem to have much in the way for browsing, so I'll just have to take a plunge some time - so any you've used and can personally vouch for are always good to know of.

Thanks for the input so far chaps.
nathanscribe
User avatar

Unread post06 Apr 2012, 18:44

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
Go zsh........
Mrinterface
User avatar

Unread post06 Apr 2012, 18:54

User avatar
X
Mrinterface
 
Posts: 1242
Joined: 30 Jan 2011, 15:47
Location: The Netherlands
Main keyboard: Omnikey evolution
Main mouse: G9
Favorite switch: Monterey blues
 
 
To boldly go where no innovator has gone before : always engage at full trust.
Definitely the best way is to learn by doing. Use the shell for everything you can use it for. ls, cd, mv, cp and rm are the most essential tools. Maybe you should have a look at tar as well, less, cat and tail are great tools too. And you should really start using console editors. mcedit (part of the midnight commander file manager) or nano if you're lazy, but if you really want to learn something useful you should have a look at this vim tutorial. vim is hard at the beginning, but the more you use it, the more you like it. Now I even take notes in school using vim. Some others recommend emacs, but in my opinion it isn't as logical as the modal system vim uses. Here's a really great vim tutorial: http://www.openvim.com/tutorial.html

And if you are more advanced, I really recommend you to have a look at the zsh (Z-Shell). It's a great shell, in most cases bash compatible, but the completion and the correction functions are far superior.
RC-1140
User avatar

Unread post06 Apr 2012, 18:54

User avatar
X
RC-1140
 
Posts: 697
Joined: 07 Sep 2011, 20:30
Location: Germany
Main keyboard: Unicomp Terminal Emulator
Main mouse: Razer Mamba
Favorite switch: Buckling Spring
 
 
Unicomp 122-Key Terminal Emulator - IBM Model M 1394309 - IBM Model M 1394312 (Terminal) - Cherry G84-4100 - Cherry G80-1800LUMDE-2 - Cherry G80-2551HAD (with a spare NIB)
+1 to the above posts. I actually interact with *nix systems for a living, and despite I remember reading one book in the very beginning, the absolute majority of my knowledge was gained by just doing stuff. Online manuals, tutorials are really helpful in most cases.
gorkypl

Unread post06 Apr 2012, 19:07

X
gorkypl
 
Posts: 53
Joined: 19 Mar 2012, 00:28
Location: Poland
 
gorkypl wrote:Online manuals, tutorials are really helpful in most cases.


And manpages. Teach a man to use a shell tool and he knows one shell command more. Teach a man to use "man", and he knows how to use nearly every *NIX tool out there.
RC-1140
User avatar

Unread post06 Apr 2012, 19:11

User avatar
X
RC-1140
 
Posts: 697
Joined: 07 Sep 2011, 20:30
Location: Germany
Main keyboard: Unicomp Terminal Emulator
Main mouse: Razer Mamba
Favorite switch: Buckling Spring
 
 
Unicomp 122-Key Terminal Emulator - IBM Model M 1394309 - IBM Model M 1394312 (Terminal) - Cherry G84-4100 - Cherry G80-1800LUMDE-2 - Cherry G80-2551HAD (with a spare NIB)
Ah, yes :) If you already know the name of the command you need, man is invaluable.
gorkypl

Unread post06 Apr 2012, 19:38

X
gorkypl
 
Posts: 53
Joined: 19 Mar 2012, 00:28
Location: Poland
 
It also helps if you just use Linux. The less works the more you will be forced to use a terminal. ;)
Icarium
User avatar

Unread post06 Apr 2012, 20:17

User avatar
X
Icarium
 
Posts: 1475
Joined: 11 Jan 2012, 17:22
Location: Germany
Main keyboard: These fields just
Main mouse: opened my eyes
Favorite switch: I need to bring stuff to work
 
The command df is nice to know as well, not quite a tool, still quite valuable.
off
User avatar

Unread post06 Apr 2012, 20:34

User avatar
X
off
 
Posts: 1498
Joined: 02 Mar 2012, 04:32
Location: the crapper, NL, EU
 
 
salt/sambal not included
off wrote:The command df is nice to know as well, not quite a tool, still quite valuable.

much better: "df -h"

"h" as in "human readable" ;-)
RC-1140
User avatar

Unread post06 Apr 2012, 20:52

User avatar
X
RC-1140
 
Posts: 697
Joined: 07 Sep 2011, 20:30
Location: Germany
Main keyboard: Unicomp Terminal Emulator
Main mouse: Razer Mamba
Favorite switch: Buckling Spring
 
 
Unicomp 122-Key Terminal Emulator - IBM Model M 1394309 - IBM Model M 1394312 (Terminal) - Cherry G84-4100 - Cherry G80-1800LUMDE-2 - Cherry G80-2551HAD (with a spare NIB)
RC-1140 wrote:"h" as in "human readable" ;-)

Ey man, don't spoil the surprise! He's got a lot of man-ning to do so might as well start there :P
off
User avatar

Unread post06 Apr 2012, 21:20

User avatar
X
off
 
Posts: 1498
Joined: 02 Mar 2012, 04:32
Location: the crapper, NL, EU
 
 
salt/sambal not included
As everyone else has said, doing is the best way of learning. sordna and RC-1140 are both right: do *everything* you can via the terminal. Even file management. Once you get used to it, it’s much more efficient for certain tasks than the GUI:
Code: Select all
mv *.txt ~/Documents/Text\ Files
is a lot easier than hunting for, then dragging across, all your text files.

Anything you want to automate you can automate using shell scripts, and should. I learned a lot doing that.

I’m almost totally useless in vim, but I recommend learning it. It’s so powerful, and you can do some very advanced things very easily. It’ll give you the skills to use vidir, which is insanely good at working with directories of files if you want to rename them. (It probably does other stuff too, but that’s all I’ve used it for so far.)

Since you’re using a Mac, I recommend Mac Ports: it makes installing and removing packages so much easier. Also, Lingon makes creating and amending launchd tasks *much* easier.
koralatov
User avatar

Unread post06 Apr 2012, 22:26

User avatar
X
koralatov
 
Posts: 309
Joined: 10 Feb 2012, 14:31
Location: UK
 
there was a book "Unox for macosx" or something like this.

But beware ! this will make you switchn to linux. This is what i have done, macosx, unix, then linux and i still use macosx on old machines, but that's all.
Gilgam
User avatar

Unread post07 Apr 2012, 09:56

User avatar
X
Gilgam
 
Posts: 1004
Joined: 22 Feb 2011, 23:59
Location: france
Main keyboard: Too many
Main mouse: CST trakball
Favorite switch: red ?, maybe topre, well no, black... Or brown???
 
This is a good start:
http://www.catb.org/
7bit
User avatar

Unread post10 Apr 2012, 15:50

User avatar
X
7bit
 
Posts: 5720
Joined: 01 Feb 2011, 00:37
Location: Berlin, DE
Main keyboard: Tipro / IBM 3270 emulator
Main mouse: Logitech granite for SGI
Favorite switch: MX Lock
 
Thanks for the input chaps - I've decided to pick up one of the O'Reilly 'nutshell' books on bash/unix, and keep reading the manpages and dabbling...
nathanscribe
User avatar

Unread post14 Apr 2012, 21:22

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
OK, so I'm chipping away at this gradually, and learning what not to do.

Can anybody help me with something as basic as printing? I'm on OS X Lion, using Terminal (bash).

I've set up a printer, which is showing up just fine when I enter
Code: Select all
lpc status
, but when I try to print anything, for example
Code: Select all
lp test
(where test is a text file), I get pages of stuff that looks like code, header info, etc. and I have to cancel the job and turn the printer off and on again. I mean, pages of stuff - it just keeps coming. To the point where I have seven pages of junk and no actual file content yet.

Anybody know what might be happening, and how I just print what's needed? I can't seem to find any info online that helps.
nathanscribe
User avatar

Unread post02 Jun 2012, 17:47

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
nathanscribe wrote:OK, so I'm chipping away at this gradually, and learning what not to do.

Can anybody help me with something as basic as printing? I'm on OS X Lion, using Terminal (bash).

I've set up a printer, which is showing up just fine when I enter
Code: Select all
lpc status
, but when I try to print anything, for example
Code: Select all
lp test
(where test is a text file), I get pages of stuff that looks like code, header info, etc. and I have to cancel the job and turn the printer off and on again. I mean, pages of stuff - it just keeps coming. To the point where I have seven pages of junk and no actual file content yet.

Anybody know what might be happening, and how I just print what's needed? I can't seem to find any info online that helps.

Did you try to print a PostScript file?

Usually it should just prinbt a text file as expected, but maybe the configuration is wrong.

Did you try lpr?

lpr -o raw file.txt

Did not try anything, because I don't have a printer at home.
7bit
User avatar

Unread post02 Jun 2012, 17:53

User avatar
X
7bit
 
Posts: 5720
Joined: 01 Feb 2011, 00:37
Location: Berlin, DE
Main keyboard: Tipro / IBM 3270 emulator
Main mouse: Logitech granite for SGI
Favorite switch: MX Lock
 
7bit wrote:Did you try to print a PostScript file?

Usually it should just prinbt a text file as expected, but maybe the configuration is wrong.

Did you try lpr?

lpr -o raw file.txt

I have a simple file which I called test that is simply hello, world in pure text and nothing more. I generated it from the command line, not in a text editor, so it's as basic as it can be.

lpr gives absolutely nothing - no activity at all.
nathanscribe
User avatar

Unread post02 Jun 2012, 18:05

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
Best book ever written for Unix sysadmins:

http://www.amazon.com/Linux-System-Admi ... 0131480057

That's the Fourth Edition. I have to assume it is still as good as the first. I believe that Donald Knuth is quoted in there with something that constantly resonates in the back of my mind, "10 years of email should be enough for anyone." ;-)

Oh, and learn to use the command "apropos". Like "apropos printing", then RTFM.
Last edited by captain on 02 Jun 2012, 19:41, edited 1 time in total.
captain
User avatar

Unread post02 Jun 2012, 18:58

User avatar
X
captain
 
Posts: 232
Joined: 16 Jan 2012, 20:26
Main keyboard: main? main? what is main?
Main mouse: Mickey
Favorite switch: it's complicated
 
 
[youtube]http://www.youtube.com/watch?v=zN1WSkFXmzU[/youtube]
If you have a printer connected, just post the config files. Also a link to a book is not helpful, he wants to print now!
7bit
User avatar

Unread post02 Jun 2012, 19:35

User avatar
X
7bit
 
Posts: 5720
Joined: 01 Feb 2011, 00:37
Location: Berlin, DE
Main keyboard: Tipro / IBM 3270 emulator
Main mouse: Logitech granite for SGI
Favorite switch: MX Lock
 
captain wrote:Oh, and learn to use the command "apropos". Like "apropos printing", then RTFM.

:lol: If you mean, RTF Manpages, I have, but as a complete beginner I'm finding it easier to get going in some areas than others. There seems to be a lot of info about, but written for people who already know much more than I do... I'll get there, but not yet.

@7bit: for now I just uninstalled the printer, and will reinstall again - not even sure about those config files you mention, that's how n00b I am. I've already wasted plenty of paper on this, and even stopping the thing once it gets going has been a headscratcher. No doubt it's something fairly simple for those in the know, so I'll experiment further and report back.
nathanscribe
User avatar

Unread post02 Jun 2012, 20:04

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
Wrong driver selected during setup in OS X. Duh.

Still, now it seems to print one thing and then halts, ignoring all subsequent input. Hmm.
nathanscribe
User avatar

Unread post02 Jun 2012, 20:45

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 
Which UNIX OS are you going to use (not OS X)? Since most UNIX systems are servers - set up server. I'd suggest starting with Ubuntu Server (with no GUI) since they have tons of experienced people on their forums and they are glad to help. You really need to just dive in. Once you get the basics down in Linux then move over to UNIX. O'R'eilly has a few nix books that are pretty good.
smknjoe

Unread post03 Jun 2012, 01:03

X
smknjoe
 
Posts: 10
Joined: 02 May 2012, 08:52
 
captain wrote:Best book ever written for Unix sysadmins:

http://www.amazon.com/Linux-System-Admi ... 0131480057

That's the Fourth Edition. I have to assume it is still as good as the first. I believe that Donald Knuth is quoted in there with something that constantly resonates in the back of my mind, "10 years of email should be enough for anyone." ;-)

Oh, and learn to use the command "apropos". Like "apropos printing", then RTFM.

Agree, back in the day the primary was always the Evi Nemeth System Administration Handbooks. After that we'd tend to have some O'Reilly books like Essential System Administration, DNS and BIND, Sendmail, TCP/IP Network Administration, etc. Depends on what your needs are.
TexasFlood
User avatar

Unread post03 Jun 2012, 04:25

User avatar
X
TexasFlood
 
Posts: 398
Joined: 29 May 2012, 22:28
Main keyboard: Rosewill RK-9000 original cherry blue
Main mouse: Microsoft trackball
Favorite switch: cherry blue
 
 
Sheldon: Clarify something for me. Isn’t the point of a communal meal the exchange of ideas and opinions? An opportunity to consider important issues of the day?
Leonard: It is. You just kind of put a damper on things when you said, the next person I see talking with food in their mouth will be put to death.
Very apropos comment Captain!
ripster

Unread post03 Jun 2012, 04:45

X
ripster
 
Posts: 4080
Joined: 09 Feb 2011, 07:04
Location: Ugly American
Main keyboard: As Long As It is Helvetica
Main mouse: Mickey
Favorite switch: Wanna Switch? Well, I Certainly Did!
 
smknjoe wrote:Which UNIX OS are you going to use (not OS X)?

[snip]

O'R'eilly has a few nix books that are pretty good.

At the moment I'm dabbling at home with OS X (Terminal.app), and the newly-acquired Raspberry Pi is running Debian, but I want to learn how to do things from the command line - I'm not doing this as a job, it's purely out of interest.

I've got a few books on my wishlist now, so no shortage of stuff to spend money on and time reading. :)
nathanscribe
User avatar

Unread post03 Jun 2012, 10:06

User avatar
X
nathanscribe
 
Posts: 404
Joined: 13 Mar 2011, 13:03
Location: Yorkshire, UK.
Main keyboard: Filco tenkeyless w/blues
Main mouse: Kensington Expert
Favorite switch: MX Blue
 

Who is online

Users browsing this forum: No registered users and 5 guests