- Published on
Getting Mac Style Command Line Tools to Work on Ubuntu
- Authors
- Name
- Yair Mark
- @yairmark
I have been using Mac professionally for the last 5 or so years of my career. While Ubuntu is awesome there are a few things I miss from my Mac dev workflow:
opencommand: I loved being able to typeopen fileNameoropen .to open a file with the appropriate program or in Finder respectivelypbcopy: lets you easily pipe the output of a command to the clipboardcdfalias. See this article but basically what this does is tell's Finder to switch to the current terminal directorybrew: Homebrew makes life so much easier being able to generallybrew installorbrew caskinstall most things. Obviously, there isapton Ubuntu, but it is still not as polished as Homebrew.
Open Command
This question goes into setting this up. But in a nutshell, you simply set up an alias to xdg-open in your rc file:
alias open='xdg-open &>/dev/null'
The above pipes all output to /dev/null so you do not see it after running open. The main caveat with this is you will also not see any errors that may have happened when you called open.
PBcopy
This question goes into this setup. You need to install either xsel or xclip. I chose to go with xsel as the api seems simpller to use. To install it:
sudo apt install xsel
Then add the following to your rc:
alias copy='xsel -ib'
CDF
I have not worked out how to get this to work yet. Once/if I do I will update this section.
Brew
This can be installed as detailed here. It does not work as nicely on Mac but it still works pretty well.