Macworld Forums: Unix in mac os x - Macworld Forums

Jump to content

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Unix in mac os x

#1 User is offline   Panther Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 4
  • Joined: 03-November 03

Posted 03 November 2003 - 09:53 AM

I ma starting to learn Unix on my iBook. I am curently running jaguar. Anything in particular i should dolearn? Any cool things you can do in unix (terminal) in mac os x. Any booksweebsites that are god for learning unix on a mac?
Panther
0

#2 User is offline   Chris Breen Icon

  • Advanced Member
  • Icon
  • Group: Moderators
  • Posts: 3,909
  • Joined: 11-December 00

Posted 03 November 2003 - 09:53 AM

Take a look at the O'Reilly books.
Chris

#3 User is offline   sjrsimac Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 372
  • Joined: 12-July 02

Posted 04 November 2003 - 07:22 PM

after the o'reily books, you might wanna give random googles searches a try. seriously. sourceforge is a collection of various unix programs, just mess around over there, try to compile a few apps, although i'm yet to suceed over here. and you MUST get X11 and then install fink. with this you can use ported Unix apps on MacOSX, and it's awesome. can you say free image editing? free html editor? retro games? a plethora of apps are out there, they're just made for Unix.
0

#4 User is offline   TomMacs Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,067
  • Joined: 25-March 03

Posted 07 November 2003 - 08:23 AM

Try these UNIX commands
ls
This command mean list
For an example, open up your terminal app, type ls you will now see your home directory. Say you would want to see you applications folder. type ls /applications you will now see all of you applications. If you wish to open an application use this command open when the command open is invoked with a argument (a file or directory) it will open it in the finder. Not the terminal, the terminal cannot produce any type of graphics, only text. Learning directories it's a lot like the "finder" if you want to view your computer "root" directoy (Macintosh HD) type ls / you will now see your Macintosh HD, with applications, system, library, users, but you will also notice other directories like usr, var, etc, bin, etc. These directories hold information (var, etc, tmp) for MacOS-X's core, which is a UNIX distributation made by Apple, named Darwin. The the other directories would be (usr, bin) these are just the main ones which hold programs and other perference files and scripts. But I will teach you the ones visable on the finder. So now say you want to go from / (Macintosh HD) root) to "users", type ls /users you will now see your user folder and other if you have other users. To access them once agian just add one to /users/youusername another way though is to not even type that in just type ls and theres your home, but if you want to access a subdirectoy with in your home you will not type in the the /, instead exclude it. For an example you want to go to you library folder just type ls library and if you want to got to perefernces type ls library/perfernecs
To to make things more confusing when you first launch the terminal your user directoy is your working directory, here type this comand to see pwd this prints out you working directoy. In the working directoy you do not have to type in the root's path to access a folder or program. Lets say you want to set application to your working directory. Type cd /applications nother will happen dirastic but type in pwd it changed and you now can see that you working directory is your applicaitons folder. Now type in ls without retyping in the directory of your application folder all of the applications are displayed. To open one just type open -a[i/] and it's name.
TO BE CONTINUED THE BELL RANG
0

#5 User is offline   sjrsimac Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 372
  • Joined: 12-July 02

Posted 07 November 2003 - 12:45 PM

TomMacs reminded me, I forgot to mention some details on UNIX apps working on darwin, they usually don't. fink has an expansive library of UNIX apps already compiled and ported for OS X, but most apps are not. sourcefore has the source code for all these apps which must be configured and compiled. i've tried this many times, and i have failed every time. i ask my linux-using friend for help, but he can't offer much, he uses a different distribution of UNIX. be warned, the world of UNIX isn't dangerous, it's just somewhat demeaning to OS X users to know that we can't use the majority if the apps out there. even if we can, we're still a few versions behind.
0

#6 User is offline   Duke_Thomas Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 757
  • Joined: 25-May 01

Posted 09 November 2003 - 11:14 AM

In reply to:

be warned, the world of UNIX isn't dangerous, it's just somewhat demeaning to OS X users to know that we can't use the majority if the apps out there. even if we can, we're still a few versions behind.


