Fichas
103.1 Work on the command line
Fichas del conjunto (57)
- 1PID - Which meansProccess IDentification
- 2What is the proccess with PID 1Init
- 3two processes of the same application receives PIDs ______________different
- 4How to know what shell am I using?#echo $SHELL
- 5Internal command is a command embedded on ____________shell
- 6in order to execute external commands, what variable shell should search location info?PATH
#echo $PATH - 7which command shows if a program is internal or externaltype
#type tar
#type cat - 8#echo $PATH/usr/local/sbin:/usr/local/bin:/usr:sbin/:/usr/bin:/bin
- 9/desktop/script.sh Is it an absolute or relative path?relative
- 10/home/desktop/scripts/script.sh Is it an absolute or relative path?absolute
- 11/etc/init.d/script.sh Is it an absolute or relative path?absolute
- 12How create a variable in shell?#name_variable=data
- 13How export variables in shell?#export name_variable
- 14How create and export variable, in order to other shells sessions can see this variable data?#export name_variable=data
- 15Which command shows all variable values?#set
#set | less - 16Which command shows just external variables values?#env
#env | less - 17An 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. - 18How shows the value of a variable in shell?#echo $variable
- 19Which variable shows the values as the command #history?#echo $HISTFILE
- 20Which variable shows the length of the return of command #history$HISTFILESIZE
- 21$HISTSIZEis the number of lines or commands that are stored in memory in a history list while your bash session is ongoing.
- 22$HISTFILESIZEis 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. - 23$HOMEhome address of logged user
- 24$HOSTNAMEmachine name
- 25$LOGNAMElogin name that are logged into this session
# echo $LOGNAME
root - 26$PATHvariable that indicate location of binaries
- 27$PWDcurrent folder
- 28$USERlogin name that are logged into this session
# echo $USER
root - 29$$ $! $?$$ PID of this shell session
$! PID of last proccess executed
$? exitcode of last proccess executed - 30a proccess was executed with success, what number its returns?0
- 31#echo ~home of user logged
# echo ~
/root - 32#echo ~nameuserhome of user logged
# echo ~sftp_usr/
/home/sftp_usr/ - 33$PS1shell appearance
- 34$OLDPWDlast folder visited
- 35How execute three commands in the same line separating with a char? # clear date ls#clear ; date ; ls
- 36&&If the first command was executed with success, then, the second command will be executed
#clear && date - 37||Only executes the second command if the first command gets ERROR
- 38#!!repeats the last command was executed
- 39#!19execute 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 - 40#!unamesearchs for "uname" command in the history ($HISTFILE)
- 41how to clear HISTFILE?#history -c
- 42Can I read the HISTFILE from another user being a normal user?No. Just administrators users can user other user's history
- 43How to search a command in history?CTRL + R
OR
| grep - 44how 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" - 45#man -k "string"gives all commands that have the "string" as reference in manual
#man -k "update system"
fwupdate - update system firmware - 46#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 - 47#apropos=man -k
gives all commands that have the "string" as reference in manual
#man -k "update system"
fwupdate - update system firmware - 48Which command returns system information?#uname
- 49Which command returns exactly the following info: linux version, compilation date and kernel version#uname -a
- 50How 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
- 51#echo *show all files from local directory
- 52#echo "*"the shell will just print
* - 53#echo '*'the shell will just print
* - 54What is the difference between #echo "*" #echo '*'"" - protect all these $ ` / not
' ' - protect ALL - 55#echo "Curso Linux" #echo Curso Linux #echo Curso \ \ \ \ \ \ \ Linux #echo "Curso Linux"Curso Linux
Curso Linux
Curso Linux
Curso Linux - 56Which 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 - 57How we get the release of kernel?#uname -r
OR
#uname -a
Información
- Descripción
- 103.1 Work on the command line - topico da certificação LPI I
- Creado por
- Maicon Alencar
- Visitas
- 25
- Etiquetas
- Valoración