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

fab5freddy

macrumors 65816
Original poster
Jan 21, 2007
1,206
7
Heaven or Hell
i am currently learning Linux commands, and was wondering if they are the same as unix / darwin commmands ? so i could use them in Terminal ?

thanks!
 
Depends on the command. In most cases they are very similar. Check the man pages to be sure behaviour is the same.
 
Also be sure you're using the same shell (bash, csh, etc.), as that will affect a number of things as well.

I agree with antibact1 - most commands work the same way.
 
i am currently learning Linux commands, and was wondering if they are the same as unix / darwin commmands ? so i could use them in Terminal ?

thanks!

Most of the "commands" are actually just programs. When you type "ls", for example, you're running a program which figures out your current directory, then goes to the filesystem and prints out all the file names.

So by tradition most of the commands are the same because people building the different variants of unix and linux didn't want to re-learn a bunch of new commands.

Having said that, there are places where the new designers thought they could do it slightly better, and this is where most of the differences between these OSes arise from. The most evil consequence of this is finding that commands are named identically on two different systems, but actually behave slightly differently.

To offer one random example: on my Mac (and most linux also) I can use the "-R" flag in grep to search recursively, but on my Solaris server at work grep doesn't support this flag.

The bright side of things is that since most of this stuff is open source, if you find yourself missing a command that you learned/used somewhere else, you can try to find the source code and compile it yourself.
 
There isn't really a best shell per-se, just different ones. The default OS X shell is bash, but also available is csh, ksh, tcsh and zsh. Common on Linux is bash, so you may want to stick with that if you are doing any shell programming.

Keep in mind, unless you are writing shell programs, the particular shell you are using isn't to have any effect on the program (ie. ls is ls regardless of the shell). With that said, things such as output redirection vary depending on the shell.
 
Keep in mind, unless you are writing shell programs, the particular shell you are using isn't to have any effect on the program (ie. ls is ls regardless of the shell).

Even then, isn't it fairly easy to define the shell at the beginning of the script, using a line like:

#!/bin/bash

And also good practice?

I also think it's best to stick with bash, though... it doesn't seem like it's quite so common for OS X users to switch around between shells as it is in other *nix environments.
 
Even then, isn't it fairly easy to define the shell at the beginning of the script, using a line like:

#!/bin/bash

And also good practice?

I also think it's best to stick with bash, though... it doesn't seem like it's quite so common for OS X users to switch around between shells as it is in other *nix environments.

Using #!/bin/bash is definitely a good practice. A lot of people use #!/bin/sh which is commonly a symlink to the default shell, so there is no way to know what you're getting.
 
Terminal runs a shell. You define the default shell in the user account.
 
ok, so what should i choose in Terminal prefs ?

Scripting is different from interactive use regarding what you find more practical, so it's a personal choice.

Personally, I can't stand the normal Unix shell syntaxes, so I prefer scsh for any nontrivial scripts, but I just use bash or tcsh interactively.
 
Besides some little place which is amateurish about this issue, they will require years of experience as a Unix/Linux administrator (not developer).
 
ok, so what should i choose in Terminal prefs ?

Terminal prefs just controls the way the window looks -- how many lines, is it transparent, what is the default font / color / size, does the cursor blink, etceranda. It has nothing really to do with any of this. If you decide to stick with bash, you don't do anything. You're already in bash. If you decide you want to change the default shell, this tutorial explains that and a wealth of other things:

http://www.macdevcenter.com/pub/a/mac/2005/05/20/terminal1.html

So it's a good place to start. :)
 
Terminal prefs just controls the way the window looks -- how many lines, is it transparent, what is the default font / color / size, does the cursor blink, etceranda. It has nothing really to do with any of this.

The preferences in the Terminal allow you to override the default shell.
 
About how people start: sometimes developers get part-time admin duties in some small place, there are also interships, or maybe you could get even a junior position.

Getting a PC with OpenSolaris or Solaris Express and this would help.

Or also this.

But the courses are not cheap. Maybe you should look in Amazon for certification guides.
 
You can't be serious.

I think that's the place to start to become a sysadmin... not the place to start to just use Terminal. ;) :eek:

My response had (hopefully clearly) been more about how to get started using terminal commands in OS X. I don't think that tutorial will make anyone ready to be a sysadmin. :D
 
Using #!/bin/bash is definitely a good practice. A lot of people use #!/bin/sh which is commonly a symlink to the default shell, so there is no way to know what you're getting.

/bin/sh either gives you the traditional bourne shell or the bourne again shell (bash). Bash is backwards compatible with sh. I have never seen a system that gives you anything else.
 
My response had (hopefully clearly) been more about how to get started using terminal commands in OS X. I don't think that tutorial will make anyone ready to be a sysadmin. :D

True, I make no argument that my post was actually worth the storage in the database. :p
 
hi SC68Cal, just wanted to ask you about what skills you need to get a job as a system adminstrator / server administrator ?

what should i learn first Windows Servers or Linux / Unix Servers ?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.