Hardware Reference
In-Depth Information
For example, if you want to run the command
nano
in order to launch the nano text
editor, simply type the following command:
nan
Now press the
Tab
key. The bash will automatically autocomplete the command and
display this:
nano
This can be a real timesaver. If there is more than one possible combination of
autocompletion, you will need to press the
Tab
key twice. This will cause bash to list
all the different possibilities.
The bash's autocomplete system
Running commands as root
Linux is an inherently secure operating system. Every part of the operating system
has been configured to be secure by default. Every file is owned by a particular user,
and that user is able to allocate permissions to that file in order to restrict other users
and groups from accessing the file.
By default, all commands that are run in bash are run as the current user. The current
user is normally the Pi user. This user is a standard user, and this means that you
will not be able to run any commands that can affect other users, such as installing
software or changing the network configuration of your Raspberry Pi.
Fortunately, it is easy to run commands as the root or superuser. This user has
unlimited access to every part of the operating system and must be used with caution.
To run a command as the superuser, you can use use the
sudo
utility. The
sudo
utility
lets you run a command as a different user from what you are logged in as.
In order to use the
sudo
utility to run a command as root, all you need to do is
prepend the command that you want to run with
sudo
.
Take an example of the following command:
sudo apt-get moo