InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Process Commands |
|||||||||||||||||||||
Answer»
|
||||||||||||||||||||||
| 2. |
Networking Commands |
|||||||||||||||
Answer»
|
||||||||||||||||
| 3. |
User Management Commands |
||||||||||||||||||||||||
Answer»
|
|||||||||||||||||||||||||
| 4. |
Environment Variable Commands |
||||||||||||
Answer»
|
|||||||||||||
| 5. |
File and Directory Compression Commands |
||||||||||||||||||
|
Answer» The files can be compressed and then extracted to save the storage. We see this happening many times in our daily lives that we have to compress some file to send it or we have to extract a downloaded file. There are several commands for file compression in Linux given below:
|
|||||||||||||||||||
| 6. |
Hardware Information Commands |
||||||||||||||||||
|
Answer» Let us now see, some of the hardware information commands that give us the information about the hardware that we are using.
|
|||||||||||||||||||
| 7. |
File Permission Commands |
|||||||||||||||
|
Answer» There are 3 types of people who can use a file and each type has 3 types of access to the file. This is shown in the diagram given below: The diagram shows that there are 3 types of people accessing a file and they are:
Also, the access that we want to give to each of them is of three types:
So, each of them can have 0 or more out of these 3 permissions. Now let us understand the Linux commands that help us give these permissions to the files.
Before we jump into the Linux file permission commands and see some examples, it is very important to understand this chmod command in detail first as understanding this command completely will clear the entire concept of file permission commands. The chmod command stands for “change-mode” which means that using this command, we can change the mode in which some user is able to access the file. This command is used to change the file permissions. The syntax can be either using symbols (characters) or numbers. We will see that in detail.
This is the first method of chmod command using which we can give permissions. The basic syntax is as follows: chmod [ugoa…][-+=]perms…[,....] FILE…. Let us understand this syntax in detail. The first set means the type of person to give access to. Here:
If the user's flag is not included in the command i.e. we do not mention for which kind of people out of u, g and o, are we changing the permissions for, by default, it takes a i.e. all the users. The second set is the set of operators. Let us see what they mean.
The perms stand for permission and ‘,’ is used to separate different permissions. Let us now see the Linux commands using the symbolic notation of chmod.
There are numeric codes for each permission. They are as follows:
The permissions number of a specific user class is represented by the sum of the values of all the permissions. For instance, if the user has read and executed permissions, but not the write permission, then the permissions number for the user will be read (4) + execute(1) = 5. For instance, if we have to write a command to provide read and write permissions to the user, group and others, there can be many ways of doing so. Let us see one symbolic way:
$ chmod ugo+rw file1.txt We can write this in a numeric way as shown below:
$ chmod 666 file1.txt Explanation: We have already studied that if we do not mention u/g/o then by default the permissions are applied to all. Also, read + write = 4 + 2 = 6. We have written 6 thrice because of applying the permissions to user, group and others. So, read and write permissions are applied to the user, group and others (666) for the file file1.txt. |
||||||||||||||||
| 8. |
System Information Commands |
|||||||||||||||||||||||||||||||||
|
Answer» These are some of the general-purpose system information commands that are important to know and easy to remember.
|
||||||||||||||||||||||||||||||||||
| 9. |
File and Directory CRUD Navigation Commands |
||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Answer» CRUD stands for Create, Read, Update, and Delete. CRUD operations are said to be the basic operations on any file or directory or database. Even if you are not a Linux User, file and directory CRUD operations are something that you should be comfortable with.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||