Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SC68Cal

macrumors 68000
Original poster
Feb 23, 2006
1,642
0
Hello everyone.

I'm going to do a second UNIX lecture in front of a users group in the near future. I did one last year and I have the slides on my website. Believe me, I tried to simplify a heck of a lot and sadly, I still lost people on it.

I need some people to give me advice, from the point of a normal user about what they want to know/ don't know/ don't understand about UNIX, and the Terminal application.

All help would be appreciated, I don't want to stand up there and lose everyone again!
 
commands: rm, cp, mv, chmod (and permissions)/chown, du, df, find, locate, grep, diskutil, mkdir, ls, mount, sudo/su, cat, ping, xargs, traceroute, banner :)D)

other things: launchd and cron and all those good things, building apps
 
commands: rm, cp, mv, chmod (and permissions)/chown, du, df, find, locate, grep, diskutil, mkdir, ls, mount, sudo/su, cat, ping, xargs, traceroute, banner :)D)

other things: launchd and cron and all those good things, building apps

Ah, excellent. I had a similar list bouncing around in my head of those commands. Your list is much more concise and comprehensive, and I think that it is an excellent starting point.

I tried to do a section on building apps in my last lecture. I don't think that went over very well. :D
 
I tried to do a section on building apps in my last lecture. I don't think that went over very well. :D
Yeah I noticed :D
However ..I only skimmed it really quickly, and it seemed more like you were talking about building certain apps (like JTR) more than apps in general. shrug, i'm not sure how to condense it well...

There's a whole bunch of other things I have in mind too, but I'm not sure if it's as appropriate for newbies - things like redirection (http://www.network-theory.co.uk/docs/bashref/Redirections.html), dd (and well, of course, /dev/zero, /dev/null, /dev/random, /dev/urandom...), regular expressions, sed, ssh.

some other commands i thought up of: uname, echo, clear, vim/emacs/nano/...(insert religious flamewar here..), man (forgot that one :eek: ), kill/killall, pgrep, nice, renice, passwd, lsof, pwd, ln and links in general, tar/gzip/...?, less/more, wc, scp, cal, top.

Depending on what kind of user group, maybe you want to delve into OS X-specific useful terminal commands too? defaults, open, diskutil (whoops mentioned this already), ioreg, osascript, say (very fun :D )

I know it's a long list of commands, but maybe you could just pick a few from a bunch of general things to do of interest? Say, searching for a file, then deleting it, or changing permissions...creating a new folder...managing processes. I know a bunch of this stuff can be done in Finder and other apps, but imo terminal is just so much more useful for these things :)


edit: oh, don't forget the basics. like, escaping spaces in filenames, command and file tab completion in terminal...all those goodies :D
 
There is no way to make a Unix lesson painless. :p

