I assume that you have in front of you a LiV Pi unit and you connected a keyboard, mouse and monitor to it. You powered up your device and you are looking now at the Raspberry Pi desktop. Your might or might not have already edited some configuration files following the instructions on www.livpi.com website. Click on the icon showing a black terminal at the top left side of the menu bar. Let's start our Linux journey.
The shell
The shell is a program that takes commands typed at the keyboard and sends them to the operating system where they are executed. If you’ve ever used a GUI, you are probably familiar with programs like “Terminal” or “Console”.
The default shell on Raspbian OS is called Bourne Shell (bash for short). There are other shells out there such as ksh, zsh, tsch, and others. There are no huge differences between shells, so if you know how to use bash shell, you know how to use them all.
A shell has a prompt. In our case, it looks like this:
pi@raspberrypi:~ $
It tells that your username is "pi" and the machine name is "raspberry". The dollar sign at the end is typical of a bash shell.
Let's try some commands:
pwd (present current directory) returns the name of the directory you are in.
pi@raspberrypi:~ $ pwd
/home/pi
whoami returns the name of the user at the prompt. This is a very useful command because it helps you figure out how users and groups are organized and their permissions (more about that later).
pi@raspberrypi:~ $ whoami
pi
man (followed by the name of a command) returns the manual page for that command.
pi@raspberrypi:~ $ man pwd
shows the manual page for pwd. You can scroll up and down the pages with arrows keys. You quit the manual pages by pressing the q
key.
history shows a long list of all the commands you typed in the shell before - in the order you typed them in.
pi@raspberrypi:~ $ history
.....
693 pwd
694 whoami
695 man pwd
696 history
If you want to invoke a previous command, you can use the !
sign followed by the command number. For instance, pi@raspberrypi:~ $ !693
will invoke the pwd command.
You can scroll up and down at the prompt line through the list of previously entered commands using the up and down arrow buttons of your keyboard.
uname returns info about the operating system and machine hardware.
pi@raspberrypi:~ $ uname -a
Linux raspberrypi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26
BST 2018 armv7l GNU/Linux
pi@raspberrypi:~ $
With exit you can terminate the shell.
pi@raspberrypi:~ $ exit