How to Access Your BeagleBone Black’s Terminal

By Rui Santos, Luis Miguel Costa Perestrelo

When you have your BeagleBone Black set up like a desktop computer, you can do all the regular things that you do on a computer — such as creating files and folders or running applications — without using the terminal. If you have the knack of the terminal, however, and know how much faster things can be done that way, you can easily access it.

Even if you prefer doing everything in the desktop environment and using the terminal as little as possible, you still need to use it for some tasks, such as installing and updating software.

To access the terminal, click the icon in the bottom-left corner of your screen. Mouse over to Accessories and click LXTerminal.

image0.jpg

The next figure shows an open terminal window. You can have several terminal windows and tabs open at the same time. Click File to generate a new terminal window or tab. You can also see the keyboard shortcuts that do the same things on the menu that appears when you click File.

image1.jpg

During an LXDE session, you may need to resize or minimize your open windows, such as the terminal. You handle this task in much the same way as you would on a Mac or Windows computer.

In this terminal, you’re controlling the BeagleBone directly rather than controlling it remotely through the use of SSH. If you’ve created a emailer.py program, for example, you can run it from the terminal. Start by logging in as root and then changing to the Projects folder:

sudo su
cd /var/lib/cloud9/Projects
python emailing.py

To run the Python script from the terminal, simply type

python emailing.py

You can use the nano terminal text editor to view and edit your text files. When you use your BeagleBone Black to create a desktop environment, you have other text-editor options, such as Leafpad. If you are in the Projects folder, type the following command in the terminal:

leafpad emailing.py

Note that after you issue the command line to start Leafpad, the terminal becomes stuck; you can’t write anything in the terminal from that point on. (Well, you can, but it won’t have any effect.) That’s not a problem because you can have as many open terminal windows and tabs as you want, and only the one where you issued a command to run a program is stuck.

Any other open tabs or terminal windows are still functional. When you want to terminate something that’s being run in the terminal, for example Leafpad, simply press Ctrl+C with the terminal window that’s running it open.

Ctrl+C is the Cancel command when you are operating the Terminal. If you need to copy something from the Terminal, the appropriate shortcut is Ctrl+Shift+C. You can use Ctrl+Shift+X for cutting and Ctrl+Shif+V for pasting.

If running the script failed, you probably don’t have the necessary permissions. When you use the BeagleBone as a desktop computer, you’re logged in as debian. Regardless, you can still run programs as root. Don’t forget to log in as root or to precede your commands with sudo:

sudo python /var/lib/cloud9/emailing.py