That's a terribly inaccurate characterization of the situation. The Fink binary distributions are always going to be a few versions behind. If you want bleeding edge versions, build from source from the unstable trees, or build from source without fink.
Incidentally, just because you are having trouble getting a compilation to work does not mean that compilation is impossible, or even moderately difficult. While it is certainly possible to once in a while find source that does not compile immediately with a ./configure; make under OS X (or any system for that matter) you say you are never able to compile anything. This suggests you are doing something very wrong; I can't say for certain since you're light on specifics, but I feel comfortable with this guess. I suppose what I'm trying to say politely is that I don't think you know what you're talking about.
0

#7 User is offline   sjrsimac Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 372
  • Joined: 12-July 02

Posted 09 November 2003 - 02:45 PM

thanks for being polite about that. we all apparently have different views, mine must be blind. go easy on me, i'm definitely also in need of help in the UNIX arena. i have tried compiling in the following manner
cd directory in question
./configure
blah blah
make -s
blah blah
sudo make install
all this is done in X11. any help would be nice.
0

#8 User is offline   Duke_Thomas Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 757
  • Joined: 25-May 01

Posted 09 November 2003 - 04:01 PM

In reply to:

thanks for being polite about that.


You're welcome. /forums/ubbthreads/images/graemlins/wink.gif More seriously, you're still not providing the most important information of all, i.e. what packages you're trying to build, and what errors you encounter when trying to do so. Additionally, by "done in X11", what do you mean?
0

#9 User is offline   sjrsimac Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 372
  • Joined: 12-July 02

Posted 09 November 2003 - 04:23 PM

alright, so it's been a while since i've actually tried to compile, so i couldn't give you those details, although i'll get back to you on that. as for what i mean by "done in X11" is that i'm using apple's distribution of X11, a show of unix using a different interface, instead of the usual Terminal application
0

#10 User is offline   Dr-NiKoN Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 741
  • Joined: 20-May 01

Posted 10 November 2003 - 03:16 AM

hehe
I downloaded the irssi-sources and tried to run configure.
It complained about missing glib. I downloaded glib and ran configure. It complained about not beeing able to guess my host. I gave
it the host as a switch to configure. configure then ran fine.
I then ran make which ran just fine.
Then I tried make install.
It ran fine.
Woohooo, glib installed. Now back to Irssi. I ran configure on irssi again.
It ran fine. Ok, lets try make.
It provided me with the following error:
code:

settings.c:28:28: default-config.h: No such file or directory
make[2]: [settings.o] Error 1
make[1]:
[install-recursive] Error 1
make: [install-recursive] Error 1


Ok, I couldn't seem to find default-config.h anywhere in the source, so I just uncommented the line in settings.c
This ensued:
code:

themes.c:34:27: default-theme.h: No such file or directory
themes.c: In function `themeread':
themes.c:876: error: `default
theme' undeclared (first use in this function)
themes.c:876: error: (Each undeclared identifier is reported only once
themes.c:876: error: for each function it appears in.)
themes.c: In function `themesave':
themes.c:1074: error: `default
theme' undeclared (first use in this function)
themes.c: In function `themesread':
themes.c:1247: error: `default
theme' undeclared (first use in this function)
make[3]:
[themes.o] Error 1
make[2]: [install-recursive] Error 1
make[1]:
[install-recursive] Error 1
make: [install-recursive] Error 1



Around here I figure that I must find default-theme.h, so I go searching.
code:

[tor:~/Desktop/irssi-0.8.6] tor% pwd
/Users/tor/Desktop/irssi-0.8.6
[tor:~/Desktop/irssi-0.8.6] tor% find . -iname "default-theme.h"
[tor:~/Desktop/irssi-0.8.6] tor%


Guess not. Let's simply try commenting out default-theme.h.
It stops with the following error:
code:

themes.c: In function `themeread':
themes.c:876: error: `default
theme' undeclared (first use in this function)
themes.c:876: error: (Each undeclared identifier is reported only once
themes.c:876: error: for each function it appears in.)
themes.c: In function `themesave':
themes.c:1074: error: `default
theme' undeclared (first use in this function)
themes.c: In function `themesread':
themes.c:1247: error: `default
theme' undeclared (first use in this function)
make[3]:
[themes.o] Error 1
make[2]: [install-recursive] Error 1
make[1]:
[install-recursive] Error 1
make: [install-recursive] Error 1


Here I am stuck, until I am able to find default-theme.h
After checking the makefile, I figure out that I have probably done something wrong.
So, let's try again.
From configure:
code:

creating config.h
config.h is unchanged


Hm, Ok? Let's include the default-theme.h again, and try to make.
It finished fine, so I tried make install.
I ran for a long time, then quit with the following error:
code:

