ANSWERS TO EXERCISE 1
1st Log in to console number two with the user night
CTRL+ALT+F2
2nd Become root
switch user
3rd Create the following users
user3
password: user3
user4
password: user4
user5
password: user5
user6
password: user6
# useradd -m -s /bin/bash user3
Change password for user3
# useradd -m -s /bin/bash user4
# passwd user4
# useradd -m -s /bin/bash user5
Change password for user5
# useradd -m -s /bin/bash user6
# passwd user6
4th Log in to console F3 with user3 and execute the command top.
CTRL+ALT+F3
top
5th Log in to the F4 console with user4 and run the command man df.
CTRL+ALT+F4
# man df
6th Log into console F5 with user5 and execute the command info.
CTRL+ALT+F5
# info
7th Log in to the console with user6.
CTRL+ALT+F6
8th Return to console 2.
CTRL+ALT+F2
a) Display the logged-in users in all possible ways
# w
who
# users
b) Show what each user is executing.
# w
b) Show the user currently logged in on the F2 console
whoami
who am i
# logname
9th Log out the sessions of the users: user3, user4, user5 and
user6.
CTRL+ALT+F3
exit
CTRL+ALT+F4
exit
CTRL+ALT+F5
exit
CTRL+ALT+F6
exit
10º Return to console 2.
CTRL+ALT+F3
11th Remove from the system the users: user3, user4, user5, and user6.
# userdel -r user3
userdel -r user4
# userdel -r user5
# userdel -r user6
12º Clean the screen.
Display the date and time.
date
14º Set the date and time.
Use: date MonthDayHourMinuteYear
15º Create an alias called raiz that clears the screen and displays the root of the disk with details.
# alias root="clear ; ls -l /"
16º Execute the root alias.
root
17th Show all system aliases.
alias
18º Delete the root alias (make sure the alias is deleted).
unalias root
19º Display the kernel version.
uname -a
20º Display the properties of PCI devices in a simple way.
# lspci
21º Display the USB ports.
Display the amount of RAM in megabytes.
free -m
23º Display the modules loaded in memory.
# lsmod
24º Display the characteristics of the processor.
# lscpu
you
# cat /proc/cpuinfo
25º Show the commands that have been executed so far.
history
26º Repeat the command that created the root alias.
# !command number
27º Delete the command history.
# history -c
What command restarts the server in 15 minutes?
shutdown -r +15
29th What commands are capable of shutting down the server immediately?
halt
power off
shutdown -h 0
shutdown -h now
ANSWERS TO EXERCISE 2
1st Log in as the user night
2nd Access the root of the disk
# cd /
3rd List the root with details
list directory contents in long format
4th Access the /tmp directory
# cd /tmp
5th Show the directory you are in at the moment.
# pwd
6th Become root
# su
or
switch user
7th Copy the directory /root to /tmp
# cp -Rvf /root /tmp
you
Copy the /root directory recursively and verbosely to the current directory.
8th Copy the directory /etc/init.d to /tmp
# cp -Rvf /etc/init.d /tmp
you
# cp -Rvf /etc/init.d .
9th Copy the directory /etc/init.d to /tmp renaming it to services
# cp -Rvf /etc/init.d /tmp/services
you
# cp -Rvf /etc/init.d ./services
10º Change the directory name 'servicos' to 'services'
# mv /tmp/servicos /tmp/services
you
# mv services services
11th Change the name of the directory /tmp/root to raquel
/tmp/root /tmp/raquel
you
move root raquel
12º Delete the raquel directory
# rm -Rvf /tmp/raquel
or
# rm -Rvf raquel
13th Delete the services directory
Remove recursively and forcefully the /tmp/services directory
or
# rm -Rvf services
14º Create the following structure inside /tmp
There are several ways to answer this question.
Here are two. One is very didactic. The other is very quick.
Note: Remember that we are in the /tmp directory (as done in question 4)
Way 1:
mkdir letras
mkdir letters/a
# create directory letras/a/b
create directory letras/a/b/c
create directory letras/a/b/c/d
# create directory letras/a/b/c/e
# mkdir letras/a/b/c/e/f
# mkdir numbers
# mkdir numbers/1
mkdir numbers/1/2
mkdir numbers/1/2/3
mkdir numbers/1/2/3/4
# create directory numeros/1/2/3/4/5
mkdir numbers/1/2/3/4/5/6
create directory programs
mkdir programs/firefox
mkdir programas/openoffice
mkdir programs/scribus
Way 2:
# create -p letters/a/b/c/d/e/f
# create -p numbers/1/2/3/4/5/6
# create directories
# cd programs
mkdir firefox openoffice scribus
# cd ..(to go back inside /tmp which is our location made in the question
4)
15º Access directory 6
# cd numbers/1/2/3/4/5/6
you
# cd /tmp/numbers/1/2/3/4/5/6
16º Access directory 5
# cd ..
you
# cd /tmp/numbers/1/2/3/4/5
17º Copy letters inside 6
# cp -Rvf /tmp/letras /tmp/numeros/1/2/3/4/5/6
18º Copy numbers into f
cp -Rvf /tmp/numeros /tmp/letras/a/b/c/d/e/f
19º Create the directory Document and Settings
mkdir "Document and Settings"
you
mkdir Document and Settings
20º Change his name to Documents and Settings
mv "Documents and Settings" "Documents and Configurations"
or
mv Documents and Settings Documents and Configurations
21º Delete the Documents and Settings directory
# rm -Rvf "Documents and Settings"
you
Remove -Rvf Documents and Settings
22º What is the size in Megabytes of the directory /usr?
du -sh /usr
23º Access the home directory
# cd
you
# cd ~
you
cd #
1 - Create the following tree at the Root of the Disk:
# cd /
mkdir exercise
# cd exercise
# create directory files
# create directory arquivos/1letra
mkdir files/2letter
mkdir files/3letter
mkdir configurations
mkdir configurations/conf
mkdir configurations/dll
# mkdir configurations/lib
# create directory letras
mkdir letters/a
Create directory letras/b
mkdir letras/c
# create directory letras/d
mkdir letras/e
# mkdir -p numbers/1/2/3/4/5
mkdir programs/
mkdir programs/gimp
# create directory programas/scribus
# mkdir programas/tuxpaint
Go to the directory /exercise
# cd /exercise
3 - Create a blank file named aula.txt.
# touch aula.txt
4 - Create a copy of this file called prova.txt
# cp aula.txt prova.txt
5 - Rename prova.txt to avaliacao.doc
move prova.txt to avaliacao.doc
6 - Copy all files with 3 letters in the name from the directory /etc to 3letras
# cp /etc/??? /exercise/files/3letters
you
# cp /etc/??? files/3letters
7 - Copy all files with the conf extension from the /etc directory to the directory
conf
# cp /etc/*.conf /exercise/configurations/conf
you
# cp /etc/*.conf configurations/conf
8 - Copy the entire directory /etc to configurations
# cp -Rvf /etc /exercicio/configuracoes
or
cp -Rvf /etc configurations
9 - Change the name of the conf directory to conf2
# mv /exercise/configurations/conf
/exercise/configurations/conf2
or
# move configurations/conf configurations/conf2
10 - Copy the entire directory /exercicio to /tmp
Copy the 'exercicicio' directory to the '/tmp' directory recursively and show verbose output.
11 - Change the directory name from exercicio to tarefas
# move /exercise /tasks
12 - Copy the services file located in /etc to the working directory (the directory
what you are at the moment)
# cp /etc/services .
13 - Rename services to class.txt
# mv services aula.txt
14 - Visualize the content of class.txt
cat classroom.txt
or
No text provided for translation.
you
less classroom.txt
15 - Record the content of aula.txt in resultado.txt
# cat aula.txt > resultado.txt
16 - Create a file data.txt with the current date and time in the following format: Today is DATE-
CURRENT TIME
Today is `date`
you
Today is $(date)
17 - Delete the file avaliacao.doc
remove avaliacao.doc
18 - How many lines does the file aula.txt have?
19 - What line number in the file aula.txt contains the word FTP?
# grep -n "FTP" aula.txt
20 - Display the ordered services file and pause
# sort aula.txt | sort | more
21 - Display the first 10 lines of this file
No text provided for translation.
22 - Display the last 20 lines of this file
# tail -n 20 aula.txt
23 - In the usuarios.txt file, only save the names of the users ordered from the largest
for the smallest, numbered in ascending order.
# cut -f1 -d: /etc/passwd | sort -r | nl > users.txt
24 - Display the system variables with a pause.
# env | more
25 - Create a variable called NAME that contains your first name.
export NAME="Dailson"
26 - Display the message The user CURRENT-USER is in the DIRECTORY
CURRENT
The user $LOGNAME is in the directory $HOME
27 - Put the following data inside the file name.txt:
Your Name
Your Date
Your email
echo "Name: Dailson" >> name.txt
Age: 21
Email:
[email protected]28 - Visualize the file nome.txt
cat nome.txt
1 - When the root user logs in, a little cow (cowsay program) should appear giving the
welcome along with the time and date.
Response:
First, let's install the friendly little cow.
# apt-get install cowsay
you
# yum install cowsay
Take a test:
I know how to speak!
If it doesn't work, try this way:
I know how to speak!
To make root receive greetings every time they log in, place the message in /root.bashrc
# vi /root/.bashrc
At the end of the file, insert:
The variable HOURS will store the hour and the variable Minute will store the current minute.
HOURS=`date +%H`
minutes
DAY=`date +%d`
MONTH=`date +%B`
YEAR=`date +%Y`
Hello $LOGNAME. $DAY, of $MONTH of $YEAR. It is
$HOURS hours and $MINUTES minutes
Save the file and test with the command:
# source /root/.bashrc
2 - To register the login
# vi /root/.bashrc
The user $LOGNAME logged in: `date` >> /etc/cartaodeponto.log
Save the file and test with the command:
# source /root/.bashrc
Then check with cat /etc/cartaodeponto.log if the date and time were generated.
To make the logout registration
# vi /root/bash_logout
Save the file and test with the command:
# source /root/.bashrc
The user $LOGNAME logged off: `date`
/etc/timecard.log
Save the file and test with the command:
# source /root/.bashrc
Then check with cat /etc/cartaodeponto.log if the date and time were generated.
3 - To log that the server has been started, we will edit the file /etc/rc.local or
/etc/bash.bashrc (No Debian) or /etc/bashrc (On Redhat, Fedora)
# vi /etc/bash.bashrc
Insert this line:
The Server was started at `date +%T` on `date +%D`
/etc/server.log
Save the file and test with the command:
# source /etc/bash.bashrc
Then check with cat /etc/server.log if the date and time were generated.
At the end of everything, restart the machine and do all the tests always checking with the commands.
# cat /etc/cartaodeponto.log
# cat /etc/server.log
1 - Create a file called aula1.txt with the following content:
classroom
paper
ball
Open the file in VI: vi aula1.txt
To type the content, use the i (Insert) key and then type
the text.
2 - Create a file named aula2.txt with the following content:
panel
square
some
Open the file in VI: vi aula2.txt
To type the content, use the i (Insert) key and then type
the text.
3 - Without leaving the current window, open the file aula1.txt
Escape key (Command mode) - :new aula1.txt
4 - Copy all the content from aula1.txt into aula2.txt
Ctrl + V (down arrow) then 'y' to copy
Ctrl 'ww', choose the location and 'p' to paste.
5 - Delete the 3rd line with vi commands
Type number 3 + 'dd' + Enter
Place the cursor on the third line and type dd
6 - replace the word "class" with "ead"
Replace 'aula' with 'ead'
7 - Copy all the content from aula2.txt to aula1.txt
Use the command 'v' + arrow key to select.
Press 'y' to copy.
CTRL + 'WW' to go to the other window.
Choose the location to paste and press 'p'.
8 - Save the two files
wall
9 - Close the vi
:x (twice to close both files)
1st List only the processes that are currently running in the current terminal
# ps
2nd List the processes that are running in all terminals
ps -a
3rd List all Linux processes
# ps–A
4th List all the processes in Linux, displaying the names of the users who started them.
processes
# ps–aux
5th List the processes in tree form
pstree
6th List all the system processes in tree form displaying the number of
process
# pstree–p
7th List all the system processes in tree form displaying the user's name
# pstree -u
8º What are the necessary steps to kill a process called openoffice that is
stuck in the console tty1. This process is not responding at all. How to terminate it?
?
Way 1:
Switch to another console
# ps -a (to get the process number of openoffice)
# kill–SIGKILL 1111 (assuming that 1111 is the number of
openoffice process
Way 2:
Switch to another console
killall –SIGKILL openoffice
9th What command displays details about the processes that are being executed in
real time on the server?
top
# htop
10th Differentiate kill from killall
Kill sends signals to the applications by the number of
process
Killall sends signals to applications by their name
11) Explain the signs and what number they correspond to.
SIGKILL - Signal that terminates the application of any
form. This signal cannot be ignored by the application.
SIGTERM - Requests the application to terminate. If possible,
the data is saved and no data is lost. This signal is
similar to closing a program normally.
SIGSTOP–Freezes (pauses) the execution of an application in the
memory.
SIGCONT - Resumes the execution of an application that was
frozen (paused) in memory
SIGHUP - Used to restart daemons (programs
residents in memory
12º - What is the difference between the nice and renice commands?
nice–Starts an application with the desired priority
renice - Changes the priority of a currently running application
13th How to run updatedb with priority -10?
# nice–n -10 updatedb
14º How to change the priority of updatedb (which is already running) to the priority
15 positive?
# ps–a (to get the process number of updatedb)
# renice -n +15 1111 (assuming that 1111 is the number of
updatedb process
15º What command produces this result?
Stopped program.sh
Stopped nano
[3]+ Stopped top
Stopped htop
Stopped vim
# jobs
17º According to the scenario of question E, if the fg command is executed, who will it be?
brought to the forefront?
top
18º If the fg command is executed again, who will be brought to the foreground?
nano
What key combination puts a program in the background?
CTRL+Z
20º What command puts a stopped process in the background?
(Cite 2)
# bg
# ps -a
kill–SIGCONT 1111 (assuming that 1111 is the number of
process of this process
21º–The backup application copia.sh has just been executed
./backup.sh
a) According to the table below, a command has been executed:
b) What command was this, and what happened?
# renice–n -10 1350
The priority of the backup.sh script has been changed to -10
22º Observe the result of the jobs command
Stopped program.sh
Stopped nano
[3]+ Stopped top
Stopped htop
Stopped vim
a) What command makes the frame below true?
Running program.sh
Stopped nano
[3]+ Stopped top
Stopped htop
Stopped vim
# bg 1
1 - Consider the following scenario of groups and users. Execute the commands
correspondents to make this scenario true on your server. Don't forget to
assign passwords to each of the users.
Tip 1: First create the groups
# groupadd lab1
create group lab2
# groupadd lab3
add group students
# groupadd todos
Tip 2: Create users within the groups. I will use the following
options:
-g = primary group where the user will stay
-G = secondary group (that is, the other groups in which it participates)
part
-m = creates the user's home directory
-s /bin/bash = specifies that the user will use the shell /bin/bash
# useradd -m -s /bin/bash -g lab1 -G todos juca
# useradd -m -s /bin/bash -g lab1 -G todos chaves
# useradd -m -s /bin/bash -g lab2 -G todos marta
# useradd -m -s /bin/bash -g lab2 -G todos vanessa
# useradd -m -s /bin/bash -g lab3 -G todos dani
useradd -m -s /bin/bash -g lab3 -G todos ceni
# useradd -m -s /bin/bash -g students student1
# useradd -m -s /bin/bash -g students student2
# useradd -m -s /bin/bash -g todos prof
# passwd juca
Password keys
# passwd marta
passwd vanessa
Change password for dani
Change password for ceni
# passwd student1
Change password for student 2
# passwd prof
2 - Display the file that contains the system users.
cat /etc/passwd
3 - Display the file that contains the system groups
cat /etc/group
4 - Display the file containing the encrypted passwords of the system users.
# cat /etc/shadow
5 - Display the file that contains the encrypted passwords of the system groups.
# cat /etc/gshadow
6 - Change the login name of user student1 to user1
# usermod -l user1 student1
7 - Change the group name from students to users
# groupmod students–n users
8–Assign a password for the user group
gpasswd users
9 - Include in the group users, the users juca and marta.
gpasswd -a juca users
gpasswd -a marta users
10 - Remove the users juca and marta from the users group.
gpasswd -d juca users
gpasswd -d marta users
11 - Delete the users group.
# groupdel users
You will probably see an error saying that there is a user inside the
group.
Note that users aluno2 and user1 are still in the group. See:
user1
# student id 2
Let's delete the users student2 and user1
# userdel -r aluno2
# userdel -r user1
Now you can delete the users group
groupdel users
12 - How many users are on the server?
# wc–l /etc/passwd
13 - Save the login of all server users in the file user_ordenado.txt ordered.
by name and numbered.
# cat /etc/passwd | cut -d: -f1 | sort | nl > user_sorted.txt
14 - Save in the file group_sorted.txt the list of all groups on the server
ordered by name and numbered.
# cat /etc/group | cut -d: -f1 | sort | nl > user_ordered.txt
15 - Place the encrypted password inside the file /etc/passwd
pwunconv
16 - Return the password for the file /etc/shadow
pwconv
17 - Create a user called denylogin who cannot log into the system.
# useradd–s /bin/false denylogin
18 - Turn off the groups lab1, lab2, lab3 and all.
Tip 1: There are two ways to approach this issue. One is to erase everything.
the users and then delete the groups. The other is to remove the users
from inside the group to later delete it. Let's opt for the first one.
alternative: Delete all users and then the groups:
# userdel -r juca
# userdel -r keys
# userdel -r marta
# userdel -r vanessa
# userdel -r dani
# userdel -r ceni
groupdel lab1
# groupdel lab2
# groupdel lab3
groupdel students
delete all groups
1–Build the following scenario of groups and users:
Tip 1: Create the groups first
create group lab1
# groupadd lab2
# groupadd lab3
# groupadd students
add group todos
Tip 2: Create users within the groups. I will use the following
options:
-g = primary group where the user will stay
-G = secondary group (that is, the other groups in which it participates)
part)
-m = creates the user's home directory
-s /bin/bash = specifies that the user will use the /bin/bash shell
# useradd -m -s /bin/bash -g lab1 -G todos juca
useradd -m -s /bin/bash -g lab1 -G todos chaves
# useradd -m -s /bin/bash -g lab2 -G todos marta
# useradd -m -s /bin/bash -g lab2 -G todos vanessa
# useradd -m -s /bin/bash -g lab3 -G todos dani
# useradd -m -s /bin/bash -g lab3 -G todos ceni
# useradd -m -s /bin/bash -g students student1
# useradd -m -s /bin/bash -g students student2
# useradd -m -s /bin/bash -g todos prof
# passwd juca
password keys
# passwd marta
# passwd vanessa
# passwd dani
Change password for ceni
# passwd student1
Change password for aluno2
Change the password for prof
2 - Create at the root: the directories: lab1, lab2, lab3, students and all.
# mkdir /lab1
# create directory /lab2
# mkdir /lab3
# create directory /students
# create directory /todos
3 - Ensure that the following configurations are made:
Directory Owner User Dono Group
/lab1 juca lab1
/lab2 Marta lab2
/lab3 dani lab3
/students student1 students
/todos prof all
Assigning the property to the owning user:
# chown juca /lab1
chown marta /lab2
chown dani /lab3
# chown aluno1 /students
# chown prof /todos
Assigning the group owner property:
Change group of lab1 to /lab1
# chgrp lab2 /lab2
# chgrp lab3 /lab3
chgrp students /students
chgrp todos /todos
Another way to perform this exercise is by assigning the property of
user and group at once:
chown juca:lab1 /lab1
# chown marta:lab2 /lab2
# chown dani:lab3 /lab3
change owner of /alunos to aluno1:alunos
change ownership to prof:todos /todos
4 - Make the directory /lab1 accessible only to users in the group lab1
with total power.
Change the permissions of /lab1 to 770
5 - Ensure that the /lab2 directory is accessible only by users in the group.
lab2 with total power.
# chmod 770 /lab2
6 - Make the directory /lab3 accessible only by users of the group lab3
with total power.
chmod 770 /lab3
7–Make the directory /alunos accessible only to users of the group
students.
# chmod 770 /students
8 - Make the directory /todos accessible only to users of the group todos
# chmod 770 /todos
9 - Make the user prof access the /todos directory in read-only mode.
However, the group must access freely.
chmod 570 /todos
7 - Test with the users juca, marta, dani, and prof logging into the consoles and entering
in the folders. In each folder, run the command mkdir test and see the result.
Log in and test each of the directories trying to create at least
a folder inside with the mkdir command.
Regarding the installation of packages on Linux, answer:
1st What is the difference between the following commands?
a) In relation to Debian
apt-get update
Just update the list of available packages in
repository.
apt-get upgrade
Update all packages that have a newer version.
repository.
apt-get dist-upgrade
Update all packages that have a newer version in
repository. It also removes obsolete packages (that do not
are more necessary to the system).
b) Regarding Redhat
yum check-update
Just inform that packages need to be updated.
yum update
Update all packages that have a newer version in
repository.
yum upgrade
Update all the packages that have a newer version on
repository. In addition, it removes obsolete packages (that do not
are more necessary to the system).
2nd What does the command do-release-upgrade do in Ubuntu?
This command is capable of updating Ubuntu to a new
version. Example. From version 11.10 to version 12.04.
3rd What command installs the hping application on Debian-based distributions?
apt-get install hping3
Note: to find out the name of the package, do the following:
apt-cache search hping
Which command reinstalls the hping application on Debian-based distributions?
apt-get install --reinstall hping3
5º Cite pelo menos 3 jogos de Xadrez em Debian (Em Inglês chess).
Note: Do the same in Redhat
apt-cache search chess
In Redhat
yum search chess
6th What is the difference between:
apt-get install gnome-desktop and apt-get install -d gnome-desktop
When the -d option is used, all packages related
the installations are downloaded to the machine, but none is
installed.
7th How to update htop on Debian?
apt-get install htop
How to keep CentOS fully updated?
yum update
9º What are repositories?
They are sites that contain the package of a certain
distribution
10th What is the configuration file for repositories in Debian?
/etc/apt/sources.list
11th What is/are the configuration file(s) for the repositories in Redhat?
It is not just a file. It is a directory that contains several
files. Each one points to a repository. The directory is
/etc/yum.repos.d
12th How to prevent Redhat from always reading the repositories with each yum command
typed?
In the file /etc/yum.conf uncomment the line
90m
This instructs yum to use the metadata for 90 minutes.
downloaded from the repositories.
13th Which directory do the files downloaded by apt-get and yum go to?
apt-get /var/cache/apt/archives
yum /var/cache/yum
For yum to cache, it is necessary to perform the installation.
of the yum-downloadonly package.
yum install yum-downloadonly
and force the download of the package with the following command:
yum install --downloadonly package
Example:
yum install --downloadonly htop
Another method.
Install the yum-utils package with the command:
yum install yum-utils.noarch
And then download packages with the following
command:
yumdownloader package
14º What type of package does YUM handle?
.rpm files
What type of package does apt-get handle?
.deb files
16º How to list the package groups in Redhat?
yum group list
17º How to install the Development Tools package group? (Mention both ways)
possible)
yum install "@Development Tools"
yum groupinstall 'Development Tools'
18º What other package manager is known in Debian?
aptitude
On Server X = synaptic
S.O. – Exercises 1
File and directory management tool exercises using
Linux.
Requirements: you can perform this exercise on a computer or virtual machine
running Linux Ubuntu or Debian (server or desktop version).
Doubts?
If you have questions about installing Linux, access the NEWS menu of this site and look for
by the Ubuntu Installation Guide.
If you have questions about Linux commands, access the NEWS menu of this site and
search for the Essential Linux Commands Guide.
1–Open or access the system terminal or, if you are accessing it via SSH, log in.
with your access credentials (username and password);
The default access settings were registered during the system installation.
In the default directory of your user (/home/userX), create the directory 'exercicio-so-1'
and access this directory;
Use the commands mkdir and cd.
3–Create a directory using your first name as the directory name;
4–Create a directory using the current date as the directory name;
5–Move the data directory to the directory with your first name;
Use the command mv.
6–Identify the current date and save this information in the data directory in a file
called "data-atual.txt";
Use the command date.
Use the greater than sign (>) to redirect the standard output (monitor) to a file,
how:$ date > yourname/current-data/current-data.txt
7–Rename the directory with your first name to your name-surname;
Use the command mv.
8–Within the directory name-surname, create 3 directories: documents, images and
music
Use the mkdir command, however, structure the command to create the 3 directories as well.
same time.
9–Remove the data directory;
Use the command rm dirourm -r.
10– Liste o conteúdo do diretório raíz do Linux (o “/“) em forma de lista vertical e,
after, save this information in a file called 'ls-root.txt';
Use the command ls -lh.
11–Copy the files /etc/passwd, /etc/group, /etc/protocols to the directory
documents;
Use the command cp.
12–Count the number of lines and words in the passwd file;
Use the command nlouwc.
13–Identify the type of the passwd file;
Use the command file.
14–Identify only the root user in the passwd file;
Use the command cat, along with the command grep.
Use a vertical bar, or pipe, (|) to allow the concatenation of commands, such as: $
cat /etc/passwd | grep root.
15-List the contents of the exercicio-so-1 directory in list form, including its
subdirectories and then save this information in a file called 'ls-exercicio-so-'
1.txt;
Use the command ls -lhR.
Linux Ubuntu 17 running on VirtualBox - Detail for the file /etc/passwd