Linux
For BeginnersPhotoshop
For Beginners
Cloud
Cetus 4
For Beginners
Photography
For Beginners
yr tcl)
For Beginners
i=]E Te ea anid
Pe eeyr ln
For Beginners
C++ & Python
Leo) =i) ed
ALLL
Lela fst)
Coding
For Beginners
FRITZ!Box
Lael g ==)
Ce
ma
Google
For Beginners
Landscape
ively a
old {tala oidThe Complete
Linux
Manual
“That's what makes Linux so good: you put in
something and that effort multiplies. It's a positive
Feedback cycle.”
Linus Torvalds (developer of the Linux kernel)
Linux is everywhere. It powers the Internet as the main operating
mn R eR eee ee el eee le lara eo a)
Om eC eccatr cu tcean Ret
Te M oe AUS eR STM AVSIM Co) CCRel Ue -Ma NVa (red od
IU (aesese-]o) (MC n ea nen cecil Reon) elie elma lke[m
RAM ek CoM MTU Ana RSNA la ML CORO
operating system. Its unique configuration allows the user to
etree Meena Oe VAM ROSIN
Mita Umea Rent lale Meal -lim OM Ole -laleAc-l MeL Re Reece}
the next, install thousands of freely available apps and programs
and take back control of their computer.
PETTY aloo aM COL oe SA Cee Keo)
approach of other restrictive operating systems, freedom to
choose what you want on your computer, freedom to alter it
and use it how you please. It’s a worldwide community of like-
minded users, all striving to get the best development from this
incredible OS.
With this book, you too can become a part of the open community
lm Rt ate Mae aU cel CA Une te( RT| elt Re a
to grips with Linux, show you how it works, what you can do with
it and how you can code with it to take your Linux experience to
even greater heights.
[pyco MEN a) eo 00rent CCR
eee cue
SP ens ony Install Apps via the Terminal - Part 1
Cece? eels tiep acum ea
Which Distro? Pee ace
Creating a File Using the Terminal
el eee ea eae cog
PG AMA
rege ea se gcn ee ere
Pe a eae
Pee enn arene
Pe eee
Installing Linux in a Virtual Environment
Pre cee ec
eee ga
(eee eee
Cee eee eae
eee ease t ede)
Reena emu ec)
Cee ae!
eee easy
10 Things to do After Installing Linux Mint Gre U ial sxer een
Pree eee eeeis
eae
eae
Customising the Desktop
Cee Pee exe
te Se Se ae
Pacem ne Mem cy
Coe ae aefeels lag
ones
Reece
CePY saytettototinux
=Say Hello
to Linux
PNM Rn cara etea teks OTe ed
PTE ORCA ior aC Oy
aed Cy
De enue feta
eters eee eure are
and powerful operating system but
PRE MCU Os Cole)
CD ae ed
aun uk neo
but you need to know where to start;
we're here to help you out. In this section
you can learn what Linuxis, what a distro
isand what a desktop environments.
You canalso begin to explore how Linux
Pee ee ese
eeemy Say Hello to Linux)
Why Linux?
elm Aeg Tew) a= 6(oL
ieee Ker 1Ke(a)
Pee ei rcm ies Mraene Cente kesee cy
Pie MOE mea cuso eae eee Cauericae arn)
you may think though.
FREE AND OPEN
Linux isa Fantastic fit for those who want something different. The efficiency of the system, the availability of applications and
stability are just a few good reasons.
“The first thing you need to know i that there is no such operating
system called Linux. Linuxis in Fact the operating system kernel, the
‘core component of an OS. When talking about Linux what we, and
‘thers, are referring to are one of the many distributions o distros,
that use the Linux kernel. No doubt you've heard of atleast one of
the current popular distros: Ubuntu, Linux Mint, Fedora, openSUSE,
Debian, Raspbian, thelist goes on. Each one of these distros offer
‘something alittle different For the user. While each has the Linux
keel at its core, they provide the user with a different looking
‘desktop environment, different preloaded applications, different
‘ways in which to update the system and get more apps installed
and a slightly cifferent look and Feel throughout the entire system,
However, at the centre lies Linux, which is why we say Linux.
Linux is a great operating system on which to start coding.
OB * on
Linux works considerably afferent to Windows or macOS. k's Free
Forastart: Free to download, Fee to install on as many computers
as yu lke, Free to use for an unlimited amount of time and Free to
Upgrade and extend with, equally, free programs and applications.
This ree to use element is one of the biggest draws for the
developer, While a Windows license can cost up to £100, and a Mac
considerably more, a user, be they a developer, gamer or someone
who wants to put an older computer to use, can quickly download a
distro and get to work in a matter of minutes.
Alongside the free to use aspect comes a level of freedom to
customise and mould the system to your own uses. Each of the
available distros available on the Internet have acertain’spin,“There are thousands of free packages available
for programmers under Linux.
in that some offer increased security a Fancy looking desktop,
_agaming specific spin, or something directed toward students.
‘This extensibility makes Linux a more desirable platform to us,
_as you can quickly mould the system into a development base,
including many different kinds of IDEs For the likes of Python, web
development, C++, Java and so on; or create a base for online
‘anonymity, perhaps as a Minecraft server, media centre and
much more,
‘Another remarkable advantage for those looking to learn how
toccade,is that Linux comes with most ofthe popular coding
enviconments built in. Both Python and C++ are preinstalled ina
high percentage of Linux distros avaliable, which means you can,
start to program almost as soon as you install the system and boot it
up for the First time,
Generally speaking, Linux doesn’t take up as many system resources.
‘as Windows or macOS; by system resources we mean memory, hard
rive space and CPU load. The Linux code has been streamlined
ands Free from third-party ‘bloatware which hogs those systems
resources, A more efficient system of course means more available
resources forthe coding and testing environment and the programs
‘you eventually create, Less use of resourcesalso means you can
Use Linux on alder hardware that would normally struggle or even
© Why Linux? Vv
9 Oa
Je Mandriva elackware
sD @ &
Each distro offers something unique to the user
butall have Linux atthe core.
refuse to run the latest versions oF Windows or macOS;so rather than
throwing away an old computer, it can be reused with a Linux distr.
Ie'snotall about C++, Python or any of the other more popular
programming languages though. Using the command line of
Linux, also called the Terminal, you're able to create Shel scripts,
which are programs that are designed to run from the command
line and made up of scripting languages. They are used mainly to
automate tasks or offer the user some Form of input and output for
a certain operation,
Final, although there are many more advantages we can list, there
are thousands and thousands of Free programs and apps available
that cover nearly every aspect of computing. Known as packages,
there are (atthe time of writing) over 8,700 spectic programming
applications just on Linux Mint alone and an incredible 62,000+
‘overall packages catering for everything from Amateur Radio to
WWW tools
Linux then, isa great resource and environment for programming
in. l’s perfectly suited For developers andis continually improving
and evolving. you're serious about getting into coding, or you just
want to try something new, give Linuxa try and see how it works,
Foryou.
{A Linux programming environment can be as simple or as complex as you need it tobe.my Say Hello to Linux. )
The Best Linux
Distributions
BUTE ols elm (oa ol ane) EPL aes (oS
different ethos and approach. Here are five great distributions to try and where you
can get them.
GOING LINUX
‘The installation process for most distributions i similar. You download a disk image From the website and bur it to an optical disk or
create a USB Flash Drive installer. Just be careful to get the right distribution For your hardware and read the instructions carefully.
eae
8 Far the most popular Linux distro (distribution) is Linux Mint
Mint began life back in 2006, as an alternative to the then most
popular distro, Ubuntu. Although based on Ubuntu's Long Term
‘Support bul, Linux Mint tooka different direction and offered
the user a better overall experience.
Linux Mint has three main desktop versions available wth
‘each new version of the core OSikreleases. This may sound
confusing at ist but it’s quite simple. Currentiy, Linux Mint
uses the Cinnamon Desktop Environment asits flagship madet
there's MATE and xfce models available too.
‘Cinnamon a graphically rch desktop environment, MATE uses
less ancy graphics, and is more stable on a wider variety oF
desktop systems, and Xfce san extremely streamlined desktop
‘environment thatsbuil for speed and ultimate stably,
Throughout this title we'llbe using the Cinnamon version;
however, you can try out any ofthe other desktop environments
‘as you wish. n Fact its recommended that you do spend some
time trying ifferent environments, and even different distros,
tosee which suits you and your computer best.
wwwslinuxmint:com
“The second most popula stro available is Ubuntu, which
isan ancient African word meaning humanity to others:
UUbuntu's popularity has Fluctuated over its Fourteen year life.
systemin the world but some wrong choices along the way
‘ith regards to its presentation, and some unfavourable,
controversial elements involving privacy, sadly saw it topple
From the number one spot
“That aid, Ubuntu has since made amends andi slowing
crawling its way back up the Linux leader board. The latest
impressive environment, although it can be aitie confusing
For Former Windows users and ia litle heavy on system
resources, especially if youre planning on installing it on an
older computer:
Ubuntu, Forallits Faults, isa good Linux distr to start
and offers the user a complete Linux experience
‘wwwubuntu.com
‘Atone time, it was easily the most used Linux-based operating
versions ofthe OS use the GNOME 3 desktop environment, an
experimenting with. Isa clean interface, easy to use and install‘Arch is one of longest running Linux
distributions and forms the basis oF
many other versions of Linux. Why install
Mint or Ubuntu when you can install
‘Arch? Many users do exactly that but it's
not ideal for beginners. Ubuntu and Mint
both offer an easier installation path and
‘come with software packages to help
you get started.
‘arch on the other hand, isa more
‘bare bones’ affair. rch is committed to Free software and
its repositories contain over 50,000 apastt install, including
with any other distro.
Leah rel
No doubt you've heard of the Raspberry Pi. Is hard notte have,
asthis remarkable, tiny computer has taken the technology
‘world by storm forthe lasts vars since it was introduced
There are several aspects to the Raspberry Pithat makeit
such asought after piece ofthe computing world. For one
its cheap, costing around £25 For whats essentially afully
working computer. t's smal, measuring nat much bigger than
a creditcard. You can build electronics with it, using a Fully
‘programmable interface; andit comes with Raspbian its own
custom-made, Debian-based operating system that includes an
Office suite alongside many different programming languages
‘and educational resources.
Raspblan is exclusive ta the Pi hardware, since the Raspberry
ruses an ARM processor to power it. However, the Raspberry
i Foundation has since released aPC version of Raspbian:
Raspberry Pi Desktop.
ust like the Pi version, Raspberry i Desktop comes with the
allthe coding, educational and other apps you will ever need
W's quick, stable and works superbly. you're interested in
stretching your Linux experience, then thsi certainly one of
the top distros to consider.
www.raspberrypi.org/downloads/raspberry-pi-desktop
‘means your Arch dstra wor't came with ll the unnecessary Files and
appsthat others have preinstalled it’s custom made for you, by you.
multiple different Desktop environments, and use as you would
wwwarehlinuxorg
(The Best Linux Distributions om
‘Arch isa distro for when you're more
experienced with Linux. You start with
nothing but the command lin and from
there you have to manually partition your
hard drive, et where the installation
Files go, create a user, set the OS locale
and Finally installa desktop environment
along with the apps you want.
‘The advantage though forallthishard
work, isa cst that you have created. This
Most Linux distributions fall into two camps. There are ones,
with the latest Features and technology tke Ubuntu and
Mint and those with Few new Features but rock solid reliability,
lke Debian,
Mearubile, openSUSE attempts to cover both bases
OpenSUSE Leap isthe rock solid system. I's developed openly
bya community along with SUSE employees, who develop
~anenterpriselevel operating system, SUSE; this powers the
London Stock Exchange amonastother thing. tis designed
for mission critical environments where ‘there is no scope
For instability. If you find ll that too sensible, openSUSE
Tumbleweed sa rolling release with all the latest features, and
the occasional crash.
‘openSUSE isa highly respected Linux distribution and many
ofits core contributors work on the Linux Kernel, LibreOffce,
Gnome and other key Linux reas. short, openSUSE is where
you'l Find the pros hanging out
‘wwwopensUSE.orgmy Say Hello to Linux. )
Equipment You
Will Need
The system requirements for successfully installing Linux Mint on to a PC are
surprisingly low, so even a computer that’s several years old will happily run this distro.
However, it’s worth checking you have everything in place before proceeding.
MINTY INGREDIENTS
Before we start working our way through this book, here's what you need to install and run Linux Mint. You have several
choices available, so take your time and see which works best For you.
SYSTEM REQUIREMENTS.
‘The minimum system requirements For Linux Mint are
asfollows
cPU-700MHz
RAM/Memory—512MB
Hard Drive space - 9GB (20GB recommended)
Display - 1024 x 768 resolution
Obviously the better the system you have, the better the
experience will be and quicker too.
7
USB INSTALLATION
‘You can install Linux Mint onto your computer via USB or DVD.
\We look into each alittle later on but iFyou're already Familiar
with the process, or thinking oF USB and just gathering the
hardware you need, then you're going to
need a minimum 4GB USB flash drive
0 stare the Linux Mint ISO.
DD installation of
Linux Minesimply
need an optical
rive (a DVD Writer
rive) beFore youre
ble to transfer or
burn the IsO image
othe disc( Equipment You Will Need om
Mai eso
Installation toa virtual environment isa favourite method of testing and using Linux distros. Linux Mint works exceedinaly well
\when used ina virtual environment but more on that later. There are many different virtual environment apps available; however,
VirtualBox, from Oracle, is one of the easiest to into. You can find the latest version at www. virtualbox.org.
VirtualBox
INTERNET CONNECTION
le goes without saying really, that an internet connection is vital For
making sure that Linux Mint is up to date with the latest updates and
patches, as wellas the installation of Further software. although you
don't need an internet connection to use Linux Mint, you'll miss out on
world offree software avallable For the distro.
MAC HARDWARE
Although Linux Mint can be installed
‘onto a Mac, there's a school of
thought that recommends Mac
‘owners use a virtual environment,
such as Virtualbox or Parallels
and why not, macOS is already a
splendid operating system. If you're
wanting to breathe new life into an
‘older Mac, make sure t's an intel
CPU model and not the Power PC
‘models, Beware though, it's not as
pain Freeas installing on to aPC.PY sey Hello tovinux
Desktop Environments
WHICH MINT?
ADesktop Environment is the graphical interface which you use to interact with the core Linux system. Just as the graphical
desktop for Windows 10 is also called Fluent Design.
Linux Mint offers the user a choice of versions ofthe distro:
Cinnamon, MATE and Xfce. While that may sound alittle confusing
For the newcomer, essentially each of the versions avaliable contains
the same core Linux structure and kemel, the kernelis the core oF
the operating syster, that handles all he instructions between the
software and hardware
Each versions simply a diferent desktop environment, the
Graphical User interface (GU!) that you use to interact with the
‘operating system. Each of the desktop environments uses different
‘apps to access or use the system, such as the file manager to browse
the operating system's file structure or the way it launches other
‘apps. Again though, the core available productivity, video and
‘raphicsuites are the same, and Function in the sare way.
\Why bother then with afferent desktop environment? Simply put, its
‘down to personal taste. Some users prefer MATE, as MATE sa Fork oF
the classic GNOME 2 environment andi litte more menu-centrc
and performs well on older computers. Others prefer Cinnamon, which
is more modem environment that works better on recent hardware
and features some cutting edge desktop code. Xfce, on the other
hand, is lightweight desktop environment that works well on older
hardware due to is extremely low use ofthe avaiable system resources
In short, Cinnamon i the Flagship desktop environment For Linux
Mint. MATE is more compatible with a wider variety of hardware,
Where Windows, For example, only offers one desktop environment
towork in, Linux offers mary. Linux Mint has therefore opted to
bring the user a wealth of choiceDesktop Environments é
BEST MATE
MATE is a simple to use and intuitive DE that's fast and stable. In comparison to Cinnamon it looks a litle antiquated but that's
only on the surface. There's plenty to like with MATE.
FAB FEATURE 1
MATE isan excellent desktop
vironment for older computers. It
‘works better with alarger number of hardware components that
Cinnamon generally does but is also just as capable of delivering a
creat looking desktop as well as advanced customisation.
FAB FEATURE 2
Due to its highly configurable nature, MATE can be customised to a
Fine degree, There ae plenty of options available to the user who
ddemandsa litle more from their desktop environment, including
Compiz Settings, where you're able to configure all manner oF
desktop effects, even a 3D desktop cube.ry Say Hello to Linux
Which Distro?
DISTRO HOPPING
Distro hopping is aterm used by the community for people who never
sticktoa single distribution. Instead, they hop From one to the other
and back again, testing each, using them, then moving on to another
oranewly rel
There'snathing 39, as i's 8 good way to get to
‘rips with what's out there and discaver the elements of one distro
cover another that may or may not appeal to your tastes.
cof course is which one do you use overall?
While distro hopping sa good thing, 'snat exactly a stable way to
enjoy Linux and get the most From i. We're not saying you should stick
tone dstroand never laok elsewhere, as you would be missing alot
oF great content outthere, but instead we recommend you find a
handful and slowly progress through them based on your increasing
Lnuxstil
For example, Linux Minti an ideal starting place t's an easy to install
and use distro, has althe software you would normally use on a
dayto-day gently eases you
into the unique’ performs,
sis already installed out of-the-box a
yorid of Linux and how it w
Ubuntu offers much the same experience but it does this in aslightly
diferent way. There's generally less preinstalled with Ubuntuthan
with Linux Mint, so you would need to manually install it yourself
Another point worth considering isthe sheer volume of content and
help pages dedicated to Ubuntu users when using Linux. IFyou get
stuck, you're never too far froma solution to the
"Moving on, asyou begin to grow more confident wt
teston
Linux, you may
Fedora or Debian, These ae al
lent distros and each offers the user a slightly different
perspective on how the system runs, Some are more demanding, in
terms of Linuxskils, than others, ut essentially they each have some
valuable lessons to learn forthe user.
the likes oF open
You may Find yourself moving toa particular distro because it offers
something radically different from the norm, Tals Linux, For example,
Isa dlstro that’s designed purely for online anonymity. It contains
complexand military grade eniyption tools as wel as tools and
browsers designedto help you browse the web without ever being
detected, traced or monitored, Kal Linux is designed for security
professionals and contains many different kinds of ethical hackingWhich Distro? QI
tools preinstalled, that a user can run for penetration testing against
their network. There was once even a Hannah Montana Linux
distribution but the less we tak about thatthe better. The point being,
there's astro out therefor you.
Needless to say, once you've mastered Linuxto arelatively high degree,
probably a power user ability, then you will want to expand your sks
and begin to build your awn Linux distro based on Arch, Debian or one
of the many other distros avalable. Doing so involves a lot of command
line knowledge, as well asknowiedge on how the Linuxsystem works
and interacts with the hardware in the computer. You will need to
Partition your own hard drive, install a desktop environment and
eventually install the apps and programs you want. Doing so takes
time and again there are a lot of skills you're going to need to learn.
Eventually you can consider yourself technical Linux user but never
consider yourself an expert, after all we're always learning something
‘new. Youccan build your own distro from scratch, help other Linux
Users out with problems, maybe even contribute tothe improvement
of distro during itstesting phase or build. Where next then?
(Oddly enough, most higher-end technical users find themselves
back at square one, using a distro like Linux Mint. The main reasons
Usually because i's an easy option, and i's a stable environment
Just because you know the system inside and out, doesn’t mean
you always want to be Fixing potential issues. Most of us would
prefer the easy life, especialy where technology is concerned, so
the logical choice would be to choose astro that's simple, yet
still powerful enough to do everything you want it ta do, hence
Linux Mint.
However, inthe end, it's purely down to choice, your own personal
choice. Youmay ind that after going through the tutorials inthis title
you dont tke Linux Mint or the Cinnamon desktop. Fine, you may
prefer Ubuntu, Debian or openSUSE: that's the beauty of Linux. The
Freedom to change what you want, to distro hp from one to another
without being penalised by cst or lack oF access,
The answer to the question, which distro is any which one you like! It
canbe as complex or easy as youneedit tobe, aslong asit does what
youwantittodo, then ts perfect.ean
(developer of the Linux kernel)Getting
Started
with Linux
Tern Re eae Ets
Reese tan Nt ed al
Metre ea acy ent
ORCA One
Cee ee cea eeray
rea ene une Le
ea eRe tunes ole)
operating system and even how to install
Pees
SOU User)
Linux while still using your main operating
urs Mu ue
Intrigued? Read on and find out more.
Cee ee_
my Getting Started with Linux.)
Creating a Linux
Installer on Windows
You need to transfer the downloaded Linux ISO to either a DVD or a USB key before
being able to install it onto a computer. This will be a live environment, which allows
you to test the OS prior to installation, but first you need to create the bootable media.
DVD BOOTABLE MEDIA
‘We're using a Windows 10 PC here to transfer the ISO to a DVD. If you're using a version of Windows from 7 onward the
process is extremely easy.
FATE ERD istlocate the ISO image of Linux you've already REESE Right-click the Linux ISO and from the menu select
downloaded. You can usually findit in the Burn Disc image. Depending on the speed of the PC,
Downloads Folder in Windows 7,8.1 and 10 computers, unless you it may take a few seconds before anything happens. Don't worry too
spectied afferent location when saint. sich, unless takes mre than a minute, in whic case might be
. vot starting your PC and tying again With ck, the Windows
Name DiscImage Burner should launch.
H Quick access .
Se eee
{8 Dropbox Team B04 |-cinnaren-6ébit
© Mount
ta onedine
um dsc image
Bare EB] Scan with Windows Defender.
© co rive (E) Hisuite 2 Share
@ Network Open with
B Open with WinRAR
B Adato archive.
ESTEEM Next insert a recordable DVD disc into your FETED With the windows Discimage Burner dialogue box
computer's optical drive. After a few seconds, while ‘open, click on the Verify dis after burning’ tick
the discs read, Windows displays a pop-up message asking you —_box then the Burn button, The process should take a few minutes,
‘what to:do with the newly inserted disc Ignore this, as we're going depending on the speed of your PC's optical drive, Once i's
to.use the built-in image burning Function. complete itruns through the verification stage and when done the
optical drive should auto-ject the disc For you
© Windows Disc Image Burner x
Disc image ile: linuxmint-19.1-cinnamon-6tbitico
Dise burner: BO-ROMDiive(D)
Status
Burning dice image to recordable dsc...
207
\
USB BOOTABLE MEDIA
Creating a Linux Installer on Windows om
USB media is Faster than a DVD and often more convenient, as most modern PCs don't have an optical drive installed. The
process of transferring the image is easy but you need a third-party app First and a USB flash drive of 4GB or more.
FER Fico Fm FEI nen youre ready click on the tarbkton atthe
Chow pe bottom ofthe usp, Te may open up another
browser and gotoWWW. — cee dialogue box asking you to download and use a new version of
rufus.akeo.ie/. Scroll. (Ram RECS eTED ~ _ SysLinux. SysLinux is a selection of boot loaders, used to allow a
‘down the page alittle and tute Sc vue modern PCtoaccess and boot From a USB flash drive. tis necessary,
Youcometoa Download mans ae soiFased chon esto contin,
fang andere Il 3 Ss
ithe testerson of
aosvanaaverens eemanial
Teshouldhaveatready Format pons =| 2 Thenapeyotue necado oha nope Tenant cme
Per peel TREES ES Sop Dt gS
Use ashe ot st = les --7 spammed
remove andrenser — fecee spat ocean vec se ie
Pte motte
| @vien so mage mode Recormmende)
a som awe | OventOmgene
a | =n Een
PETER First olance the Rufus interface can look alittle
confusing but don't worry, its really quite simple.
‘To begin with, click on the SELECT button next to the ‘Disk or ISO
Image (Please select’ pulldown menu. This launches a Windows
Explorer window where you can locate and select the Linux SO.
na
EE the Linux
IsOisnow
Drive Properties
transeredtothe USB fe :
fiashdtive.Theprocess Sate
shouidnttake oolong, asians ae
agsindependingonthe temo ee
speed of the USB device =| eee a
and the PC. You may find ~ Swvstestsnercran
Rufus auto-opensthe USB Format Options
divein windowstxplorer Sucmnew
ding the process; don't fam am
worry you can minimise or
close itifyou want. When
the pracessis complete,
click on the Close button,
corm aenz
Getting Started with Linux
Installing Linux on aPC
UEFI BIOS
‘The Unified Extensible Firmware Interface (UEFI) is used to identify hardware and protect a PC during its boot-up process. It
replaces the traditional BIOS but can cause issues when installing Linux.
insert your DVD or USB flash drive into your PC and,
Fyou haven't already, shutdown Windows. n this
instance we're using the USB boot media but the process is virtually
identical. Stare the PC and when prompted press the appropriate
keys to enter the BIOS or SETUP, which could for example be: F2
Delor even F12.
FETED There are different versions of a UEFI 8105, 0
covering them all would be impossible. What you're
looking for is section that detail the Boot Sequence or Boot
"Mode. Here you have the option to turn off UEFI and choose Legacy
or disable Secure Booting, Most distros work with UEFI but it can be
atrcky process to enable it to boot.
ETS SE DD With UEF tuned to Legacy mode, there are now
two ways of booting into the Live Environment, The
First is via the BIOS you're already in. Locate the Boot Sequence and
change the first boot device fram its original setting, usually Internal
HDD or similar, to: USB Storage Device forthe USB media option o
DVD Drive for the DVD mecia option.
Sere ern ey
Pierre arene
First bet eves M1SBmb1 Tem teal >
FETED Atematively use the Boot Option Menus With this
‘option you can press F12 (or something similar) to
display list of boot media options; From there, you can choose the
appropriate boot media. Ether way, you can now Save and Exit the
0S by navigating to the Save & Exit option and choosing ‘Save
Changes and Exit
2. Aetunk oot frm 0 708
i esa bestess
S.Returk bt Tro 0 ae7E8 2
ter SetupINSTALLING LINUX
Installing Linux on a PC
(Once the Live Environment has booted, you see the option to install the distro to your computer. Have a look around and when
you're ready, look for the Install option on the desktop.
during the installation, Generally, the questions aren't too ifficut,
nothing very technical, but some suchas ‘nstlling third-party
software...’ can be confusing n this case you can click Continue but
iF you're unsure, have an Internet-connected device available to ask
‘any questions.
)
with the new, When you reach this stage of the installation process,
ensure the ‘Erase disk and install Linux. option is selected, NOTE:
‘This completely wipes Windows 10 fram your computer, somake
sure you have backups ofall your personal files and data,
FERED ®*0viding you're connected to the intemet (if not,
then do so now) and you're inthe Live Environment,
start the installation process by double-clicking on the Install Linux
Minticon on the desktop. Other distros display their own name, oF
course, but the process isthe same, Click Continue when you're ready.
FETED wile the installation process is very similar across
‘most Linux distros, some offer different questions
FETED Before the installation process begins, you're asked
ifthe choice you made regarding the erasure of the
hard drives correct. This is your last chance to back out. IFyou're
certain you don’t mind wiping everything and starting again with
Linux Mint, click Continue. Ifyou need to backup your files emove
the Linux disc/USB, reboot, backup and start again,
Eventually you ae asledto se up your ux
SUES username and password. Enter your Name to begin
vith then the Computer Name which the name sided
onthe networkas Next chose Usemame, flowed by & good
Pasnord. Youn kth Login tomatic option but ave the
Encrypt Home Felder option for now
BETSSEDD The installation process can be quick, and there may
bemore questions to answer, or it may simply start.
installing Linux based on your previous answers. Either way, you
tend up being asked to Continue Testing the Live Environment or
Restarting to use the newly installed OS. IF youre ready to use Linux,
then click Restart Now.
‘ZY Save, then File > Quit, Reboot Linux Mint and you should
notice a sight hike in performance.
EERE Security is alwaysa concern in this modern digital
‘While Linux Mints a secure system, it's
advisable to always try and improve it. Click the Menu button and
search For Firewall; click the Firewall Configuration icon and enter
your password, n the Firewall window, click the Status slider to On,ting to Know Linux
Apollo 11
aT PRE
eeu
pee een cuca
mankind first stepped on the moon, The
peers ee geen
eee nan ee Selene ak cs
at the time and had to be developed
Teer ern ks
eke ene eho MCL
Cee gee anc cid
econ ae aE)
special version of assembly.
DID
U KNOW.
Incredibly, that code is freely available
xeon ce Ey
Fete emu ee un easter
Pi or eam Rasen
Peon abridge ey
Pree Tune amc otc
925 with the comment “Goodbye. Come
Preece
Deer dst eu eats
you can find.
Programmers
sense humour
See whateleeie
inthere.
Ey
ae =
een One giant leap for
\ mankind, and coding.Na
ADC Laeee a
providing you various content:
brand new books, trending movies,
ee Ey eae
eae ecm
Unlimited satisfaction one low price
Cheap constant access to piping hot media
Protect your downloadings from Big brother
Safer, than torrent-trackers
18 years of seamless operation and our users' satisfaction
PTR Ey tert
Ie Tama Amel e Le
oleic
AvaxHome - Your End Place
We have everything for all of your needs. Just open https://avxlive.icuGetting to Know Linux.)
~s) )
Creating Users
When you first install Linux Mint it is configured for use with a single user. While
SPUR MU m-lecolt AUR MEUM MeN eon R eR a Role)
need to create separate users with their own unique Home folders.
NEW USERS
Having different users means each user has access to his or h
‘on are separate, as with multiple users on other operating sy:
Click on the Linux Mint Menu and type ‘users’ to
Sia
begin searching forthe relevant console, From the
‘search results, choose Users and Groups and enter your password,
‘The Users and Groups console is quite basiclooking, and thankfully
‘easy to use. At fist, you can just see your own username from when
you installed Linux Mint.
1ers own areas on the system. Documents, pictures, videos and so
stems.
Enter the new user's Full Name, followed by the
Username they need when logging nto Linux Mint.
‘Make sure the username isallin lower case, az and 0-9 characters
tony. You can have Fullstops, underscores or hyphens if you wish,
Click the Add button when you're ready to continue.
I
“man ante
User you can create, Standard and Administrator. Unless the new
User has need to install new apps or access parts ofthe file system
beyond their Home Folder, then opt For the Standard account type.
‘Otherwise, use the Administrator account type.
Toadd anew user, click the Add button atthe
bottom of the console. There are two types of
rs
Ey
Siar
‘The new user appears inthe ist of current Linux
‘Mint users, in alphabetical order. At present, there's,
no password set so click the user in the list of current users, then
lick the No Password Set option under the user's username.
eran rns --0
sepmienteYou can now enter a password forthe new user
a0
Password text box to generate a password for you, as well as,
displaying it Naturally i's good idea to come up with as strong a
password as possible. When you're done, clk the Change button.
Creating Users om
PEPE nce logged in the new user is requiredto set up
their own desktop wallpaper, icons, Panel, Menu
and so on, Depending on what Account Type you set up For them,
Standard or Administrator, they won't be able toinstall any new
apps. Thisscreenshot i from a Standard user account type.
Youcan dos the Users and Groups console window
SUES now, as the new user has been created. If you click
the Mint Menu, followed by Logout, you are presented with the
Mint Login Manage The new user show pesentin the is oF
Current avalble users Cckon himfr tog them
COMMAND LINE ACCOUNTS
You can create as many new accounts as you
Sues need and you're able to switch between them
when required. I's best to have ust one account that's capable of
installing new software, that way you can keep track of what's on
yoursystem.
Session
Log out ofthis system now?
Switch User
Just as you'd expect, you can also create a new user within the command Line. Open up a Terminal session under the main
Oye neers’
‘The process for adding anew
command line relatively simple. To begin
Tyausername>)
the new user's login name, You're then asked to create anew
Pei tr tama eg ae
Click yto confirm the details and create the user act
STEP 1
(SfifJeudo“adduser y
ae
a eee ts
Delete button in Users and Groups.
eet
the new user from within the Users and Groups
Ie eratemy Getting to Know Linux
Customising the Desktop
Customising the operating system desktop is one way to make it your own: a
Prater re Mel cjoLeM ea Aaa Caco NOUR OL MATT C MONK M KIM RUS
company logo. Whatever your reasons For having your own desktop, here's how it’s don
YOUR DESKTOP.
Linux is probably one of the customisable operating systems thet
some imagination, you can create something
Metistsoatofeetoncutoision sto ESTEE) out esto cite ables om ary
SUE? change the wallpaper. Right-click the desktop and SUES ‘of the locations provided to have them install as the
choose Change DestapBackroune Thsopensthe Backorunds_desitopwallpaper ndcentaly, you havelmages stored anther
SopinUnxbit remember ether dos maypresentter—_laetononyour same nebvriyou can 260 them by cng on
background walpaper selection tos erent the Piss atthe otto the Bacgrounds corel, using
the fle manager to locate them,
is. With just a Few tweaks, one or two extras installed and
credible.
PEPER More recent versionsof Linux Mint display available REAM ay clicking on the Settings tab you can instead,
backgrounds depending on the version the users play numerous images as a slideshow or change the
running, You normally et three categories followed bya fourth, aspect ofthe wallpapers toa variety o choices
Pictures, which is separated From the others. The Pictures option
is different because it reads the image content from the Pictures
Folder in your Home area =
8:
5 ie
cyfF none ofthe avaable walpapers take your
SHAPE fancy, open a browser and search For the type of
background iage you peer When youve Fond the image you
wane asthe desktop wallpaper ightclck it and choose Set Ae
Desktop Background From heise of options When the Set Desktop
Background console ope, click the Set Desktop Background button,
7) Be ae
Clckthe Men button and search or ‘desktop
SiG and click the Desktop Settings result. The Desktop
consoeallonsyouto pick the aout, deltop cons and options
formulsmontr support you wan. You can experiment wth he
options forthe best setup, according to your personal ates.
ination te changing te desleopwaloape,
SHEP and how the icons are displayed, you can also alter
the overall theme for Linux Mint, From the Mint Menu, search for
‘hemes and click the Themes app as it appears in the search results.
“ Customising the Desktop vw
Tees allonsyou to change the way etin
SIEPG aspects of the Mint desktop look: Window
Borders, kon, Controls Mouse Pointer and Dest, Inthe
Setting ab youcan exten the options wh ew ono sider
Buttons to
you dckon the Ademovebutoninthe centre
Sa) of the three available options, you can choose the
default ew from a umber of preinstaled themes. lick the theme
you wan then cick theta downward porting arow button
toenabet,
_
al
sy
Clckbackon Themes then Desktop andyou can
SUP HO locate the newly installed theme and apply to your
desktop Any staled Themes cn ao be uinstaledva the Ad
Remove buon les worth spending soe ie pesonasig you
desktop how you wanttand there are somelncedbe themes
svalabletoomy Getting to Know Linux
Becoming
Anonymous Online
The digital age has led to many great advances in communications; however, it has
also brought on a new age of spying and snooping. Most of us are no strangers to the
Frequent news stories of governments, secret organisations and underground hackers
breaking our privacy but how can you combat this?
ANONYMITY WITH MINT
‘hile it's virtually impossible to become totally anonymous online, you can take measures to ensure our privacy is at its best.
Pe nnn wcvfcrsust
FEED ine eotits mor
anything that’s transmitted over HTTPS is secure (hence the S part
at the end) and encrypted,
When you're browsing, consider using the Incognito
(or Private browsing mades available ina browser.
‘This disables your web history and web cache, allowing you to
browse without the details being stored For later scrutiny by
someone else. However, it doesn't stop any data or search tracking.
2
‘Although using Google may seem like the obvious
choice for a modern internet search, the company
does trackall searches made by an individual. Instead, consider an
alternative search engine, such as DuckDuckGo, a search engine that
doesn't store personal data or track ou.
Grae)
IF you're regularly on the internet then consider
Installing some ofthe browser plugins that
enhance your privacy. For example, for FireFox, use Ghostery,
NoScript and Adblock Plus to black trackers, adverts and other data
‘mining techniques.VPNS AND TOR
‘The previous steps can aid your online privacy but to really become anonymous you need a Virtual Private Network and Tor.
FETED VPN isa remote server or cluster of servers, that
establishes 2 connection with your computer. The
‘end resultis that your computer's identity on the Internet is hidden
bochind the VPN remote server; so you couldtivein the UK but have
‘an Paddress (the computer online identity) belonging to iceland,
HowfZN works?
aoe
When the downloads fished ro into the
Sua96) Terminal and enter the Downloads folder, cd
Downloads/. Enters to checkthetarxz Tres resent, then
enter: tar oxF ‘tor-browser-Linux64-8,0.40n-US. tar.
x2 (Tor updated regula s0 your version diferent press Tab
to autocomplete the tor-bronser ename) whenthe les ae
Unpacked, use c@ tor-browser-en-US/ tener the new ole
PEPTSPIM ost good VPNs charge a monthly or annual Fee
butit’s worth the expense. We use CyberGhost,
‘www.cyberghostvpn.com, which offers VPN connections for
Windows, Mac, Mint (as well as other Linux distros), Android and
10S devices, Detall for each OS can be Found at wwwsupport.
‘cyberghostvpn.com/hc/en-us/articles/213190329-Read-me-first-
Ciena
‘Another option isto use Tor. Tor’s an open network
that you can attach to that hides your IP address
behind countless nodes around the world t's available For Windows,
Macand Linux computers and is very easy to install and use, Start
by navigating to www.torproject.org/download/download-easy.
hhtmLen and clicking on the Download Linux 64-bit button.
ESTER 4 quick 1s reveals a couple of entries: a Folder called
Browser and a file called 'start-tor-browserdesktop’
To star the Tor setup, type ./start-tor-bronser .desktop.
This command launches the Tor setup, where you are offered two
‘options: Connect or Configure. For most users, the Connect option
will suffice, Click Connect when you're ready.
Tode| Browser
‘After the connection is established, the Tor Browser
launches. Thisis a customised version of Firefox
and From here you can securely browse the Internet without Fear of
being viewed or tracked. Mixing both a VPN and Tor makes For an
extremely secure and private connection tothe online world
(Becoming Anonymous Online omUsing the Terminal
— Anonymous (Posted on comp.
software.testing)Using the
Terminal
Boruc eae
Preece anc iaen
Fromit, you can bring the OS to its
knees, or update it to something
Bese ae eter
computers, look at an animated
Dede ae Ce el
Pe ORC aCe ok
froma serverin the Netherlands, and
code intricate automated scripts.
aneee cn n tctd
intricacies of the Terminal, and how it
works with Linux. You will learn how to
Date ee coer
the Terminal, and you will discover
Pee Rte te On)
cee
BU Ce ua cell
Ca aru SL)
ner nats
eeeLY) using the Terminal )
Basics of the Terminal
Most operating systems use two kinds of interface, the GUI, which is the desktop
that Windows, macOS and Linux Mint boot into and the command line. While modern
operating systems shy away from the command line, Mint uses the Terminal to give the
user greater control of the system.
TAKING COMMAND
‘The command line, or Terminal, is an extremely powerful interface. Everything you can do on the desktop can be done within
the Terminal, Let's start by seeing how it works.
PEPER The Terminal can be accessedby either clicking on REIEM what you currently seein the Terminal is your login
the Terminalicon on the Panel, located between name Followed by the name of the computer; as you
the Firefox and files icons or launched by opening the Menuand named it during setup when you firstinstalled Mint, Th line then
selecting it from the left-hand quick launch strip. tends with the current folder name; a first this isjustatilde ~, which
‘means your Home folder.
Piet eCe std
FETED The Terminal ives you acess to the Linux Mint FETEP DD The flashing cursor at the very end ofthe lineis
Shell called Bash, which gives you access to the where your text-based commands are entered. You
Underlying operating system. Everything in Mint, including the canbegin to experiment with a simple command, Print Working
desktop and GUI, sa module running from the command line, Directory (pw), which outputs the current folder you'e into the
screen. Type pid and press Enter.Basics of the Terminal (@
Alvecnmnsevertrvorntenme — ESSE vewandschopletyou tert got
SIEPE ‘manner: you enter the command, include any S18 the Terminal window and of course search within,
parameters entered tess ofthe command end press Eterto th Terinl for sry partly woes
execs the commande youve entered Type into the Terma
tome “ane pres Ente Ths dsl sone sterner mation —
regarding aT
are vesetveneingcanmendsletstie ESSE terete eens tea nd
Suz6 a moment to see what menus the Terminal has to Sua) sizing and allows you to alter the character encoding,
offer. The File menu option allows you to open anew Terminal, Interestingly, yucan also setieto a Read Only mode, which stops you
‘create anew profile, where you can alter the size, colours and From entering any commands into the Terminal: this s good For when
behaviour of the Terminal, adda new tab, and closeall current. youneed to permanently display the Terminal contents
active Terminal sessions,
ED itteeerercnadance corms: EARP rests te tt option denser
toand om the Terminl and other sourceshardy and version number the Terminal orto be
For when you want to copy a verylong and complex command froma more precise, GNOME Terminal well simply refer toit as Terminal in
‘web page. It also allows you to edit the current profile preferences. future. The Contents are worth having a quick read through, to help
Familiarise yourself with how the Terminal works.L)) using the Terminal. )
Update Mint via
the Terminal
Up to now you've been using the shield icon to launch Mint Update Manager in order
to update the system and upgrade the currently installed apps, tools and other
elements. However, you can also accomplish a complete system update and upgrade
from the Terminal.
USING APT-GET
‘To update and upgrade via the Terminal you use the APT (Advanced Packaging Tool) command. It’s a powerful command and
combines different elements depending on its use.
PETSEM seartby opening anew Terminal orifyou already — BBEMBMB Actoet is used to update and upgrade the
have one opened clear its contents with the clear software in Mint, as well as Ubuntu and other
‘command, Tis starts you off with a clean slate on which to work
Debian-based distros. Using the Update element retrieves
new package lists and updates the lst oF source files. Upgrade
‘downloads and performs an upgrade to the latest versions of those
AIRC files, To start the entire Upgrade and Update process, enter: sudo
apt-get update, followed by your password,
PEPER Enter apt-get intothe Terminal. This brings upa EEA Notice now the addition ofthe sudo command, The
st of the most used apt-get commands, along with ‘sudo command once meant Super User Do; these
days it's more acceptable as Substitute User Do. It means that the
administrative user (Super User) uses APT (Advanced Packaging
Tool) to Get any Updates. Now try this: sudo apt-get upgrade.
‘brief description of what the command does. It's worth having 2
lookat, evenif it doesn't make a huge amount of sense at this time.( Update Mint via the Terminal
A
Essentially, that’ it, your system s now up to date
according to the available list of packages from the
apt-get update command, You can run through the process one
‘more time, just to check f everything went okay. To recap, enter:
sudo apt-get update, press Enter, then type: sudo apt-get
upgrade and press Enter.
FEED There's likely tobe a long list of what seems
gibberish now filing your Terminal window
butdontt worry. The files necessary forthe upgrade have been
downloaded, prepared, unpacked, processed, installed and set up
correctly. There's a lot going on when you perform an upgrade, even
with the smallest package
TERMINAL VS UPDATE MANAGER?
Why use the Terminal to update and upgrade over the Update
Manager, regardless of the distro you're using? Some users
greatly prefer using the Terminal to update their Linux systems
and accompanying apps, in the belief that it’s better. However,
that’s not often the case,
Using the Terminal, apt-get upgrade, doesn't handle changing,
‘dependencies between versions of packages, sof a package
has its dependent files changed from one version to another,
‘then the upgrade is held back.
‘The Update Manager, or Software Manager (depending on the.
distro), often phases its updates and marks those packages
FERED ctecestingly, Linux Mint, among other distros,
offers you the ability to chain several commands
together. In this example, therefore, we can use sudo apt-get.
update & sudo apt-get upgrade. The double ampersandis,
what combines the commands and works perfectly, providing the
preceding command went without a hitch. It's recommended to
start any session with the update and upgrade combo,
‘with changed dependencies For updating, However, and this is
‘where Linux can often get confusing, sometimesit doesn't.
tall boils down to the developer of the package being
updated and the way the package is held in the distro’s
repositories and whether the update is classified as stable
‘or not. In essence, from the point of view of the user, iF you
update and upgrade using both the Terminal and the Update
Manager reqularly, then you willbe as up to date as possible,
and get the essential and necessary stable versions of the
packages and core software. If you're looking for cutting edge
package updates, then it's best to opt For a rolling release:
distro instead.L)) using the Terminal. )
Install Apps via the
Terminal—Part 1
There are different ways to install apps and programs on Linux. You can opt for the
graphical route, using a Software Manager, or you can use the Terminal. Often, the
Terminal provides better control over the software being installed and sometimes, you
have no choice in the matter.
COMMAND LINE INSTALLS.
Installing an app with the Terminal may require some nifty keyboard work but you get a better sense of what's being installed
and where.
BEER stalling apps orm the Terminalisoften relatively ETESMEMM Younced to enter y to confirm the installation,
simple. First though, you need to make sure that which takes up around §.SMB of storage in the
the system is up to date. To do this open up the Terminal and enter: syste, Once Stella i installed, you can see again that Mint has
sudo apt-get update && sudo apt-get upgrade.cnter automatically created the Games category in the Menu as well as
your password and accept any necessary updates, the app shortcut.
lecaryovesen sibastgtindteinarade EEEEPB) soneives wen itn stone you neo
thats ready stad onthe stun How Goyou tal moe apps _lesmply the rate sere ection whore the ota shel
though ego happens that es ertraorcnely simple. Fstyoualnguthel ts dependences he val aris and such it needs
need anapp totaly soletsuse els egan Enter sudo Qpt- tofuncon, Sart by ping inthis Sudo add-ept-repost tory
get install stella poaipeterievi/poa Press Ener when asad to and ecdhePPA
(Personal Package hieThis adds the repo for the app Variety Wallpaper
CChanger, an Ubuntu-based app that works in Mint
‘and changes the wallpaper automatically, Now thatthe repois added,
‘enter: sudo apt-get update, to update the new information and
‘add the contents of the repo to the package database.
REMOVING APPS
(_ Install Apps via the Terminal —Part 1
PEPEPD Nowto instal variety, enter sudo apt-get
install. variety. Pressy to confirm and accept
the installation, and to continue with the install. Once installed, you
can type variety into the Terminal torun the app.
In addition to installing apps, the apt command can also be used to remove any apps and helps keep the system tidy and free
up resources.
To uninstall, or remove, the Variety app enter the
BALD ‘coving sudo opt-get renove variety.
Enter y to continue with the uninstall oF the app; notice aso that
{you're informed of how much space you're Freeing up on the hard
drive asa result oF removing the app.
rs
While the ‘apt-get remove’ command uninstals an
app it doesn't get rid of the extra clutter that comes
‘with an app, such as configuration and library files. To completely
remove the clutter, enter:sudo apt-get purge variety,
FETISEDD when you remove apps from the system you're
be informed that some packages that were
automatically installed are no longer required. You already saw in
the previous tutorial, that you can tidy things up with the Following
command: sudo apt-get autorenove, followed by pressing y
toaccept the process.
Finally, to tidy up al the non-used packages in
the system, and to remove elements that the
autoremove command didn't, you can enter: sudo apt-get
‘utoclean. These lat few steps are vital for keeping your Linux
Mint setup in good working order and to trim off the unnecessary
excess caused by installations and upgrades.
Fie 6 Won Seth Teil ep
4L)) using the Terminal. )
Install Apps via the
Terminal—Part 2
Most of the time you'll get to install apps from the Terminal using the standard apt-
get command. However, sometimes an app demands a little more work. This means
installing an app From its source code, which isn’t as scary as it First sounds.
FROM THE SOURCE
‘The commands you'll need to become familiar with here are Configure, Make and Install. You'l Find a lot of apps use installing
From source, so it's certainly a skill worth investing time in.
PEPTSEDD source code files for Linux usually comein the form RNB The wget command retrieves content from the
Of TAR.GZ or TAR.BZ2. Both are compressed files internet, in this case the 822 file For Vim. To check
holding allthe core files needed to ‘make’ the app. Start off this _the file was downloaded successfully, enters. According to Mint’s
tutorial by creating a new folderin Home:mkdir Vim, file system colour key, the compressed fie should be displayed in red.
aT
Vim bythevoy isanadionced textedtor which [ERISBIPBR, we need uncompresthe contents ofthe file
wetiyseosan example ost Enter the new now so ener tar xf Vine?-4.tar.bzz to
fede cdVin then om witinthenew Voli eter the Trial Ntzou can pe" end pes he
Following command into the Terminak wget ftp://Ftp.vim. key toautofillthe remaining Fle name.
‘org/pub/vin/unix/vim-7.4.tar.bz2.ESTEE "you enter 1s again, you'll notice that anew
folder has been created: vim74; in light blue text
representing a older in Mint. ls always handy to create root Folders
forthe main app, then as you upgrade apps through this method
the individual versions wll each have their own Folder.
Type nc vin74 to enter the foley, ands agin
Sue6 to view its contents. There will likely be a Fair number
of fies resent most arethe apes oe les, wile others ibe
Labeled README or NSTALL Its lays ise to read theses fist
2stheyprovdevauabe information regarding the instalation
FERED Te firstpart ofthe installation requires you to enter
/configure. The jconfigure command will check
‘your system for any missing dependencies associated with the app. IF
{you received an error regarding a Compiler, then enter: sudo apt=
get install build-essential. The third-party app Nurses
‘was recorded as missing, We need to install that with: sudo opt—
get install LibncursesS-dev Libncursesn5-dev.
A
(_ Install Apps via the Terminal —Part 2
You may need to keep installing new dependencies,
depending on the app. After each new dependency
isinstalled, re-run ./configure and when it doesn't report back
with an error you can continue to the next stage of the installation
Note: you may needto search onine For some error messages.
FE osc oppure ves
Be RER Final, you need to enter: sudo make install
into the Terminal This will install the app, and
‘make it ready for use in the system. When complete you can execute
the app, in this case by entering vim into the Terminal or searching
For itvia the Dash(One uura eur ene:
Cecemrrnatas7 Toys ream Screen sce
ROE et mre Cal
Enabling fast FPU save and i CIT
Enabling unm 5 CeCe i eee
Initializing
Teen TT)
| enables
ieee ea (order: 0, 4096 bytes)
MECC) Ca bytes)
pee oe acl
(tieme mC)
Gane cece ris
fixmap a
ETC
Or)
sta
data
ror
checking if this pro honours the WP bit even in supervisor mode
elena) 5 cific routine.. 4047.64 BogoMIPS (1pj=2
ey
CeCeeL)) using the Terminal. )
Creating a File Using
the Terminal
Using the Terminal, you're able to create folders, files and even execute Linux Mint
apps. In truth, iF you didn’t have the GUI at hand, you could still accomplish the same
from the Terminal.
MORE TERMINAL WORK
Creating content using the Terminal isn't quite as strenuous as it may first appear. Yes, the Terminal can look a daunting place
For the newcomer, but once mastered it's realy quite intuitive.
PEPER) open upthe Terminal and makesureyourein the — [EIENBB Your command ine should change to the Test folder
ome Folder. not use the ed ~ command to return and if you enter Ls (List folder contents) there'll
{YoU to the Home folder From wherever you're curently located, bbe nothing within the Folder as you've just created it.The mkdir
‘command is fairy self explanatory: Make Directory Followed by the
name of your choosing.
1 es startby creating a new folder vthin Home, Tocreatean emoty textile caled Test, enter
SuaPe and call it Test. The command you'll need is Uae) in the Terminal: touch Test. txt. You can then
kd Test PressEntertocrestethefolderuhenyou'vetyped__use T's toview then lein the oder, Touch a tandrd Linx
in the command, then ed. Test and press Enter. This wil Change command that allows the creation of files without the need to open
Directory hence €D) to the newly created Test folder. a text editor, save the file, then clase the editor.FTES Let's say younow wanted to create a text file, wel
callit Test2.bxt, complete with some content. To do
so,enter:cat > Test2.txt, Thiswill create the file Test2.txt and
putthe Terminal into an editing mode.
davidedavt
Fle Et View Search Terminal Help
rr
( Creating File Using the Terminal (ZY
Xed isa GUI app, and you can enter text and save
Mia
‘main window, and the File > Save, or File > Save As Functions From
its top menu bar options.
koelas
Youll notice that the cursors Flashing below the
cat > Test2.txt command, without the usual
prompt. This editing mode will alow you enter the text thatthe file
«will contain, Enter some text, then press Ctrl+0 to exit and write the
‘contents to the file.
(Of course you don’t always have to use the Terminal
toeenter text into aie. Mint comes with a text
‘editor called Xed, which is similar to Windows’ Notepad. To view the
previously created ile in Xed, type into the Terminal: xed Test2.
‘ext, and press Enter.
Terminal. For example, try Firefox, and press Enter. Close Firefox
to return to the Terminal. Providing you know the name of the app,
ican run from the Terminal, Additionally, entering fireFox& opens
Firefox, AND lets you still use the Terminal.
I however,youpreferto remain working inthe
Snare) ‘Terminal to edit/save/create files, you can use
Nano. Nanos simple Terminabased text edo Tot wth
the example enter nano Test2. txt. Thee'sa menu along the
bot ofthe screen Toentandsave ay content in Nano, press
Cex and follow the onscreen instuctos,
We've used the Terminalto launch a Mint app,
Xed, but any app can be launched From within theL)) using the Terminal. )
Creating and
Removing Directories
As with creating files in the Terminal, you can also create and delete directories, or
folders if you prefer. Directories form the structure of your file system, without logical
directories the filing system would be in utter chaos.
MANAGING FOLDERS
Learning how to create and delete Folders in the Terminal is an important Mint, and indeed Linux overall, skill to master. Here's
the basics for you to try out.
ERTISEDD withthe Terminal open enter cd ~ to make sure FETED you were to enter the command again, mkdir
you'e in your own Home directory, Now enter Is testdir, youll receive a message stating: mkdir:
toview the current folders you have housed in the Home directory. cannot create directory ‘testdir’: File exists.It
You natice that Folders ae labelled in Mint in cyan (ight blve). {goes without saying then, that you're only able tohave one uniquely
Let’ start by creating anew directory. Enter: mkdir testdir. named directory within the current directory, However, 3s Linuxis
casesensitve, you can have Testi, TestDir,testDir and soon,
ESSE | vounowenter's again, youll see that the new FTE ou can create directories within directories you've
directory testi, has been created alongside the already created. For example, enterthe testdir
‘other directories in the Home area, Obviouslythe commandmkdir — directorywith cd testdir/ Followed by to ls the Folder structure,
iswhat creates the directory, and no doubt you've already quessed Naturally there's nothing present, as youive ust created the director.
itstands For Make Directory. Now drop backto Home with ed andentermkdir testdir/
reports. Gobacktothe testdir, cd. testdir/, and Ls again.The command to create directories s quite logical,
therefore. Youll create the directory, and any sub-
directories within, However, what iFyou want to create a directory
and a sub-directory ina single command? Make sure you're at Home
(cd~) andentermkdir -p Temp/finances. Now, od Temp/, and
Istolist the new directory
Creating and Removing Directories
A
FETED Now that we've created some directories, let's see
‘bout removing them, Start by entering the testir
directory and listing its contents: ed testdirf, then Is. The previously
created reports sub-directory is present. One way to remove itis to
enter: rmdir reports, ten ls again to confirm isnot there.
Command, Option, and Argument: Inthe previous step example,
‘command (mkdir), option (p), and argument (Temp/finances)
Fle Edit View Search Terminal
errr
Help
Cer Tr |
FETISERD you want to dill down into the various options
available For the mkdir command, you can enter
mkdir =-help into the Terminal. This will provide a quick help
‘guide detailing the options and how the command structure works.
eT Pri wil only remove empty directories, to
remove directories containing sub-directories, or
even files, youl need to use the rm command with the - option.
For example, on the Temp/finance directories, use rm -R Temp.
A.quick reveals that the parent Folder and al of its contents are
removed. Careful when using this command,L)) using the Terminal. )
Fun Things to do
in the Terminal
Despite the seriousness of an operating system, the Linux community are certainly no
strangers to a bit of Fun. The developers over the years have created and inserted all
manner of fun and odd elements into the Terminal.
TERMINAL FUN
You'll be working exclusively in the Terminal For these next two sections, so start warming up your fingers. After all, all work
and no play... as the saying goes.
PPE The first command we're going to use is shit's FEPISED) you've ever fancied having the computer read a
rnotinstalled by default so enter: sudo apt-get random fortune out to you, then you'e in luck. Most
install sl. The command can berunwith sland when executed distros require you to install the Fortune app, however Linux Mint
will display 2 Steam Locomotive travelling across the screen (hence differs somewhat by having it already pre-loaded. Allyou need to-do
‘51. Entering LS, note the upper case, also works isenter the command Fortune into the Terminal, and enjoy.
SF Starwasevengetafawinentcomesto ESSAI The rev command iscerainy teresting, andat
the Terma Sytningios rae server the Trauhatseent a qute uses sdanos tothe
telnet command, you can watch Episode IV: ANew Hope being (0S. However, it can be used to create some seemingly unbreakable
played out, albeit in ASCIL To view thisspectacle, enter: telnet _passwords. Enter: rev, now type some text, when you press Enter
towel .bLinkenlights.nl next, everything you typed in will be reversed. Press CtrlsC to ext.(Fun Things to do in the Terminal @@Y
PS TESED you're stuck trying to work outallthe possible FETED you really want to expand the whole cow thing,
factors for any particular number, simply enter
For whatever reason, then pipe the Fortune
Factor Followed by the number. For example, factor 7doesn't command throughit, with: Fortune | consay; and for the
offer much output, whereas Factor 60 displays more. ‘graphical cow equivalent: fortune | xcowsay. Plus, there's
always cowthink. Try: cowthink ...This book is awesome.
PETE There'sa fine line between the rather cool and PEPE The command toilet doesn't inspire much
realy-quite-weird. Having an ASCII cow repeat text
confidence, we'll admit. However, is not as bad as
toyou could potentially fll inthe latter. Enter cowsay followed —_itfirstsounds. Start by installing it with: sudo apt-get install
by any text you want, such as: cowsay Linux Mint is ace!. toilet. Then when installed, type something along the lines of
In fact, you can even output the ls command through the cow,by toilet David. Or perhaps list the contents ofthe current Folder
centering: Ls I cowsay. throughit, with: Is | toilet.
Toutherthe cow element there's evn graphical Expanding the tot command, youcan actualy
SPE ‘Le, non-Terminal, cow available, Install it with: SUP HO
‘generate some decent looking graphics through
sudo apt-get install xcowsay, thenwhenisinstaled enter it, Forexample, uy this toilet -f monol2 -F metal David.
something similar to cowsay suchas: xconsay BOM Publications. Youcanentertoilet --help, for alist of the command line
arguments to expand furtherL)) using the Terminal. )
More Fun Things to
do in the Terminal
IF the previous list of fun, and quite bizarre, things to do in the Terminal has you
wanting more, you're in luck. We've put together another batch of some useful, and
some not so useful, commands for you to try out.
MORE FUN, YAY
Since the Terminal session is already open, and your keyboard digits are nicely warmed up, here are another two pages of
Terminal nonsense.
PATER ED Remember the old 2x Spectrum days of computing, ERTS Having alittle white cat chase your mouse pointer
when you could type in 10 print “Hello”, 20 goto 10 ‘around the desktop may sound tke a terrible waste
‘and Hello would list down the screen? Welt in Linux Mintyoucan do of time. Oddly though, itis. Enter: sudo apt-get instal
the same. Simply enter yes followed by some text, ie. yes Linux oneko, then type oneko to have the cat appear. Move your ‘mouse’
is ace. It'll keep going until you press Ctrl+C. cursor around the screen and the cat wil chase't, Use Ctr 1+C to
exit the action,
FSTESE DD The Matrixwas one of the most graphicaly copied EESIM This entry saittle more serious than the previous.
Films ever released; there's even a version of the It's called the Fork Bomb and what it does, basically
Matrix code available for Linux Mint. Installit with: sudo apt-get is continually replicate itselFuntilit has used up al the available
install. cnatrix. when it's done enter: cmatrix.nd follow system resources, thus causing your computer to crash, You don't
the white rabbit, Neo, Unlike the real Matrix though, youcan press have totrytbut it's interesting nonetheless. Simply enter:
Cerl+C to ext. 1:& }: and be prepared to reboot.
File Edt View Search Terminal Helpssuch a powerful element to an 05. Using the while command, For
example, together with tol, can yield some impressive results,
Enterwhile true; do echo “S(date ‘+XD XT’ | toilet
-f term -F border --metal)”; sleep 1; done.
Talking computers were the craze ofthe 80s, enter:
espeak “Hello, this is Linux Mint”
tohave the computer repeat the text inside the quotes to you
Make sure your volume is turned up, and try the following: ls >
folders. txt && espeak -f folders. txt. This willhave Mint
read back the contents ofthe Is command.
Vem Search Terminal Help
Bea 8 02tIng ASCI fire isnt the most useful command
to have at your disposal, bt i's Fun. Install it with:
sudo apt-get install Libaa-bin, then when installed use:
‘afire, I's not exactly warming but you get the idea. To expand
the above, enter: sudo apt-get install bb caca-utils,
then, cacafire,
ra
More Fun Things to do in the Terminal
Used as a music demo from the old Amiga and
DOS days, the Bb command reminds us of getting
hold of three and a hal inch Floppies crammed with all manner oF
demoscene goodies. We've already installed bb from the previous
step, sojust enter bb. Follow the onscreen instructions, and turn up
your volume.
‘This entry is in two parts. First youneed to get
Sua) hold of the necessary packages: Sudo apt-
get install Libcurses-perlL. When that’s done enter: cd
Donnloads/ && wget http://search.cpan.org/CPAN/
‘uthors/id/K/KB/KBAUCOM/Term-Anination-2.4.tar.g2
88 tar -xf Term-Animation-2.4.tar.gz && cd Tern-
Animation-2.4/.Then:perl. Makefile.PL && make && make
test && sudo make install.
With that litle lot dane, onto the next. Enter: cd
&& nget http://mm.robobunny..con/
projects/asciiquariun/asciiquarium.tar.gz && tar
=xf asciiquarium.tar.gz && cd asciiquarium 1.1/
8B chmod +x asciiquarium. Providing all went well, enter ./
asciiquariumand enjoy your very own ASCIF-based aquarium,PY using the Terminat )
Linux Tips and Tricks
As you've seen, the Linux Terminal is quite an exceptional environment. With a few
extra apps installed, and a smidgen of command knowledge, incredible, and often
quite strange, things can be accomplished.
TAKING COMMAND
‘There are countless Linux tips, secrets, hacks and tricks out there. Some are very old, origi
while others are recent additions to Linux lore. Here's our Favourite ten tips and tricks.
ting from Linux’s Unix heritage,
PIG [mes the text editor, sa great piece of
software, however, did you knowit also,
‘contains a hidden Easter Egg? With Emacs installed (sudo apt-get
Install emacs25), drop to a Terminal session and enter:
emacs -batch -1 dunnet
Dunnetis a text adventure written by Ron Schnell in 1982, and
hidden in Emacs since 1994,
SMe EER fer fancied being able to
browse the Internet from
the Terminal? While not particularly useful itis quite a Fascinating
thing to behold. To doso, enter:
sudo apt-get install elinks
elinks
Enter the website you want to vist.
PUTT fete 22:2d on the classic 1982 arcade game,
Moon Patrol, Moon Buggy appeared on
the home computers of 1985 amid much praise. Ir'sa cracking Atari
‘game, andi’ avalabe in the Linux Terminal by entering:
sudo apt-get install moon-buggy
Then:
Pe Scowing in the Terminal console isnt
something you come across every day. IF
you're interested, however, enter:
get https://gist .githubusercontent con/sontek/
1505483/ran/7d0247160057e69°bS2632F ee09F42
753361c4a2/snowjob.sh
chmod +x. snawjob.sh
/snowjob.shMEMORY HOGS
Linux, simply enter:
IF youneed to see what apps are
consuming the most memory on
Ps aux | sort -rnk 4
‘This sorts the output by system memory use,
When you delete afile, there's chance of
someone with the right software being able
toretrieve it. However, to securely and permanently delete afl,
use shred
tao} s39
shred ~zvu NAMEOFFILE. txt
Replace NAMEOFFILE with the name ofthe file to delete,
FraIP Gap 4°! art can be quite striking when applied to
some images. However, it's often difficult to
‘get just right. You can create some great ASCIl at From the images
you have by using img2txt:
‘img2txt NAMEOFIMAGEFILE..png
Replace NAMEOFIMAGEFILE
with the actual name of the
image fle on your system. IF
img2txt instal installed, use:
sudo apt-get install
caca-utils.
A
Linux Tips and Tricks
servers provided hang-outs for users to chat, swap code, play games
and more. Using telnet in Linux, we can still connect to some active
BBSes:
telnet battlestarbbs. dyndns.org
There are countless operational B8Ses available, check outhttps://
wurw.telnetbbsguide.com/bbs/list/detaly, For more,
FLELP EEE;
ea
IFyou want ta create an entire
directory (or Folder) tree witha
Dy ere) aa
single command, you can use:
mkdir =p New-Dir/
{subfolder1, subfolder2, subfolder3, subfoldera}
This creates a New-Dirwith four sub Folders within,
leat easy tying
FORGOTTEN COMMANDS
torememberall the
available Linux commands. Thankfully, we can use apropos to help
Us. Simply use't, along with a description of the command:
apropos “copy files”
apropos “rename files”wv
a
iW
Uv
c
oO
oa
3
€
7mV,
Wat,
A
=e
MN =o
VA .
ay
Yo Zee
SS
4
ff
NN
Ze
ves
—EY) using the Terminal )
Creating Bash Scripts
eee:
Eventually, as you advance with Linux Mint, you'll want to start creating your own
automated tasks and programs. These are essentially scripts, Bash Shell scripts
to be exact, and they work in the same way as a DOS Batch file does, or any other
programming language.
GET SCRIPTING
ABash script is simply a series of commands that Mint will run through to complete a certain task. They can be simple or
remarkably complex, it all depends on the situation,
EETRER Youllbe working within the Terminal and witha FETIRED) 1 beain with, and before you startto write any
text editor throughout the coming pages. There scripts, youneed to create a folder where you can
putall our scripts into, Start with mkdir scripts, end enterthe
Folder cd_scripts/. Thiswill be our working Folder and from here
you begin, however, run through the customary update check: Sudo you can create sub-folders if you want of each script you create,
are alternatives tothe text editor, which welllook atin a moment
but forthe sake of ease, wellbe doing our examples in Xed. Before
apt-get update && sudo apt-get upgrade.
Fe Edt View Search Terminal Help
FETED thereare several text editorswecanuse tocreate — EEEIMM windows users will be aware thatin order fora
8 Bash script: Xed, Vi, Nano, Vim, GNU Emacs and batch file to work, asin be executed and follow the
‘soon. Inthe end it all comes down to personal preference. Our programming within t,t needs to have a BAT file extension, Linux
Use of Xed is purely due to making it easier to read the scriptinthe _isanextension-less operating system but the convention isto give
screenshots you see below. scripts ash extension,
Fie Ede View Search Terminal Help( Creating Bash Scripts—Part1 @Y
cramanearcescecouoa one ERE wen vaca tsnin sansa
Siete encrcad vetoed a ERED yavushscin ncn uments
Tuewtlanchscseniecneeeectestcattd,— wdartogeen monty ssetrrenmonenneene hk
crtetlonptliahesk beronorewinccee” — Wesoge naburemismetsone hegre sped Pak
ata ee ar
Fle Edt View Search Terminal Help Fle Et View Search Terminal Help
Fle Edt View Search Toot Documents Help
Doan~|xyooajag
1 /sin/bash
Tetiintasve siesta she EEE aon eevee ao
allah you're going to be using, in this case Bash. The hash S28) World!’ should now be displayed in the Terminal.
(e)éenotesa commen ine ane tat snared the sytem the” The eco command's response or ututng he word after
tccarton mark meas thatthe conmertbypasedand wil RintheTemioa as we move onyoucan make the ech command
face rescipttoexeatethelnessaconmand Thslsabakown output othe Sources
dsavshaang
Fle Edt View Search Toots Documents. Help
Doajn+|/yeonjaa
Fle Edt View Search Toot Documents Help
Boanv|xoojag
(Bm etoworsah
1 otn/bash
1 /bin/bash
EEGED rest siesta sneak ctetnactiectsenscrtconnont
Bact the Tetrinal Entering L, wl veal the displays eer text, pumbers oar variabies hat,
script inthe folder. To make any script executable, and able to are stored in the system, such as the current system date, Try this
run, you need to modify its permissions. Do thiswith chmod +x _example:echo Hello World! Today is $(date +XA). The
helloworld.sh. You need to do thiswith every scriat you create, _$(date +%A)s calling the system variable that stores the current day
of the week.
Fle £6¢ View Search Terminal HelpUsing the Terminal. )
8
Creating Bash Scripts
—Part 2
Previously we looked at creating your first Bash script, Hello World, and adding a
system variable. Now you can expand these and see what you can do when you start to
play around with creating your own unique variables.
VARIABLES
Just as in every other programming language a Bash script can store and call certain variables From the system, either generic
or user created.
Let’ start by creating a new script called hello.sh
xed hello. sh. In itenter:#!/bin/bash, then,
‘echoHello $1. Save the file and exit Xed. Backin the Terminal
‘make the script executable with: chmod +x hello. sh.
ie tlt Ven Seach Teil Hp
noo xeojag
os oinroasn
EEGED The output now will be Hello David. This is because
Bash automatically assigns variables for the user,
which are then held and passed to the script, So the variable
'$ now holds ‘David. You can change the variable by entering
something different: ./heL1o.sh Mint.
File Eat view Search Terminal Help
ratty
Patra)
Patent
FSTESED Asthe scriptisnow executable, run itwith «/
helo. sh. Now, as you probably expected a simple
‘Hello’ is displayed in the Terminal. However, iFyou then isue the
‘command with a variable, it begins to get interesting, For example,
try ./hetlo.sh David
File ES View Search Terminal
Bere oucan even rename variables, Modify the hello,
sh script with the Following: firstname=$1,
surname=$2, echo Hello Sfirstname Ssurnane, Putting
each statement on a new line, Save the script and exit back into
the Terminal
le Ede View Search Tools Document. Help
20m xo0 ag
a elioeh »
‘1/bin/bach
echo Hello $firstname SsurnaneWhen you run the script now you can use two
custom variables: ./helLlo.sh David Hayward.
Naturally change the two variables with your own name; unless
you're also called David Hayward. At the moment we're just printing
the contents, so let's expand the twowariable use alitle
( Creating Bash Scripts — Part 2
A
FETTER {t's expand things Further. Create a new script
called greetings .sh. Enter the scripting as below
inthe screenshat, save it and make it executable with the chmod
command. You can see that there are afew new additions to the
script now.
Fle Edt View Search Terminal Help
Careers
fakewrenmmanrers
Create anew scriptcaled addi tion. sh, sng
Sue6 the same format as the hello.sh script, but
changing the viable names Here weve added irstnumber and
Secondnumber and used the echo command ta output some
Simpl arthmeticby lacng an integer exresson, echo The. Sun
is S¢SfirstrunbersSsecondnumber)),Save the sit and
make it executable (chmod +x addition. sh).
Aoa nw xooH ag
a1 bin/bash
firstnumber=s)
Jecho ‘The sum 15 §(($firstnunbersssecondnunber))
FETESE RD When you now run the adeltion sh script we can
enter two numbers: ./addition.sh 1 2.The
result will hopefully be 3, with the Terminal displaying The sum
is3. Try with a Few different numbers and see what happens.
‘See also if you can alter the script and rename itdo multiplication,
‘and subtraction,
leit View Search Terminal Help
EY
area are
enag
AoA nw x
im gectrgssh x
#1/bin/bash
fread firetnane
jecho =
clear
Jecho Hello sfirstnane Ssurnane, how are you today?
Weve added -ntothe eco commandhere
Sua) which will leave the cursor on the same line as the
aueston, instead of anew ine The read command stores the
User input asthe variables Ristnameand surname, to then ead
backlaterinthe as echo ne. And the Lear command clears
thescree,
Filed View Search Terminal Help
ESTED DD 252 inal addition, let's include the date variable
wwe used in the last section, Amend the last line
of the script to read: echo Hello $firstname $surname, how
are you on this fine $(date +%A)?. The output should
clisplay the current day of the week, calling it from a system variable,
Fle Ect View Search Tooke Document Help
Doainv)xyenjag
1m eeeengash
|ereinveash
tlestnane
Nello sfirstnane ssurnane, how are you on this fine s(datUsing the Terminal. )
8
Creating Bash Scripts
—Part 3
In the previous pages we looked at some very basic Bash scripting, which involved
outputting text to the screen, getting a user's input, storing it and outputting that to
the screen; as well as including a system variable using the Date command. Now let's
combine what you've achieved so far and introduce Loops.
IF, THEN, ELSE
‘With most programming structures there will come a time where you need to loop through the commands you've entered to
create better Functionality, and ultimately a better program.
ESTISEDD | {2t'slookat theif, Then and Else statements now,
which when executed correctly, compare aset of
instructions and simply work out that IF something is present, THEN
cdo something, ELSE do something different. Create a new script
called greeting2. sh and enter the text in the screenshot below
intoit:
Fle Edit View Search Tools Documents Help
Ho&in~|/yeeajiag
Bu oretngssh
sinjbash
HT *stirstnane” 1
Greeting? sh is a copy of greetingsh but with a
slight difference, Here we've added a loop starting
at the iF statement. This means, IF the variable entered is equal to
David the next line, THEN, isthe reaction to what happens, in this
case twill output tothe screen ‘Awesome name; Followed by the
variable (which s David).
Fle ES¢ View Search Terminal Help
FETIREDD The next ine, £156, is what happensif the variable
doesn’t equal ‘Davi’ In this case it simply outputs
tothe screen the now familar ‘Hello... The lasting, the Fl
statement, isthe command that will end the loop. IFyou have an IF
‘command without a Fi command, then you get an error
Fle St View Search Terminal_ Help
You can obviously play around with the script a
little, changing the name variable that triggers 8
response; or maybe even issuing a response where the frst name
and surname variables match a specific variable
Fle Et View Search Tools Documents Help
aoa xoeo|ag
Du oeetrgnzeh x
#1 ein/bash
clear
SOT -stirstnane a= 1 66 “ssurnane” = 1
then eche ‘firstname gsurnane
flo sfirstnane Srurnane, how are you on this fineMORE LOOPING
y
(Creating Bash Scripts ~ Part 3 ey
‘You can loop over data using the FOR, WHILE and UNTIL statements. These can be handy if you're batch naming, copying or
running a script where a counter is needed.
BTEERED Create anew script called count. sh Enter the
text in the screenshot below, save itand make it
‘executable, This creates the variable ‘count’ which atthe beginning
‘of the script equals zero, Then start the WHILE loop, which WHILE
‘count isles than (the T part) 100 wil print the current value oF
‘count inthe echo command,
jutite { scount -1t 100 140
Jechescount
Tet’ countecounter
Berea The UNTIL Loop works much the same wayas the
WHILE Loop only, more often than not, in reverse.
So our counting to ahundred, using UNTIL, would be: until
[ Scount -gt 100 1; do. The difference being, UNTIL counts,
‘greater than (the gt part} one hundred, keep on looping,
counts
fle Ede View Search Toole Documents Help
AOa n~ xoH8 ag
im scounsh x
et/bin/bash
Junest_{ scount -et 100 15 do
lecho.scoont|
Ret’ countacounter
Sone
Executing the count sh script will result in the
‘numbers 0 to 9 listing down the Terminal screen;
‘when it reaches 100 the script wll end. Modifying the script with the
FOR statement, makes it workin much the same way. To use tin our
script, enter the text From the screenshot into the count sh script.
Fe Edt View Search Toole Documents Help
Doaln+ xoo ag
Be coutsh x
bin/bash
for count sm £0..1009; do
echo count
et’ countecounter
one
for count in {0..100}; do
lecho $count
‘Let count=count+1
a
You're not limited to numbers zero to one hundred,
‘You can, within the loop, have whatever set of
‘commands you lke and execute them as many times as you want,
the loop to run For. Renaming a milion files, creating Fifty Folders
etc. For example, this script will create ten Folders named Foldert
through to Foldert0 using the FOR loop.
count shi
Fle Ede View Search Too! Documents Help
aoa n~ yoo ag
im scounsh x
ot /oin/bas
Hor count in (0, .10);d0
Jmtair Folsers‘ount
Ret countecountsi
Sone
BTID Using the FoR statement once more, we can
‘execute the counting sequence by manipulating the
{0.100} part. This section of the code actually means (START. END.
INCREMENT, iF there's no increment then it's just single digit upto
the END. For example, we could get the loops to count up to 1000in
twoswith: for count in {0..1000..2}; do.
Fle ESt ew Search Too Donen Help
Boajn~|xoejaa
percouesh x
1 /bin/bash
for count in (0..1000..2);40
he. scount
ist covntecouteey Using the Terminal. )
Creating Bash Scripts
—Part 4
CHOICES AND LOOPS
Let's bring in another command, CHOICE, along with some nested IF and ELSE statements. Start by creating a new script called
mmychoice sh,
The mychoice sh script
Isbeginning tolooka
lot more complex. What
‘we have here isa list
‘of Four choices, with
three possible options
‘The options: Mint; 5,
and Awesome will be
displayed ifthe user
presses the correct
‘option ke. IFnot, then
the menu will reappear,
the Fourth choice,
IFyou follow the script through you soon get the
hang of what's going on, based on what we've
already covered, WHILE, IF, and ELSE, with the Fl closing loop
statement willrun through the options and bring you back tothe
start f you pickthe wrong option
BERTIER) You can, of course, increase the number of choices
butyou need to make sure that you match the
umber of choices ta the number of IF statements. The script can
‘Quickly become a very busy screen to look at. Thislengthy script
is another way of displaying @ menu, this time with a fancy colour
scheme too
PSTEP DD You can use the
$name” 2> /dev/nutl )
Jf CL on “soutput® 115 then
che “SoutputWhen executedthe script wats for input rom the
SHAPE ‘user, in this case the file extension, such as jpg,
tmpdandsoon lst very ren though Le ae toile
fnendler Addan ecto with:echo =n “Please enter the
extension of the file you’re looking for: “, just
before the read command
Here's an interesting, Fun kind of script using the
app espeak, Install espeak with sudo apt-get
install espeak, then enter the text below into anew script called
speak. sh. Asyou can seeit's a rehash ofthe First greeting script
‘we ran. Only this time, it uses the variables inthe espeak output.
We briefly looked at putting some coloursin the
‘output For our scripts. Whilst i’ too long to dia a
little deeper into the colour options, here's script that outputs
‘what's avallable. Create anew script called colours. sh and enter
the text (see below) into it,
Creating Bash Scripts — Part 5
8
‘The output from colours sh can, of course, be
SEED inc tocetner bringing diferent effects
depending on what you want to the output to say, For example,
white text in a red background fashing (or blinking). Sadly the
blinking effect doesn't work on all Terminals, so you may need to,
change toa different Terminal.
Whilst we're on making Fancy scripts, how about
using Zenity to output a graphical interface?
Enter what you see below into a new script, menu. sh, Make it
executable and then runit. You should have a couple of dialogue
boxes appear, Followed by a Final message.
ile gaming ha Bash siti something
Guero that's often touched upon, itis entirely possible,
abet litle bac. Moverentbasedgomes are duct, and
sometimes buggy, however a good tev adventure or ghng
Fantasy type gumeis a perfect cote for gaming in he Terminal
diet ago andletus know how you get onPY using the Terminal )
Pi x Linux =
The Perfect Combination
The Raspberry Pi is a remarkable piece of hardware, and to help drive its potential
it needs a remarkable operating system. Thankfully, Linux is the default and
recommended OS of choice for the Pi, and together they make a winning team.
When the Raspberry Pi was in its developmental stages its designers needed to ensure that they were creating a piece of
hardware that could offer much more than simply being a cheap, but small, computer.
“The Pi needed to be flexible with what it could do, it needed to have
room to grow into more ambitious project concepts and ideas, and
itneeded to do so in a easy to use fashion as possible. The goal was
tocreate a universal learning platform, that students of any age
‘could expand on and tinker with, while learning new concepts such
‘as programming, electronics, and computing, Naturally, once
the hardware was developed, the only real choice of
‘operating system was oF course, Linux.
“The versatility of Linuxis legendary. This incredible
core OSis so malleable that can be steered
toward near any aspect of computing, from
‘supercomputing ta robotics, the space industry to
more terrestrial engineering; education and
science, manufacturing and the Internet
‘Think oF an industry, and you wil ikely
Find a Linux installation somewhere in the
background keeping ital together
Raspbian isthe recommended operating system for the Raspberry
Pi, a customised Debian-based distribution that comes packed with
a collection of useful tools that cater for coding, electronics, and
‘general desktop computing duties. Alongside the apps are pre
loaded modules to help get the most from each ofthe programming
languagesyou decide to learn and use, as well as software to
hardware modules that wil enable you to power and use the
hardware specific items unique to the Pi. For example, there are
Python modules that interact with the Raspberry P's 40-pin GPIO,
allowing you to create content for any ofthe Hardware Attached on
Top devices,
This combination s what makes the Raspberry Pi an excellent base
‘of operations to learn not only coding on, but also Linux in general
Raspbian, being Debian-based, willbe able to run any ofthe
Terminal commands listed inthis book, a5 Linux Mint and even
buntu are also Debian-based, And since the Raspberry is so
rall, and costs very litle setup, you're able to have both your
regular, Windows or macOS computers, and have a Raspberry
Piasa headless (a powered device that doesn't need a keyboard,
‘mouse or monitor attached, a you connect to it remotely)
‘computer From which you can connect to and learn how to use
Linux and howto code,Pix Linux=The Perfect Combination @/¥
WHICH PI?
‘There are several Raspberry Pi models available, with each available. Overall it's probably best to start experimenting
‘offering something slightly different from the others. The ‘with the Pi using the Pi 4 Model B, then moving on to one of
most recent Pi released is the Raspberry Pi 4 Model B, and tthe other models as you develop your skills and focus ona
‘hile this model is slightly more expensive than some of the _particular project, such as the need to use one of the Pi Zero
the most powerful and feature-rich Pi _-_-models, witha smaller footprint and WiFi enabled connectivity.
E
Sea
enaae
great project Pi
BEYOND THE RASPBERRY PI OS PI, LINUX AND CODING
‘The Flexibility of the Raspberry Pi's ARM processor means ‘As previously mentioned, the Raspberry Piis an excellent code
that’s capable of running other operating systems beyond —_base, and with Linuxas the backbone you're able to start learning,
it's default Raspberry Pi OS. Still keeping with Linux, you hhow to code in a multitude of different programming languages.
‘an instead install Ubuntu MATE, Pidora a Fedore-based
distribution) Lakka,PiPlay (a retro emulation distribution) and
‘Arch Linux ARM, There are also systems based loosely on the :
encompass much ofthe P's Functionally. aside from creating
Linus Kernel such as Android Minbian and Chromium os. Shmase much ofthe funtonally Aside rom eatin
“There's Windows 10 oT Core, FreeBSD, RISCOS>I,Plan9 and, _GPIO pinson the Pi andin sobe abe to control LEDs, and even
remarkably, AROS an Amiga OS clone- Needless to say that | more complex HATS.
fone you've Finished experimenting withone version oFLinix, > apn ry for the ost populr choles for beginner on
justas you would with a desktop version of Linux, youcan hop pathon&by far the most populs chocefor beginners and
sacri ailace re rean eee how matone works, get he most from your Python experience, Tere are countless
x preloaded modules, aswell asthe most recent stable release of
the language.
(C#+is one of the most powerful programming languages
to learn. t's used for games, apps, and even entire operating
systems. The Raspberry
Picomes with a great Cr+
editor, that’s easy to use
‘and can help you develop
‘amazing content. Whichever
way you decide to take your
coding and Linux adventure,
the Raspberry Piis an
excellent platform from
which to begin on.
Bash scripting works perfectly, since Raspbian is Linux, and
Debian-based, and you can easily expand your scripts toLY) using the Terminal
Command Line
Quick Reference
When you start using Linux full time, you will quickly realise that the graphical
interfaces of Ubuntu, Mint, etc. are great for many tasks but not great for all tasks.
Understanding how to use the command line not only builds your understanding of
Linux but also improves your knowledge of coding and programming in general. Our
command line quick reference guide is designed to help you master Linux quicker.
TOP 10 COMMANDS
‘These may not be the most common commands used by everyone but they will certainly Feature Frequently for many users of
Linux and the command line.
‘The cd commands one of the commands you
will use the most atthe command line in Linux. It
allows you to change your working directory. You
Use it to move around within the hierarchy of your
filesystem. You can also use chai.
cd
The my command movesa file toa different
location or renames afile. For examplemy file
‘Sub renames the original file to sub. mv sub
~=/Desktop moves the file'sub’ to your desktop
directory but does not rename it. You must specify
anew Filename to rename a file.
mv
‘The Ls command shows you the filesin your
current directory. Used with certain options it ets
‘you see file sizes, when files where created and file
permissions. For example, 1S. ~ shows you the files
that are in your home directory.
ls
“The ep commandis used to make copies of files
and directories. For example, cp file sub makes
an exact copy of the file whose name you entered
and names the copy sub but the first ile wil till
exist with is original name,
cp
“The pd command prints the full pathname oF
the current working directory (pwd stands For
‘print working directory’). Note that the GNOME
terminal also displays this information in the ttle
bar ofits window.
‘The Clear command clears your screen if this,
is possible t looks in the environment For the
terminal type and then inthe terminfo database
to figure out howto clear the screen. Thisis
equivalent to typing Control when using the
bash shell
clear
The chown command changes the user and/
‘or group ownership of each given file. f only an
‘owner (a user name or numeric user 10) isgiven,
that user is made the owner of each given file, and
the files’ roup is not changed.
chown
The chmod command changes the permissions on
the files listed. Permissions are based on a fairly
simple model. You can set permissions For user,
‘group and world and you can set whether each can
Fead, write and or execute the file
cmod
The rm command removes (deletes) ile or
directories. The removal process unlink afilename
inaflesystem From data on the storage device
and marks that space as usable by Future writes. In
other words, removing files increases the amount
of available space on your disk
rm
Short For ‘make directory’, mkdir is used to
create directories on a Filesystem, iFthe specified
directory does not already exist. For example,
mkdir work creates a work directory. More than
tone directory may be specified when calling mir
mkdir© Command Line Quick Reference @¥
USEFUL HELP/INFO COMMANDS
‘The following commands are useful for when
‘you are trying to learn more about the system or
program you are working with in Linux. You might
not need them every day, but when you do, they
willbe invaluable,
“The free command displays the total amount ‘The sed.command opens a stream editor.
of free and used physical and swap memory in A stream editoris used to perform text
Free” thesystem.Forexample, free -ngivesthe S€d_ transformations on an input stream: File or input
information using megabytes. froma pipeline
“The dF command displays filesystem disk space
‘usage forall partitions, The command df-h
is probably the most useful (the -h means
human-readable)
The adduser command adds anew userto the
adduser _ system. Similarly, the addgroup command adds a
new group to the system,
df
“The top program provides a dynamic real-time The deluser command removes a user from
view ofa running system, can display the system. To remove the user's files and
COP system summary information, as well as. lst Geluser | home directory, you need to add the -renove
OF processes hore option
‘The uncme command withthe -o option prints The de. group command removes a group from
unmame-a_ allsystem information, including machinename, __jelgroup _ the system, You cannot remove a group thatis the
kernel name, version and afew other details primary group of any users.
‘Theps command allows youtto view athe
processes running on the machine. Every
PS operating system's version of ps sslightly
different but all do the same thing,
‘Theman man command brings up the manual
man man | entey forthe man command, whichis great place
to start when using it
‘The grep command allows you to search nside @ Theman intro commandis especially useful
numberof files Fora particularsearch pattern and Ie¢splaysthe Introduction to User Commands,
STED then print matching lines. An example wouldbe: [19100 which isa well written, fairly brief introduction to
grep blah file the Linux command line,ey Using the Terminal
A-Z of Linux Commands
odduser
arch
nk
B
bc
C
cat
chdir
charp
chroot
ccksum
np
©
crontab
csplit
cut
D
date
dc
Add a new user
Print machine architecture
Find and replace text
within file(s)
An arbitrary precision
caleulatorlanguage
Concatenate files and print
on the standard output
Change working directory
Change the group
ownership of files
Change root directory
Print CRC checksum and
byte counts
Compare tw files
Compare two sorted files
line byline
Copyone or mare Files to
another location
Schedule a command to
runatalatertime
Splitafile into context
determined pieces
Divide a file into
several parts
Display or change the
date & time
Desk calculator
dd.
diff
dirname
du
E
echo
ed
egrep
env
‘expand
expr
factor
fdisk
farep
find
Ft
fold
format
fsck
Data Dump, convert and
copy a file
Display the differences
between two files
‘Convert a full path name
tojusta path
Estimate file space usage
Display message on screen
Aline oriented text editor
(eatin)
Search file(s) For lines
that match an
extended expression
Display, set or remove
environment variables
‘Convert tabs to spaces
Evaluate expressions
Print prime Factors
Partition table
manipulator for Linux
Search file(s) For lines that
match a fixed string
‘Search For files that meet
‘desired criteria
Reformat paragraph text
‘Wrap text to fita
specified width
Format disks or tapes
Filesystem consistency
checkand repair
G
gawk
rep
groups
wip
head
hostname
id
info
install
J
join
K
kill
Find and Replace text
within ile)
Search ile() For lines that
match a given pattern
Print group names a user
Compress or decompress
pamed file(s)
Output the first part
of Files)
Print or set system name
Print user and group ids
Help info
Copy files and
set attributes
Join tines ona
common Feld
Stop a process
Fromm running
Display output one screen.
atatime
‘Make inks between files
Find files(AZ of Linux Commands
Logname __Printcurrentloginname rep. Copy iles between U
pe Line printer two machines
control program rm Remove files None ears asic]
lpr Off line print rmdir Remove folder(s) funexpand) Comert spaces toate
Aprm Remove jobs from the rpm Remote Package Manager UNA Unicity Fes
rine queve units Convert uns fom one
= rsync Remote file copy mab wenater
(synchronise file trees)
M tinshar ” Unpadkshallarchive sits
Me, see lp manual S Useradd Create new user acount
mkdir Create new Folder(s) screen Terminal window manager oe soci usececcoun
nidfa’ "Wale FROstoaradpiaed) “Saif "Mergetvaferienaty ETS Laken
iknod Wake biockor character” “select” Accept keyboard input
special is, seq Fit ramericseauenes J
wore Dispiay output one screen a
ata time ihnedoa Shutdown or restart linux vain Verbosely list directory
= eee sleep Belay Fora spectiedtime contents 5-8)
sort Sortevt fies
N split Spit fieinto WwW
Fnedsize pieces
watch Execute ordspaya
mice Set the priority of a su substitute user identit sragram periodical
Setthe py Substitute user ientty program periodically
= eee sum Printa checksum forafie “we Pini wed an
write les Symtink Make anew name for
tpn comand imine sit EEE eperalinown
tohangupe syne Synchronise dation disk
with memory which ‘ocak a program ie in
the user’ path
P T who rine a vsemames
passed Mody aus pasword caren gged
paste weelesaffes #9 Sencaeste ands aT parte caren
ies revs Pinte
patch GheKtienane lly agin gaat
= onetct fies ofties
fering ae Taper Xx
piincap 7 ink pais ie args eet pssng
= fede onto
printenv Print environment variables multiple files coostiched argon
printf Format and print data test Evaluate a
condosteresson
a ar Pina sting
nesoureeuse chelinerpted
quota ilaydskuse “Each” 77 hanged
soe Hinks ‘top List processes running on
aiotacheck San ate simian these
aetusge
‘traceroute Trace Route to Host
quotactl Set disk quotas
R aia Foie
ram Ram disk devicePromiener
Paes
coer
ferent!
CeeNow you've got the basics
down, you can improve and
elena le eee emia) Cee
elt] at= ce -40 (|=
Linux
Tricks and Tips
Coming soon!Make Your Online
Own PC § Security
For Beginners For Beginners
Outdoor i
ese iae Masai Lightroom
Lol {24 alae) Lae) ===) For Beginners
Canon
For Beginners
thay 4
Galaxy
be =)
e
Linux
For Beginners
efYat Black Dog Media
From Beginner
to Expert
Master Your Tec
To continue learning more about your tech visit us at:
www.bdmpublications.com
EXCLUSIVE Offers on [aueiatg
our Tech Guidebooks
for BeginnetS
: Coding pilthon
@ Print & digital editions
@ Featuring the very latest updates
© Step-by-step tutorials and guides
@ Created by BDM experts
Check out our latest titles today!
SPECIAL DEALS
and Bonus Content
Sign up to our monthly newsletter
and get the latest updates, offers
and news from BDM. We are here
to help you Master Your Tech!
bdmpublications.com/ultimate-photoshop
Ease Reece ute eR Meir
images for free! Simply sign up and get creative.