Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.mac.system > #70347 > unrolled thread

Will Linux-style commands work on OSX?

Started bysctvguy1 <sctvguy1@invalid.net>
First post2015-03-01 19:28 +0000
Last post2015-03-02 07:48 -0500
Articles 14 — 11 participants

Back to article view | Back to comp.sys.mac.system


Contents

  Will Linux-style commands work on OSX? sctvguy1 <sctvguy1@invalid.net> - 2015-03-01 19:28 +0000
    Re: Will Linux-style commands work on OSX? Martin Smith <martinsm@rakupottery.org.uk> - 2015-03-01 19:33 +0000
    Re: Will Linux-style commands work on OSX? Jolly Roger <jollyroger@pobox.com> - 2015-03-01 19:38 +0000
      Re: Will Linux-style commands work on OSX? Lewis <g.kreme@gmail.com.dontsendmecopies> - 2015-03-01 23:47 +0000
        Re: Will Linux-style commands work on OSX? Barry Margolin <barmar@alum.mit.edu> - 2015-03-01 20:34 -0500
          Re: Will Linux-style commands work on OSX? Lewis <g.kreme@gmail.com.dontsendmecopies> - 2015-03-02 17:38 +0000
            Re: Will Linux-style commands work on OSX? Barry Margolin <barmar@alum.mit.edu> - 2015-03-02 15:25 -0500
              Re: Will Linux-style commands work on OSX? Lewis <g.kreme@gmail.com.dontsendmecopies> - 2015-03-02 23:04 +0000
          Re: Will Linux-style commands work on OSX? mcnesium <mcnesium@versteht.es> - 2015-03-10 18:44 +0100
    Re: Will Linux-style commands work on OSX? Tim Streater <timstreater@greenbee.net> - 2015-03-01 19:41 +0000
    Re: Will Linux-style commands work on OSX? JF Mezei <jfmezei.spamnot@vaxination.ca> - 2015-03-01 14:52 -0500
    Re: Will Linux-style commands work on OSX? Don Bruder <dakidd@sonic.net> - 2015-03-01 13:02 -0800
    Re: Will Linux-style commands work on OSX? android <here@there.was> - 2015-03-02 08:18 +0100
    Re: Will Linux-style commands work on OSX? Warren Oates <warren.oates@gmail.com> - 2015-03-02 07:48 -0500

#70347 — Will Linux-style commands work on OSX?

Fromsctvguy1 <sctvguy1@invalid.net>
Date2015-03-01 19:28 +0000
SubjectWill Linux-style commands work on OSX?
Message-ID<mcvp8a$51b$1@dont-email.me>
I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
6.6.  Would I have to download some Mac-specific CL program?  I have a 
Fedora book with tons of Linux commands, will those work?

[toc] | [next] | [standalone]


#70348

FromMartin Smith <martinsm@rakupottery.org.uk>
Date2015-03-01 19:33 +0000
Message-ID<mcvpgt$50a$1@dont-email.me>
In reply to#70347
On 01/03/2015 19:28, sctvguy1 wrote:
> I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux
> 6.6.  Would I have to download some Mac-specific CL program?  I have a
> Fedora book with tons of Linux commands, will those work?
>
you could open a terminal and try a few, you will soon enough find out.

-- 
Martin

replies to newsgroup only please.

[toc] | [prev] | [next] | [standalone]


#70349

FromJolly Roger <jollyroger@pobox.com>
Date2015-03-01 19:38 +0000
Message-ID<clh866Fl983U1@mid.individual.net>
In reply to#70347
On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
> I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
> 6.6.

I take it you mean Red Hat Enterprise Linux 6.6.

> Would I have to download some Mac-specific CL program?

Mac OS X is Unix. Linux is based on Unix.
/Applications/Utilities/Terminal is built into Mac OS X and lets you
access the command line.

> I have a Fedora book with tons of Linux commands, will those work?

Depends on the command. Since Linux is based on Unix, a lot of commands
will work the same way or similarly. Mac OS X is different in many areas
though.

-- 
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

[toc] | [prev] | [next] | [standalone]


#70360

FromLewis <g.kreme@gmail.com.dontsendmecopies>
Date2015-03-01 23:47 +0000
Message-ID<slrnmf79a9.1t02.g.kreme@kreme.eternal-september.org>
In reply to#70349
Okay, so one time? In band camp? Jolly Roger <jollyroger@pobox.com> was all, like:
> On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
>> I have a Fedora book with tons of Linux commands, will those work?

> Depends on the command. Since Linux is based on Unix, a lot of commands
> will work the same way or similarly. Mac OS X is different in many areas
> though.

