I struggled for many years to get Linux to recognize my devices, so this chapter is close to my heart. But all that is now a distant memory – Linux has become highly compatible!
We’re going to look at everything you can connect to a computer and your Linux distro starting with the main storage devices (USB, external hard drive).
Use a USB Stick or an External Hard Drive
You're probably wondering what happens when you connect a storage device to your Ubuntu distro.
Is it going to cause problems?
Not at all! And it will be fairly quick too – it’s all taken care of and works immediately!
Don’t believe it? Just watch.
Connect a USB or Network Printer
What if I want to connect my printer?
It’s just as easy! Well, almost.
Almost?
Ubuntu now recognizes almost all printers on the market. But when it doesn’t, you need to show it the driver file.
What’s a driver?
Everything depends on how accessible these drivers are:
Are they open source and can be directly incorporated into the Linux kernel? Or are they proprietary? In that case, you’ll need to install the proprietary software.
Probably the best-known driver and printer story in the world of Linux is that of Richard Stallman:
In 1970, Richard Stallman was a programmer at MIT. As part of his daily activities, he regularly used a printer. But, like all good programmers, he was a die-hard optimizer who hated getting unpleasant surprises when he retrieved his documents (we've all been there!).
So, he decided to improve the driver controlling this equipment. It was quite simple – he had the skills and the need. A few hours of work later, he came up with a specific driver that suited him just fine.
And then IT became standardized. Patents and licenses became the new law for manufacturers and software publishers.
In 1980, MIT signed a framework agreement with Xerox to replace all of its printers.
The result of this was that Richard Stallman started having issues with the printer again.
No problem! He dug out the code he used the first time and tried to adapt the Xerox printer as he did before.
In the meantime, computer technology had moved on, and the Xerox driver was closed, meaning he couldn't make specific adaptations to it.
Richard Stallman was pretty annoyed and outraged that he could no longer adapt his IT tools to his needs.
This spurred him to launch the "free" movement. And seeing as he didn't do things in half measures, he set up a legal structure for this free software concept in 1985 called the Free Software Foundation.
This foundation has been the cornerstone of the free software movement and aims to guarantee access to source codes.
Of course, Richard Stallman did first ask for the source codes for the Xerox printer drivers.
The manufacturer refused. Looking back, this was probably both the best and worst decision ever made by an IT equipment manufacturer!
In the following video, we'll try to connect a printer and see what happens.
If you have difficulty adding a printer, don’t panic! Go to the Ubuntu documentation website, which will help you with whatever model you have.
Use a Mobile Phone
We’ve kept the best for last!
Connection sharing between your mobile phone and your Ubuntu distribution is what keeps you mobile with Linux.
It is the icing on the cake!
The Network Manager will help you do this. Once again, it takes care of everything – all you have to do is connect your phone (Apple or Android), and it works instantly!
Connect a Mobile Phone
Watch the following video to see a demonstration of connecting to an Android phone.
Network sharing in Linux requires you to configure the network card (your phone). You can find this feature in the same place as a classic network card: Settings -> Network.
And, in the terminal, you can use the ip a command to see your shared USB connection:
Use Internet Connection Sharing
Now watch a demo of how to use your mobile phone's internet connection.
As you’ve seen, you can set up connection sharing with a mobile phone with just a few clicks - it’s incredibly simple.
Let’s Recap!
Linux easily recognizes storage devices such as external hard drives or USB sticks.
Most Linux distributions easily recognize modern printers.
It’s possible to share a mobile phone connection with your computer in Linux.
Don’t make Richard Stallman angry!
You’ve seen that you can easily store and print files and connect to your phone. Let’s review some of the terminal commands you’ve seen.
Glossary of Terminal Commands
In this section, you've had your first venture into using a terminal and Linux commands. Never forget that the terminal is your best friend! If you learn to use it, it won't let you down.
Here's a quick summary of the commands you've learned:
sudo: Allows you to escalate your privileges.
apt-get update: Updates your distribution's package repository by connecting to its reference website.
apt-get upgrade: Updates all packages installed on your system. It's often launched just after apt-get update.
apt-cache search name-of-package: Lets you search the package repository to find the one that corresponds to your need by entering its name or a key word which could link to its name as a parameter.
apt-get install package1 package2 etc.: A simple way of using the terminal to install extra software on your distribution.
neofetch: A fun little command for retrieving system information. It requires package installation.
curl -fsSLo resource-url: You will have come across this command if you installed the Brave browser. Curl allows you to make a web request, like in a browser, but from the terminal. The subsequent options let you define its behavior.
echo “something” | sudo tee file: This is an interesting set of commands that may be a bit too complicated to explain here. All you need to know is that they allow you to script (i.e., automate) writing to files. Here, they allow you to add the list of Brave packages to the configuration files of your package manager.
df -h: This command lets you list storage devices and how much space is occupied on them. The option -h shows the result in a format intelligible to humans - i.e., by converting it into Mega, Giga, or Tera bytes. 😊
lsblk: Another command that lists storage devices, but with a focus on the system files linked to the devices.
ip a: For obtaining information on network card configurations.
ping: Allows you to check if equipment can be reached on the network by sending an “echo request;” if so, it will answer with an echo response (sometimes called a pong)!