Running Linux Command Through Ruby

I wonder if anyone knows how to run Unix/Linux commands from Ruby?

I understand that the Perl counterpart could be sth like the

* First I create a perl file

* Then inside the file I have the desired Linux commands.

#!/usr/local/bin/perl -w
`ls -l`;

* When I run the file, those Linux commands would be executed.

Just wonder how I can do this in Ruby in Linux environment. Thanks a

exactly the same: by enclosing the command in backticks (`)
you'll get the output produced as the return value, and the exit code is in $?


Very nice. Thanks!