The biggest difference is that OS X is a BSD and Linux is.. Well, Linux.

-- 
http://2blog.kreme.com
In the 60's, people took acid to make the world appear weird. Now the
world is weird and people take Prozac to make it appear normal.

[toc] | [prev] | [next] | [standalone]


#70361

FromBarry Margolin <barmar@alum.mit.edu>
Date2015-03-01 20:34 -0500
Message-ID<barmar-BB5364.20342601032015@88-209-239-213.giganet.hu>
In reply to#70360
In article <slrnmf79a9.1t02.g.kreme@kreme.eternal-september.org>,
 Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

> Okay, so one time? In band camp? Jolly Roger <jollyroger@pobox.com> was all, 
> like:
> > On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
> >> I have a Fedora book with tons of Linux commands, will those work?
> 
> > Depends on the command. Since Linux is based on Unix, a lot of commands
> > will work the same way or similarly. Mac OS X is different in many areas
> > though.
> 
> The biggest difference is that OS X is a BSD and Linux is.. Well, Linux.

But quite a few of the commands on OS X commands are the GNU versions. 
It's a hodgepodge. You pretty much have to check every command on a 
case-by-case basis to see precisely which options it takes.

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

[toc] | [prev] | [next] | [standalone]


#70369

FromLewis <g.kreme@gmail.com.dontsendmecopies>
Date2015-03-02 17:38 +0000
Message-ID<slrnmf9818.20nj.g.kreme@kreme.eternal-september.org>
In reply to#70361
Okay, so one time? In band camp? Barry Margolin <barmar@alum.mit.edu> was all, like:
> In article <slrnmf79a9.1t02.g.kreme@kreme.eternal-september.org>,
>  Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

>> Okay, so one time? In band camp? Jolly Roger <jollyroger@pobox.com> was all, 
>> like:
>> > On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
>> >> I have a Fedora book with tons of Linux commands, will those work?
>> 
>> > Depends on the command. Since Linux is based on Unix, a lot of commands
>> > will work the same way or similarly. Mac OS X is different in many areas
>> > though.
>> 
>> The biggest difference is that OS X is a BSD and Linux is.. Well, Linux.

> But quite a few of the commands on OS X commands are the GNU versions. 

Sure, just like in FreeBSD.

> It's a hodgepodge. You pretty much have to check every command on a 
> case-by-case basis to see precisely which options it takes.

Not really. You will get some differences every now and then, but rarely.

For example, I was recently trying to add a from field to messages sent
via root's crontab. The syntax for this on a linux system is

| mail -s "Subject" foo@bar.com -- -f bar@foo.com

That syntax doesn't work in FreeBSD.

-- 
http://2blog.kreme.com
It was a fifty-four with a mashed up door and a cheesy little amp with a
sign on the front said "Fender Champ" and a second-hand guitar it was a
Stratocaster with a whammy bar

[toc] | [prev] | [next] | [standalone]


#70385

FromBarry Margolin <barmar@alum.mit.edu>
Date2015-03-02 15:25 -0500
Message-ID<barmar-3E775F.15253602032015@88-209-239-213.giganet.hu>
In reply to#70369
In article <slrnmf9818.20nj.g.kreme@kreme.eternal-september.org>,
 Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

> Okay, so one time? In band camp? Barry Margolin <barmar@alum.mit.edu> was 
> all, like:
> > In article <slrnmf79a9.1t02.g.kreme@kreme.eternal-september.org>,
> >  Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
> 
> >> Okay, so one time? In band camp? Jolly Roger <jollyroger@pobox.com> was 
> >> all, 
> >> like:
> >> > On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
> >> >> I have a Fedora book with tons of Linux commands, will those work?
> >> 
> >> > Depends on the command. Since Linux is based on Unix, a lot of commands
> >> > will work the same way or similarly. Mac OS X is different in many areas
> >> > though.
> >> 
> >> The biggest difference is that OS X is a BSD and Linux is.. Well, Linux.
> 
> > But quite a few of the commands on OS X commands are the GNU versions. 
> 
> Sure, just like in FreeBSD.
> 
> > It's a hodgepodge. You pretty much have to check every command on a 
> > case-by-case basis to see precisely which options it takes.
> 
> Not really. You will get some differences every now and then, but rarely.

Unfortunately, it hits some pretty popular commands. For instance, there 
are frequent questions on Stack Exchange regarding the "sed" command. On 
Linux you can write:

sed -i 's/foo/bar/' files...

to update all the files in place, but on OS X you have to write:

sed -i '' 's/foo/bar/' files...

