103.1 Work on the command line

Beschreibung

103.1 Work on the command line - topico da certificação LPI I
Maicon Alencar
Karteikarten von Maicon Alencar, aktualisiert more than 1 year ago
Maicon Alencar
Erstellt von Maicon Alencar vor mehr als 5 Jahre
4
0

Zusammenfassung der Ressource

Frage Antworten
PID - Which means Proccess IDentification
What is the proccess with PID 1 Init
two processes of the same application receives PIDs ______________ different
How to know what shell am I using? #echo $SHELL
Internal command is a command embedded on ____________ shell
in order to execute external commands, what variable shell should search location info? PATH #echo $PATH
which command shows if a program is internal or external type #type tar #type cat
#echo $PATH /usr/local/sbin:/usr/local/bin:/usr:sbin/:/usr/bin:/bin
/desktop/script.sh Is it an absolute or relative path? relative
/home/desktop/scripts/script.sh Is it an absolute or relative path? absolute
/etc/init.d/script.sh Is it an absolute or relative path? absolute
How create a variable in shell? #name_variable=data
How export variables in shell? #export name_variable
How create and export variable, in order to other shells sessions can see this variable data? #export name_variable=data
Which command shows all variable values? #set #set | less
Which command shows just external variables values? #env #env | less
An user opened a new shell and executed an external program without export. He received an error, why? Because he executed the relative path and, in this case, external programs needs to be exported. Other way is execute the absolute path.
How shows the value of a variable in shell? #echo $variable
Which variable shows the values as the command #history? #echo $HISTFILE
Which variable shows the length of the return of command #history $HISTFILESIZE
$HISTSIZE is the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.
$HISTFILESIZE is the number of lines or commands that (a) are allowed in the history file at startup time of a session, and (b) are stored in the history file at the end of your bash session for use in future sessions. Notice the distinction between file: on disk - and list: in memory.
$HOME home address of logged user
$HOSTNAME machine name
$LOGNAME login name that are logged into this session # echo $LOGNAME root
$PATH variable that indicate location of binaries
$PWD current folder
$USER login name that are logged into this session # echo $USER root
$$ $! $? $$ PID of this shell session $! PID of last proccess executed $? exitcode of last proccess executed
a proccess was executed with success, what number its returns? 0
#echo ~ home of user logged # echo ~ /root
#echo ~nameuser home of user logged # echo ~sftp_usr/ /home/sftp_usr/
$PS1 shell appearance
$OLDPWD last folder visited
How execute three commands in the same line separating with a char? # clear date ls #clear ; date ; ls
&& If the first command was executed with success, then, the second command will be executed #clear && date
|| Only executes the second command if the first command gets ERROR
#!! repeats the last command was executed
#!19 execute the number of the command likes the history 18 shodan scan 189.40.216.101 19 shodan scan submit 189.40.216.101 20 ping 8.8.8.8
#!uname searchs for "uname" command in the history ($HISTFILE)
how to clear HISTFILE? #history -c
Can I read the HISTFILE from another user being a normal user? No. Just administrators users can user other user's history
How to search a command in history? CTRL + R OR | grep
how command provides a detailed view of other command which includes NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES, VERSIONS, EXAMPLES, AUTHORS and SEE ALSO #man means "manual"
#man -k "string" gives all commands that have the "string" as reference in manual #man -k "update system" fwupdate - update system firmware
#whatis #whatis ls ls (1) - list directory contents #whatis cat cat (1) - concatenate files and print on the standard output #whatis tar tar(1) an archiving utility
#apropos =man -k gives all commands that have the "string" as reference in manual #man -k "update system" fwupdate - update system firmware
Which command returns system information? #uname
Which command returns exactly the following info: linux version, compilation date and kernel version #uname -a
How to create a nickname to a command? like the nickname of "cat" is "tom", then, when I use "tom" in shell, the system translate to "cat" #alias tom=cat
#echo * show all files from local directory
#echo "*" the shell will just print *
#echo '*' the shell will just print *
What is the difference between #echo "*" #echo '*' "" - protect all these $ ` / not ' ' - protect ALL
#echo "Curso Linux" #echo Curso Linux #echo Curso \ \ \ \ \ \ \ Linux #echo "Curso Linux" Curso Linux Curso Linux Curso Linux Curso Linux
Which command we can use to get a command path? #which cat /usr/bin/cat #which tar /usr/bin/tar #which shodan /usr/local/bin/shodan
How we get the release of kernel? #uname -r OR #uname -a
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

QUESTIONÁRIO DE INFORMÁTICA: SISTEMAS OPERACIONAIS
anapaulabrasilam
LPI Prova 102 - Questões Tópico 105
Diego Souza
EXERCÍCIOS DE LINUX
prof.santoss
Comandos UBUNTU / LUBUNTU / LINUX
Adenilson Paiva
Flashcards noções de informática para concurso
OSVALDO TUON
Formatação pelo Método Zero Fill (Encher de Zeros) no UBUNTU
Adenilson Paiva
Simuladão LPI 102 part. 1
Jhonas Miranda
Simuladão LPI 102 part. 3
Jhonas Miranda
Simuladão LPI 102 part. 4
Jhonas Miranda
Linux, Mac, Android e Ios
Renato Costa