What can be found in the /proc/ directory?
The /proc/ directory is a virtual file system that contains information about the system and the processes running on it. It is not a conventional file system that stores files on a disk, but rather a dynamic view of the kernel's data structures. One of the features of the /proc/ directory is that it contains one subdirectory for each process running on the system, which is named after the process ID (PID). For example, the subdirectory /proc/1/ contains information about the process with PID 1, which is usually the init process. The process subdirectories contain various files that provide information about the process, such as its status, memory usage, open files, environment variables, command line arguments, and more. The /proc/ directory also contains a symbolic link called 'self', which points to the process that is accessing the /proc/ file system. Therefore, the correct answer is D. One directory per running process.
The other options are incorrect because:
A . One directory per installed program. This is not true, as the /proc/ directory does not contain information about installed programs, but only about running processes. Installed programs are usually stored in other directories, such as /bin/, /usr/bin/, /opt/, etc.
B . One device file per hardware device. This is not true, as the /proc/ directory does not contain device files, but only virtual files that represent kernel data. Device files are usually stored in the /dev/ directory, which is another special file system that provides access to hardware devices.
C . One file per existing user account. This is not true, as the /proc/ directory does not contain information about user accounts, but only about processes. User accounts are usually stored in the /etc/ directory, which contains configuration files, such as /etc/passwd/ and /etc/shadow/, that define the users and their passwords.
E . One log file per running service. This is not true, as the /proc/ directory does not contain log files, but only information files. Log files are usually stored in the /var/log/ directory, which contains various files that record the activities of the system and the services.
The /proc Filesystem --- The Linux Kernel documentation
A Beginner's Guide to the /proc File System in Linux - Tecmint
Appendix E. The proc File System Red Hat Enterprise Linux 6 | Red Hat ...
Chapter 5. The proc File System Red Hat Enterprise Linux 4 | Red Hat ...
What information can be displayed by top?
The top command is a Linux command that shows the running processes on the system. It provides a dynamic real-time view of the system performance and resource usage. The top command can display various information about the processes, such as their process ID, user, priority, state, CPU and memory usage, command name, and more. The top command can also sort the processes by different criteria, such as CPU or RAM consumption, by using the interactive commands. The top command is useful for monitoring the system load and identifying the processes that are consuming the most resources.Reference:
What information can be displayed by top?
The top command is a Linux command that shows the running processes on the system. It provides a dynamic real-time view of the system performance and resource usage. The top command can display various information about the processes, such as their process ID, user, priority, state, CPU and memory usage, command name, and more. The top command can also sort the processes by different criteria, such as CPU or RAM consumption, by using the interactive commands. The top command is useful for monitoring the system load and identifying the processes that are consuming the most resources.Reference:
FILL in BLANK
What keyword is used in a shell script to begin a loop? (Specify one keyword only, without any additional
information.)
The keyword for is used in a shell script to begin a loop that iterates over a list of items or a range of numbers. The syntax of the for loop is as follows:
for <var> in <list> do <commands> done
The current directory contains the following file:
-rw-r---r--- 1 root exec 24551 Apr 2 12:36 test.sh
The file contains a valid shell script, but executing this file using ./test.sh leads to this error:
bash: ./test.sh: Permission denied
What should be done in order to successfully execute the script?
The execute bit in Linux is a permission bit that allows the user to run an executable file or enter a directory. For regular files, such as scripts or binaries, the execute bit must be set for the user to run them. For directories, the execute bit allows the user to access the files and subdirectories inside. Therefore, to successfully execute the script test.sh, the execute bit should be set in the file's permissions. This can be done by using the chmod command with the +x option, for example: chmod +x test.sh. The other options are either irrelevant or incorrect. The file's extension does not affect its executability, only its association with a program. The user executing the script does not need to be in the exec group, as long as the user has the execute permission on the file. The SetUID bit is a special permission bit that allows the user to run the file as the file's owner, regardless of the user's identity. This is not necessary for executing the script, and may pose a security risk. The #!./test.sh syntax is invalid, as the #! is used to specify the interpreter for the script, not the script itself.Reference:
Linux Essentials Version 1.6 Exam Preparation Guide2, Section 1.4: Command Line Basics, Page 16
Execute vs Read bit.How do directory permissions in Linux work?3
Heidy
2 days agoMica
9 days agoMitzie
16 days agoClare
24 days agoKaitlyn
1 month agoFelice
1 month agoDarrin
2 months agoMarion
2 months agoFrank
2 months agoDenna
2 months agoKaycee
3 months agoDetra
3 months agoBettye
3 months agoFrancesco
3 months agoWillard
3 months agoLuis
4 months agoBenedict
4 months agoGabriele
4 months agoMalinda
5 months agoFrederica
5 months agoRashad
5 months agoMarta
5 months agoLorrine
6 months agoTawna
6 months agoRichelle
6 months agoTayna
6 months agoNobuko
7 months agoSkye
7 months agoFiliberto
9 months agoVince
9 months agoHeike
9 months agoDominque
10 months agoWillie
10 months agoEura
10 months agoMalcom
11 months agoJina
11 months agoDanilo
11 months agoMa
12 months agoWinifred
12 months agoBarney
1 year agoMyong
1 year agoLizbeth
1 year agoCarla
1 year agoRuth
1 year agoGeraldo
1 year agoJoye
1 year agoNickolas
1 year agoHeike
1 year agoStanton
1 year agoDalene
1 year agoStarr
1 year agoLoren
1 year agoSophia
1 year agoBernardo
1 year agoDelsie
1 year agoTasia
1 year agoKrissy
1 year agoRolland
1 year agoAdelina
1 year agoJanet
1 year agoLaila
1 year agoRodrigo
1 year agoAlyce
1 year agoGeorgene
1 year agoFranklyn
2 years agoCatarina
2 years agoMerilyn
2 years agoDesirae
2 years agoLore
2 years agoMaile
2 years agoVerdell
2 years ago