because the BSD sed expects the backup file suffix to be a separate 
argument.

> 
> For example, I was recently trying to add a from field to messages sent
> via root's crontab. The syntax for this on a linux system is
> 
> | mail -s "Subject" foo@bar.com -- -f bar@foo.com
> 
> That syntax doesn't work in FreeBSD.

That looks pretty weird to me. The "--" option is usually used to signal 
the end of all options, everything else after that is non-option 
arguments. I wonder why you would put the "-f" option after it. On any 
flavor of Unix I'd write it as:

mail -s "Subject" -f bar@foo.com foo@bar.com

-- 
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***

[toc] | [prev] | [next] | [standalone]


#70392

FromLewis <g.kreme@gmail.com.dontsendmecopies>
Date2015-03-02 23:04 +0000
Message-ID<slrnmf9r5b.38a.g.kreme@kreme.eternal-september.org>
In reply to#70385
Okay, so one time? In band camp? Barry Margolin <barmar@alum.mit.edu> was all, like:
> In article <slrnmf9818.20nj.g.kreme@kreme.eternal-september.org>,
>  Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:

>> Okay, so one time? In band camp? Barry Margolin <barmar@alum.mit.edu> was 
>> all, like:
>> > In article <slrnmf79a9.1t02.g.kreme@kreme.eternal-september.org>,
>> >  Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
>> 
>> >> Okay, so one time? In band camp? Jolly Roger <jollyroger@pobox.com> was 
>> >> all, 
>> >> like:
>> >> > On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
>> >> >> I have a Fedora book with tons of Linux commands, will those work?
>> >> 
>> >> > Depends on the command. Since Linux is based on Unix, a lot of commands
>> >> > will work the same way or similarly. Mac OS X is different in many areas
>> >> > though.
>> >> 
>> >> The biggest difference is that OS X is a BSD and Linux is.. Well, Linux.
>> 
>> > But quite a few of the commands on OS X commands are the GNU versions. 
>> 
>> Sure, just like in FreeBSD.
>> 
>> > It's a hodgepodge. You pretty much have to check every command on a 
>> > case-by-case basis to see precisely which options it takes.
>> 
>> Not really. You will get some differences every now and then, but rarely.

> Unfortunately, it hits some pretty popular commands. For instance, there 
> are frequent questions on Stack Exchange regarding the "sed" command. On 
> Linux you can write:

> sed -i 's/foo/bar/' files...

> to update all the files in place, but on OS X you have to write:

> sed -i '' 's/foo/bar/' files...

> because the BSD sed expects the backup file suffix to be a separate 
> argument.

>> 
>> For example, I was recently trying to add a from field to messages sent
>> via root's crontab. The syntax for this on a linux system is
>> 
>> | mail -s "Subject" foo@bar.com -- -f bar@foo.com
>> 
>> That syntax doesn't work in FreeBSD.

> That looks pretty weird to me. The "--" option is usually used to signal 
> the end of all options, everything else after that is non-option 
> arguments. I wonder why you would put the "-f" option after it. On any 
> flavor of Unix I'd write it as:

On linux the flags after the -- are passed to sendmail.

> mail -s "Subject" -f bar@foo.com foo@bar.com

on FreeBSD that returns:

mail: Cannot give -f and people to send to.

-- 
http://2blog.kreme.com
The wages of sin is death, but so is the salary of virtue, and at least
the evil get to go home early on Fridays. --Witches Abroad

[toc] | [prev] | [next] | [standalone]


#70800

Frommcnesium <mcnesium@versteht.es>
Date2015-03-10 18:44 +0100
Message-ID<cm8ortFomgnU1@mid.dfncis.de>
In reply to#70361
On 2015-03-02 01:34:26 +0000, Barry Margolin said:

> In article <slrnmf79a9.1t02.g.kreme@kreme.eternal-september.org>,
>  Lewis <g.kreme@gmail.com.dontsendmecopies> wrote:
> 
>> Okay, so one time? In band camp? Jolly Roger <jollyroger@pobox.com> was all,
>> like:
>>> On 2015-03-01, sctvguy1 <sctvguy1@invalid.net> wrote:
>>>> I have a Fedora book with tons of Linux commands, will those work?
>> 
>>> Depends on the command. Since Linux is based on Unix, a lot of commands
>>> will work the same way or similarly. Mac OS X is different in many areas
>>> though.
>> 
>> The biggest difference is that OS X is a BSD and Linux is.. Well, Linux.
> 
> But quite a few of the commands on OS X commands are the GNU versions.
> It's a hodgepodge. You pretty much have to check every command on a
> case-by-case basis to see precisely which options it takes.

