Issue
I want some applications to run on my OS X. But they cant be ran due to they are only for Linux. How can I have a Linux shell on my OS X? I mean how can I have a seperate Linux shell and a OS X terminal on OS X?
Solution
It depends on your use specific use case:
To run GNU utilities (as found on Linux systems) alongside the mostly BSD-based utilities on macOS, install them via Homebrew; note that installing alongside entails that the GNU utility names are
g
-prefixed to avoid shadowing the stock macOS utilities; e.g., GNUls
is installed asgls
; also note that macOS's Bash is stillv3.x
and will remain on that version for licensing reasons:brew install coreutils
... most of the GNU utilities (installedg
-prefixed)brew install gawk
... GNU Awk (installed asgawk
)brew install findutils
... thefind
utliity (installed asgfind
)brew install gnu-sed
... GNU Sed (installed asgsed
)
To run commands in an isolated, bona fide Linux environment inside a VM (using Bash
v4.x
and above), install Docker and then install, e.g., an Ubuntu image (docker pull ubuntu
).- With the Docker environment loaded (open application
Docker QuickStart Terminal.app
), you can then rundocker run -it ubuntu bash
to enter an interactive Linux Bash shell.
- With the Docker environment loaded (open application
Answered By - mklement0 Answer Checked By - David Marino (WPSolving Volunteer)