The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - Newcomers (http://hintsforums.macworld.com/forumdisplay.php?f=15)
-   -   Why on earth should I use UNIX? (http://hintsforums.macworld.com/showthread.php?t=45852)

Jay Carr 10-11-2005 12:58 PM

Why on earth should I use UNIX?
 
Well, it said it was the forum for newbs. I've always wanted to learn UNIX for the 'geek factor' but I really would like to know what advantages knowing UNIX afford me. For some related info. I'm a Computer Science major (so, thoeretically, there should be some advantage), I like burrowing into things, I"m intersted in security and networking and on top of this, I just want to be a geek.

Thanks for putting up with me.

trevor 10-11-2005 01:51 PM

1. the additional control it gives you
2. the powerful tools that are always available at your fingertips
3. you can do things that no GUI tool allows. And if someone writes a GUI tool to do something that you formerly could only do from the command line, don't worry, there's a million more things that you can only do from the command line
4. for some things, it is faster to just issue the command in Unix
5. for some things, such as single user mode, the command line is the only option. For some other things, such as ssh (secure shell), it is by far the most direct option
6. The GUI is a power tool, and it is often very useful. But there are times when the power tool is the wrong tool for the job. To extend the analogy, you can't use a band saw to carve figures. And if you try to use a band saw for this, you won't get very nice carvings.

Trevor

cwtnospam 10-11-2005 02:00 PM

Because you're a CS major. Your not knowing Unix would be like a doctor not knowing anything about the heart. It may not be your specialty, but it is still important.

dmacks 10-11-2005 02:13 PM

Because someday you're gonna write a boatload of stub files for a large project, then just type something like

(echo SOURCES= ; find . -name "*.[ch]" -printf "%p ") > Makefile.am

and your ready to build. This isn't to say you'll need that exact task. But like others have (and will) say, command-line gives you immense power from its toolbox of commands and the ability to string them together in various ways.

In a more practical realm, as a CS person, you're going to be interacting with many people using many different platforms and compilers and programming environments. There's no substitute for knowing the common-denominator language.

michelec 10-11-2005 03:07 PM

I totally agree with what's been said so far. Unix is faster, useful and so on. But, as probably a lot of people in the Unix newcomers forum, I don't know really where to start to learn something that really will make a difference to the way I use Unix on my computer. What I mean is that I know the basics commands of Unix but I find it difficult to get to the next step where you put the the various commands together to get something useful in a script or a small program. All the books that I read seem to go into long descriptions of details of the Unix commands and options but don't spend very much time on giving real life examples of the use of these commands combined together.
Does anybody have some tips on books/websites that shows practical uses of Unix for everyday computing?

Thanks

Mike

hayne 10-11-2005 03:16 PM

Quote:

Originally Posted by michelec
Does anybody have some tips on books/websites that shows practical uses of Unix for everyday computing?

Try searching the macosxhints site for "shell script":
http://www.google.com/search?q=site:...hell+script%22

jbc 10-11-2005 04:16 PM

Here's a link for hayne's Google search with the typo corrected.

http://www.google.com/search?q=site:...hell+script%22

trevor 10-11-2005 05:00 PM

Quote:

Does anybody have some tips on books/websites that shows practical uses of Unix for everyday computing?
Mac OS X Unix 101 Byte-Sized Projects (Paperback)

Fine print: the author, Adrian Mayo, is a friend of mine.

Large print: This book seems to be exactly what you are asking for.

Trevor

michelec 10-11-2005 05:39 PM

Looks like the stuff I was looking for. That, and the 36000 results from the Google search will keep me busy for a while. :D

Jay Carr 10-11-2005 07:23 PM

Okay, I think you've gotten some good reason here (thanks folks!) And I also like the link to learning the basics of Unix. But I have another, more direct question.

What apps do you guys use on a regular basis to make your lives easiar? I've found that if I want to learn something it has to have a very pracitcal use for me, otherwise it gets lost in all the other kinds of development I'm doing.

Specifically: What options do I have in UNIX if I'm compiling Java? What options do I have for file recovery? And what UNIX apps can I use for diagnostics, system performance tests and other general maintenance issues?

tsmilt 11-07-2005 04:02 PM

Besides learning to see invsible files, what intrest is unix to me as a standard user... I dont know how to wright files programs or anything except basic html... I would like to know how my computer works but what will unix do for me that i cant do in my normal point and click screen? I'm not a cs major, so what im asking is how much unix should i learn, if any, to keep my mac up and running or add cool widgets to help personalize it to me?

hayne 11-07-2005 04:42 PM

Quote:

Originally Posted by tsmilt
Besides learning to see invsible files, what intrest is unix to me as a standard user... I dont know how to wright files programs or anything except basic html... I would like to know how my computer works but what will unix do for me that i cant do in my normal point and click screen? I'm not a cs major, so what im asking is how much unix should i learn, if any, to keep my mac up and running or add cool widgets to help personalize it to me?

There is no reason for most people to learn Unix. As has already been explained above, knowing the Unix-level commands allows you more control over the machine and makes it easier to do things like repetitive operations.
If you don't feel the need and are not merely curious, then wait and see if you encounter a problem that you can't solve without it.

By the way, anyone starting off learning Unix should look at this Unix FAQ

marcusm 12-06-2005 12:08 PM

To copy music files off an iPod. Mac OS X hides an iPod's music directories but they're quite visible in the Terminal window. Once you're in the Music folder a command like 'cp F*/* <destination>' will back up your iPod somewhere safe

tsmilt 12-09-2005 12:16 AM

lol yea i know how to do that ;) but it messed up my buddies ipod well lol it works fine my my mac but after he took it back to his pc lol it stopped working

slacker 12-09-2005 09:18 AM

Zalister, to answer your questions about what are the most important tools, I'd say that the emacs text editor is probably the single most useful tool for a CS major. These are followed closely by make and cvs.

These tools form the basis of most code development in the Unix world. It's OK to use Xcode, but it is good to learn the Unix standards if you every want to do computer science research (especially in networking) or even production software development.

I assume you are going to BYU (Provo). Good school. I've worked with a bunch of BYU professors and graduates over the years. If you really want to get proficient at Unix, find a professor doing the kind of work you are interested in and volunteer to work in their research team for a few hours a week. Working in a group with grad students to show you the ropes is a great way to learn (better than most classes IMHO).

nkuvu 12-09-2005 12:14 PM

Quote:

Originally Posted by slacker
Zalister, to answer your questions about what are the most important tools, I'd say that the emacs text editor is probably the single most useful tool for a CS major. These are followed closely by make and cvs.

emacs or vi. Preferably both, so you can sit at just about any UNIX-ish terminal and edit files.

I've worked on plenty of computers that had vi but not emacs, or emacs but not vi.

slacker 12-09-2005 12:22 PM

Quote:

Originally Posted by nkuvu
emacs or vi. Preferably both, so you can sit at just about any UNIX-ish terminal and edit files.

Let's not start that old religious war again :-). Preferably, learn both and use the one you like.

nkuvu 12-09-2005 01:09 PM

This is why I said "preferably both" and added the omission of vi from your list of editors. Not starting a jihad again, but attempting to prevent one...

kainewynd2 12-09-2005 03:21 PM

As a recent UNIX convert myself, I'd have to say that the easiest real-world use of UNIX commands was setting file permissions. As a test, make a new test user account and log into it. Log out of that account and back in as your admin user. Open terminal and try to browse into their User folder (cd is the command to do this and literally means 'Change Directory'). If you perform a directory listing (ls -Fla) you'll see the permissions and the owner and group of each file.

Now, get stubborn and decide that you want to be able to browse through everything there and start playing with these two commands:

chmod
chown

If you need help type this for a manual of each one: man commandname

If you focus on that goal of having complete control of that test user's directory you'll make a nice trek up the hill of UNIX interest.

And for the love of god, if you're not a CS major use nano or pico as your text editor for awhile and then migrate to one of the aforementioned text editors above... :D
Mike

mhinkle 07-07-2012 07:47 PM

newb question #1
 
Hello
dmacks,

earlier you posted this:
"...Because someday you're gonna write a boatload of stub files for a large project, then just type something like

(echo SOURCES= ; find . -name "*.[ch]" -printf "%p ") > Makefile.am..."

What is a "stub file" ? and what exactly will this command do?
I'm assuming it is creating some kind of new file?

Thanks for the info while I try to learn this UNIX thingy!:confused:

onceagain 07-14-2012 02:15 AM

Quote:

Originally Posted by Jay Carr (Post 239564)
I'm a Computer Science major (so, thoeretically, there should be some advantage)

Wow! I can't believe you're not REQUIRED to learn it in the course of your study. When I was a computer science major at Virginia Tech, we were required to buy a Mac running UNIX (A/UX). I learned a lot running my own UNIX box - and that was in 1989, when it was far less common to have an average person running UNIX than it is today.

acme.mail.order 07-14-2012 03:31 AM

He was a CS major back in 2005 - hopefully he's graduated by now :D

Jay: So, did you eventually learn Unix? Any comments about the experience?

Jay Carr 12-20-2012 04:27 PM

Wow, funny question that one Acme... I stopped being a CS major pretty soon after writing that post and decided I was better for the humanities, so I majored in Asian History and got a minor in CS instead. Then I graduated and started doing film production since, you know, that makes all sorts of sense... Sadly, that didn't work out and now I'm doing VBA/C# programming for a fortune 500 company in MO. I basically make very complex graphs all day drawing data from massive servers. And, oddly, I'm loving every second of it. Guess I should have stuck with CS after all...

[/brief history of last 7 years]

As for learning Unix, I did eventually learn quite a bit of it. Mostly it came out of necessity. I kept working with cheap-is-free tools for video editing, and it required me to learn how to use the command line because often that was all I had.

I imagine as I learn to program more and start doing side projects I'll run into the same problem with my iOS programs I want to make. But, I will say this, Unix is much less of a pain to learn when you see an immediate need for it.

mnewman 12-20-2012 06:13 PM

^Fascinating story. So great to read the follow up to that 2005 post.

rccharles 01-11-2013 02:31 PM

Quote:

Originally Posted by mhinkle (Post 691672)
Hello
earlier you posted this:
"...Because someday you're gonna write a boatload of stub files for a large project, then just type something like

(echo SOURCES= ; find . -name "*.[ch]" -printf "%p ") > Makefile.am"

What is a "stub file" ?

It a small file the is created to get you started. It will be expanded as the project grows.

and what exactly will this command do?

I'm assuming it is creating some kind of new file?
Yes. It is named Makefile.am

the > says to create an output file from all the data generated from the prior command.

(echo SOURCES= ; find . -name "*.[ch]" -printf "%p ")

echo SOURCES= ;

prints out SOURCES=

; end of command.

find . -name "*.[ch]" -printf "%p "

.
starts in current directory.

-name "*.[ch]"

do a file name search on *.c and *.h
* is everything.

-printf "%p "

print out results.

( )

groups the output together so it all goes in the output file.

hayne 01-11-2013 04:16 PM

Quote:

Originally Posted by rccharles (Post 716033)
( )

groups the output together so it all goes in the output file.

Well, yes - effectively.
But what ( ) actually does is start a sub-shell and run all of the parenthesized commands in that sub-shell.


All times are GMT -5. The time now is 10:30 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.