many commands that work different on OSX can be "updated" to recent 
versions with well-known linux behaviour through homebrew 
(http://brew.sh/)

[toc] | [prev] | [next] | [standalone]


#70350

FromTim Streater <timstreater@greenbee.net>
Date2015-03-01 19:41 +0000
Message-ID<010320151941452806%timstreater@greenbee.net>
In reply to#70347
In article <mcvp8a$51b$1@dont-email.me>, sctvguy1
<sctvguy1@invalid.net> wrote:

>I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
>6.6.  Would I have to download some Mac-specific CL program?  I have a 
>Fedora book with tons of Linux commands, will those work?

Have you tried them in Terminal and if not why not?

-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee

[toc] | [prev] | [next] | [standalone]


#70352

FromJF Mezei <jfmezei.spamnot@vaxination.ca>
Date2015-03-01 14:52 -0500
Message-ID<54f36de5$0$1246$c3e8da3$460562f1@news.astraweb.com>
In reply to#70347
On 15-03-01 14:28, sctvguy1 wrote:
> I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
> 6.6.  Would I have to download some Mac-specific CL program?  I have a 
> Fedora book with tons of Linux commands, will those work?

If you still have the OS-X install disk, you can optionally install
X-window on the Mac. If you enable IP incoming connections, you can have
Linux Xterms  displayed on your mac, or vice versa.

The Terminal app on the Mac gives you access to command line, but cannot
be displayed on other nodes.

You can also enable telnet or ssh into your Mac from Linux.

The environment is that of freeBSD.

Some stuff is missing, and there is stuff on command line not present in
Linux. (such as many OS-X management utilities).


[toc] | [prev] | [next] | [standalone]


#70357

FromDon Bruder <dakidd@sonic.net>
Date2015-03-01 13:02 -0800
Message-ID<mcvui9$q0g$1@dont-email.me>
In reply to#70347
In article <mcvp8a$51b$1@dont-email.me>,
 sctvguy1 <sctvguy1@invalid.net> wrote:

> I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
> 6.6.  Would I have to download some Mac-specific CL program?  I have a 
> Fedora book with tons of Linux commands, will those work?

Depends - I can say with absolute certainty (since I'm also running 
10.4.11) that "Terminal" puts you into a BASH shell (unless you've 
configured it to use another shell, of course) from which you can do 
pretty much anything that any other *nix can do, provided you've got the 
program (if it isn't a built-into-the-shell operation) to do it. 

If you don't have the program, you can probably find a version for the 
Mac. If you can't find one "ready-to-use", you can often find it in 
source code and compile it yourself. 

Basically, as long as you've got a version of the program that does 
"Linux command 'X'" that's built for the Mac, you can do the same thing 
that you could do under any other *nix.

-- 
Security provided by Mssrs Smith and/or Wesson. Brought to you by the letter Q

[toc] | [prev] | [next] | [standalone]


#70363

Fromandroid <here@there.was>
Date2015-03-02 08:18 +0100
Message-ID<clih6oF7bjU2@mid.individual.net>
In reply to#70347
In article <mcvp8a$51b$1@dont-email.me>,
 sctvguy1 <sctvguy1@invalid.net> wrote:

> I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
> 6.6.  Would I have to download some Mac-specific CL program?  I have a 
> Fedora book with tons of Linux commands, will those work?

Linux is POSIX compliant and so is BSD/OSX. Most commands will work. 
10.4 uses the BASH shell unless you change it yourself.
-- 
teleportation kills

[toc] | [prev] | [next] | [standalone]


#70364

FromWarren Oates <warren.oates@gmail.com>
Date2015-03-02 07:48 -0500
Message-ID<54f45c22$0$64270$c3e8da3$b280bf18@news.astraweb.com>
In reply to#70347
In article <mcvp8a$51b$1@dont-email.me>,
 sctvguy1 <sctvguy1@invalid.net> wrote:

> I have my iMac G4 running 10.4.11, and my Thinkpads run enterprise Linux 
> 6.6.  Would I have to download some Mac-specific CL program?  I have a 
> Fedora book with tons of Linux commands, will those work?

List a few of the commands you have in mind. All the basic stuff is 
built in to OS X. I forget which Darwin come with 10.4.x.

So, things like

ls
du
df 

and awk and grep and so on work normally. Or were you thinking of more 
esoteric stuff (mpg123, say)?
-- 
Where's the Vangelis music?
Pris' tongue is sticking out in in the wide shot after Batty has kissed her.
They have put back more tits into the Zhora dressing  room scene.
  -- notes for Blade Runner

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.mac.system


csiph-web