oh please :(

you could maybe spice things up and do something fun. seriously. like use say or banner. or am i a geek for finding those pretty interesting and..:(

<-- lose at life :p

edit: no, do something like this. take a bunch of really common problems that would be a headache to fix, and fix them using terminal commands. like this one halfway down the post: https://forums.macrumors.com/posts/3556373/
some commands come in so handy...
also, you might want to talk about aliases..and then bash profiles...and then...
 
I really mean it. There's no way to make Unix fun and painless.

The people who want to learn WILL learn. That's it. As we speak/type, I'm trying to learn how to use Linux from something called "The Linux Users' Guide" written by a guy named Larry Greenfield. Not bad. I'm just reading through the commands, hoping to follow along with the diagrams and such.
 
As we speak/type, I'm trying to learn how to use Linux from ...
in my opinion, there is nothing better than just using them.

Even if it's a headache and takes you forever to figure out, move files in Terminal. Rename files in terminal. Open an application using open.

If you're trying to get the hang of any particular distro, just start using it as much as you can. (puts on a flame-repellant :p ) Install something like Gentoo. The installation alone will teach you so much about how Linux works and how to maintain your system without having to rely on gui tools that may not even exist.
 
I really mean it. There's no way to make Unix fun and painless.

I'll find a way. I'm going to be pursuing a Masters Degree in Instructional Education, so if I play my cards right, this could be the formation of a good paper to finish off the degree with.

Then again that's at least two years away.

Kicking it around, here's what I think needs to be done

1. Where are we???? (What is UNIX, what is a shell, BASH, basically a recap from some of my previous slides)
2. Syntax (what goes where.... introduce the concept of uniformity across applications)
3. Simple commands
4. More complex commands
5. Joining commands to create useful outputs (pipes)
6. basic UNIX principles (Why are there permissions, multi-user operating system concepts)
7. Permissions primer (What is User & Groups)
8. Permissions primer II (What is Read, Write, Execute)
9. Permissions primer III(What is owner, group, other)
10. Permissions (Octal expressions, 111 versus 777)
 
10. Permissions (Octal expressions, 111 versus 777)
I don't know about #10. It's only confusing and annoying. You don't even have to use octal numbers and absolute modes, symbolic ones are less confusing.

Like compare "chmod 777" to "chmod a+rwx" ugo=rwx or a=rwx. I'd vastly prefer the latter because 777 is meaningless unless I knew how to calculate it, while a+rwx/ugo=rwx/a=rwx tells me that I'm adding read, write, execute permissions to all (user, group, owner). Out of use and habit I understand most absolute modes, but for a new person...

You can also do chmod +x or chmod u-r,g=rw,o+rwx or virtually any combination. And even with the latter, you can still understand what's going on without thinking much (remove read for user, make group permission read and write only, add read, write and execute permission to the owner).
 
I prefer the octal values because the behavior is uniform and the syntax is strict. And working with the octal values enough makes me prefer them. Different strokes for different folks.

Believe me, I think that it's an ambitious list, and I doubt that anyone will follow past step #5. They're all from OS 9, or music backgrounds, or artistic types. So, I work with what I get.
 
I prefer the octal values because the behavior is uniform and the syntax is strict. And working with the octal values enough makes me prefer them. Different strokes for different folks.
Yes, but while you have worked with them, you mentioned "normal" users, and to normal users, symbolic modes would make more sense than octal.

just my 2c.
 
^^I agree. ;)

Ask me. If you need my help, and you think you can explain to me what you'll be teaching, then run it by me. I AM essentially your target audience, after all. I'm learning Linux from scratch, and I can only move individual files, not groups of files or folders. That would have been a useful skill when I was using my Mac, it completely ****ed up, it wouldn't recognise my backup HD through the GUI (but it did via Terminal), and I had to back up my files. I honestly didn't know what to do because I only started learning Linux and didn't know commands beyond "cp"ing individual files. :eek: However, I did have the sense to compress every folder I wanted into a ZIP file and copy the ZIP file over to my backup HD rather than move individual files. (And yes, the MacBook ran so poorly that I'm about to get a brand new MacBook as a replacement).

Anyway, I'm very very novice, and am not uncapable of learning, nor unwilling to do so. If I would find it confusing, then I say don't bother teaching it. Don't do anything with Octals. I remember something about them from high school programming. :eek:

Teaching things like "How do I type in a filename when the name has spaces" is already a good place to start. Teach too much, and they won't learn anything.
 
That would have been a useful skill when I was using my Mac, it completely ****ed up,...
Well, 'mv' moves directories as well - mv dir1 dir2 moves dir1 into dir2.

or to cp entire directories you could do cp /some/dir/* /another/dir
or cp /some/dir /another/dir to move /some/dir to /another/dir so it'll be /another/dir/dir.

or you could have used dd to make a copy of the drive as a disk image.
 
Like compare "chmod 777" to "chmod a+rwx" ugo=rwx or a=rwx. I'd vastly prefer the latter because 777 is meaningless unless I knew how to calculate it, while a+rwx/ugo=rwx/a=rwx tells me that I'm adding read, write, execute permissions to all (user, group, owner). Out of use and habit I understand most absolute modes, but for a new person...

The numbers are simpler to memorize, and if all you're going to be doing is permissions, it's much more straightforward to type in 3 numbers than a string of letters or whatever.

I'd say for the average joe it's easier to remember that way...at least for me it was, and I stick to the basics in the terminal, just a wee bit of ssh, rm, mv, cp, ping...the basic stuff.
 
The numbers are simpler to memorize, and if all you're going to be doing is permissions, it's much more straightforward to type in 3 numbers than a string of letters or whatever.
i honestly don't know if I could agree with that - it's not asking the end user to memorize arbitrary letters, if they learn about permissions, they will learn about users, groups, owner, read/write/execute anyway and the symbolic modes just use the first letter of each of those. you use +/-/= to give/remove permissions, and anyone who knows basic math can understand that.
 
i honestly don't know if I could agree with that - it's not asking the end user to memorize arbitrary letters, if they learn about permissions, they will learn about users, groups, owner, read/write/execute anyway and the symbolic modes just use the first letter of each of those. you use +/-/= to give/remove permissions, and anyone who knows basic math can understand that.

I dunno...I'm just speaking from experience. I had to figure it all out for myself a while ago and I found it much easier to just look at a list of what meant what, and remember it (or at least reference it when I had to).

The numbers leave little room for errors when I'm ftp'ing all kinds of finicky php scripts.
 
i hope the lecture's more entertaining than this thread!

sorry, just to be honest. (but then again i have a short attention span and i've always been bored in cs classes - hence no cs major)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.