ld: warning multiple definitions of symbol tparm
tparm.o definition of
tparm in section (TEXT,text)
/usr/lib/libncurses.dylib(libtparm.o) definition of tparm
ld: Undefined symbols:
defaultconfig
make[3]:
[irssi] Error 1
make[2]: [all-recursive] Error 1
make[1]:
[all-recursive] Error 1
make: * [all-recursive-am] Error 2


weee.
Compare this with:
apt-get install irssi
nikon
0

#11 User is offline   TomMacs Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,067
  • Joined: 25-March 03

Posted 10 November 2003 - 05:33 AM

Ohh, hate when source code does not complie. I'e been getting a lot of source from sourceforge
But I have to suggest the Fink project, since you dont have to complie and build source code.
0

#12 User is offline   TomMacs Icon

  • Veteran
  • PipPipPip
  • Group: Members
  • Posts: 1,067
  • Joined: 25-March 03

Posted 10 November 2003 - 08:55 AM

In reply to:

open -a[i/]


Thats a UBBCode error
The command open
open -a
opens a application
open -e
opens a application in text edit or text files in the "finder"
open
if you type a directory in and not a path to a application this command will open the "finder" window, but if a path of an application is tpyed in it will open the application
The command ls
ls -a
this lists every single application in a directory option meaning this line - and the option being a (-a) means all.
ls -l
This command displays permissions of files in the given directory
To make ls easier, wildcards ()
say your looking for a program, file or whatevery in a large directoy, you only know the first letter of the file and lets say your looking for the top
type this
ls /usr/bin/t

this will now print out (on the screen) every item that starts will t
Another tip
now the directories I gave and told you about all have no spaces, in unix spaces are never use and two avert them you would us something like - _ = + and so forth, but if the program or file has non you must use this to get your way through
Example:
say in your home directoy you (when you first open you terminal remember your home directory will be the working directoy) To prove it, remember pwd
so anyway you have a folder named "mac man files" notice it has spaces. But with the use of this you will be saved.
type ls mac man files
you can now view it's contents and notice after was typed I hit space bar once and then typed the next name
Now if I wanted to open a subdirectoy inside, say it's name is apple
type ls mac man files/apple
The command man
this command is very important man meaning manual pages. For every command (except for very few) they come with manual pages. So say you want to look up ls type man ls you will now see all the information about the command. Go ahead go to /usr/bin and look for commands (programs) that interest you and man them, it a good way to learn, and it gives the command's syntax
man -k
very similair to appropos (no thats not spelled right) it displays commands that relate to a key word. Say you want to find a command that deals will text, type man -k text or [man -k text edit
you will now see all the commands that relate.
Theres a alot in UNIX, many commands hundreds I can carry on and on, but I'm no teacher and the best way to learn is to buy a book, just like suggested before. Thats how we all learned
0

#13 User is offline   sjrsimac Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 372
  • Joined: 12-July 02

Posted 10 November 2003 - 09:03 PM

well, i'm having a similar problem to you.
here's after i run make check
code:
USERLABELPREFIXlibintl_gettext
/usr/bin/libtool: internal link edit command failed
make[1]: [libgettextlib.la] Error 1
make:
[check-recursive] Error 1


this is while trying to install gettext 0.11.5
Now, I'm hardly done after I complete this. on my notepad that I'm keeping, I then need to install the actual program I'm working for, Gaim 0.60. My windows using friend loves it, I figure I could show him up (in a friendly way of course) if I could manage to compile my source code and prove that the Macintosh is not divided from the rest of the world.
Thanks for any help. If you need any more info, I'll get it for you, I'll run make as many times as neccessary
0

#14 User is offline   Duke_Thomas Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 757
  • Joined: 25-May 01

Posted 10 November 2003 - 10:14 PM

You say you have Fink. Gaim is available via Fink. Observe:
code:
[Guilty-Spark:~] thomas% fink list gaim
Information about 1600 packages read in 4 seconds.
gaim 0.72-1 Instant Messaging client


That's from the unstable tree. It currently requires building from source. (The most current version in the stable tree is 0.68.) According to fink it has dozens of dependencies on external third party libraries and stuff (which is where you seem to be tripping up), so it's not really the sort of thing you'd want to make on your own.
Fink is cool. Use fink.
0

  • (2 Pages)
  • +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users