Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
BeagleBone Black Cookbook

You're reading from   BeagleBone Black Cookbook Over 60 recipes and solutions for inventors, makers, and budding engineers to create projects using the BeagleBone Black

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher Packt
ISBN-13 9781783982929
Length 346 pages
Edition 1st Edition
Tools
Concepts
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Preface 1. Setting Up for the First Time FREE CHAPTER 2. Basic Programming Recipes 3. Physical Computing Recipes Using JavaScript, the BoneScript Library, and Python 4. Exploring GNU/Linux Recipes Using Bash, Autotools, Debugger, and systemd 5. Basic Programming Recipes with the Linux Kernel 6. Run Faster, Run Real Time 7. Applied Recipes – Sound, Picture, and Video 8. The Internet of Things 9. The Black in Outer Space Index

Essential GNU/Linux commands – the command shell

Fancy GUIs are nice, but on BeagleBone Black, you will be mainly working with the command shell and its accompanying command-line tools to provide access to the operating system. First, let's take a look at some terminology: command shell, command-line shell, command line, or simply shell will all be used somewhat interchangeably as they all basically refer to the same thing—a means to provide access to the operating system with the command line and without a GUI. Bash is the default shell on Linux.

Terminal is yet another typical way to refer to the shell. The term is derived from its preceding technologies where any interaction with a computer required using a text-based terminal interface.

Often intimidating to new users, command shell is the starting point for any serious embedded system project. The Debian distribution for BeagleBone Black comes preloaded with two command-line tools to use a command shell: LXTerminal and Root Terminal. Although there are others with more robust and colorful interfaces that you can install, such as xterm and eterm, for simplicity's sake, we will use LXTerminal. In the next section, you will learn about the command syntax required within the tool. Finally, we will create, edit, and save a text file from the command line.

Getting ready

Ensure that your BeagleBone Black is set up and running in the manner described in the Introduction section. (Note that here, we will show the two different methods of running the board: powered via USB and powered via 5V).

How to do it...

  1. Begin by opening up LXTerminal, which you will find in the Accessories application on the lower left-hand side of the screen:
    How to do it...
  2. You will now see a command prompt that looks similar to this on your screen:
    How to do it...
  3. Just for fun, let's type in the following at the command prompt:
    debian@beaglebone:~$  echo Can you hear me Major Tom?
    

    This will show the following output:

    How to do it...

Congratulations! You've just sent your first command to BeagleBone Black (and it wasn't Hello World). But we're getting ahead of ourselves. Commands are for the next section.

How it works...

Let's take a quick look at the various parts of what LXTerminal shows us. Firstly, we know that Linux likes to keep the current user name at the front and center, in this case debian. This way, you always have a quick reference point to know whether you are a root user, which gives you total control over the system, or just another user with limited privileges.

Then comes the address of the device you're working on: beaglebone. You can actually customize the name, but we will save that for the appendix. Lastly, consider the $ sign, which denotes that you're logged in as a regular user. If you were a root user, the symbol would be the # sign. You will learn more about users and root users in a later section.

How it works...
You have been reading a chapter from
BeagleBone Black Cookbook
Published in: Nov 2015
Publisher: Packt
ISBN-13: 9781783982929
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image