10 useful Linux command interview questions and answers

  

1. How to pause a running process and let it run in the background?

Answer: In order to stop a running process and let it run in the background, we can use the key combination Ctrl+Z.

2. What is the minimum number of partitions required to install Linux and how do I view system startup information?

Answer: A single /root partition is sufficient to perform all system tasks, but it is highly recommended that you install at least three partitions: /root, /boot, /swap. An IDE hard drive supports up to 63 partitions and SCSI hard drives support more than 15 partitions.

In order to check the startup information, we can use the cat or dmesg command as follows:
#cat /var/log/messages

or
#dmesg< Br>

3. What is the name of the daemon that tracks system events on your Linux machine?

Answer: & rsquo;syslogd& rsquo;, which is responsible for tracking system information and storing trace logs in specific log files.

4. What is the minimum requirement for running the ’fsck‘ command in the /root partition?

Answer: /root partition must be mounted as read-only mode, not read-write mode

5. How to hierarchically copy /home directory to another directory?

Answer: The Linux & rsquo;cpio’ command has worked. & rsquo;cpio& rsquo; can hierarchically copy file and directory hierarchies to another location.

6. How to implement automatic replacement of log files in Linux?

Answer: & rsquo;logrotate’ provides automatic log replacement.

7. How do I know who is working in Linux?

Answer: Use the ’at’ command plus ’-l’ option to find out.

8. How to view the contents of the package without unpacking the tarball?

Answer: Use ’tar -tvf’. Options ‘t’(display content),‘v’(detailed report tar processing file information),‘f’(using archive files or devices)

9. What is a page fault, it is How did it happen?

Answer: When a program requests data that does not exist in memory, a page fault will occur, resulting in a program stop.

10. What is the return code in the program?

Answer: The return code is a feature of the shell. The return code shows the status of the program. A successful program returns ‘0’,&& can be used to determine which application to execute first.

Okay, the article is over. Soon, I will share the rest of the interesting articles here, remember to keep in touch with us. Also, don't forget to give us your feedback in the comments section.

Copyright © Windows knowledge All Rights Reserved