Chapter 10
Additional Programs

You’ve used a lot of general-purpose tools so far; you can manage files, manipulate streams of text, and communicate over the Internet all through the CLI. You’ve learned how much you can speed up your workflow using these kinds of tools, but that’s just the beginning. In this chapter, you’ll install some additional programs that will let you get even more done, leveraging the concepts you’ve already learned. You’ll do some document conversion and file management, add a tool to make managing environment variables easier, and then work with web-based APIs from the command line.

Some of the tools in this chapter require that you have the Python interpreter installed, along with pip, Python’s package manager. macOS has Python 2 installed by default, while Ubuntu 18.04 has Python 3 installed by default. You’ll be using Python 3 in this chapter.

On Ubuntu, since Python 3 is already installed, install pip using the python3-pip package:

 $ ​​sudo​​ ​​apt​​ ​​install​​ ​​python3-pip

Programs you install with pip are stored in ~/.local/bin on Ubuntu, so modify your PATH to include that directory. Open your ~/.bashrc file in nano:

 $ ​​nano​​ ​​~/.bashrc

Change the PATH variable so it includes ~/.local/bin before the other entries:

 export PATH=~/.local/bin:~/bin:$PATH

Save the file, exit the editor, and source the file to apply the new settings:

 $ ​​source​​ ​​~/.bashrc

On macOS, install Python 3 using Homebrew, which also installs pip and ensures that programs installed with pip are added to your path:

 $ ​​brew​​ ​​install​​ ​​python3

With everything installed, it’s time to play with some new CLI tools, starting with ones that make it easier to manage files and content.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.13.192