forked from KastroVKiran/DevOps-Interview-Preparation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLinux.txt
83 lines (52 loc) · 2.84 KB
/
Linux.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
Linux Interview Questions
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1. What is the difference between rm and rm -rf?
Answer: rm - Deletes the files and rm -rf deletes the files + directories
2. How do you check the disk usage of a directory?
Answer: du -sh /path/to/directory
3. What is the difference between kill and kill -9?
Answer: kill terminates specified process gracefully by allowing process to close files, release memory and cleanup resources where ass kill -9 terminates the process forcefully.
4. How do you find a file in Linux?
Answer: find /path/to/search -name "filename"
5. What is the purpose of the grep command?
Answer: To search and display lines that contain a specified string or pattern from files or command output.
6. How do you check the running processes in Linux?
Answer: ps aux or top
7. What is the difference between soft link and hard link?
Answer:
8. How do you check the IP address of a system?
Answer: ip addr show or ifconfig
9. What is the use of chmod, chown, and chgrp?
10. How do you check the kernel version of a Linux system?
Answer: uname -r
11. What is the difference between ls, ls -l, and ls -a?
12. How do you find the current working directory?
13. How do you search for a file in Linux?
14. What command is used to display the contents of a file?
15. How do you check disk usage in Linux?
16. How do you list all running processes?
17. What is the difference between ps, top, and htop?
18. How do you terminate a running process in Linux?
19. How do you check the system uptime?
20. How do you find the largest files or directories in a system?
21. How do you create a new user in Linux?
22. What is the difference between su and sudo?
23. How do you change the ownership of a file?
24. What are the different file permissions in Linux?
25. How do you modify file permissions using chmod?
26. How do you switch users in Linux?
27. What is the purpose of /etc/passwd and /etc/shadow?
28. How do you check which users are currently logged in?
29. How do you find the IP address of your system?
30. How do you check which ports are open on your machine?
31. What is the difference between yum and apt?
32. How do you install, remove, and update packages in Linux?
33. How do you check if a package is installed on your system?
34. What is the purpose of rpm and dpkg?
35. How do you find dependencies of a package?
36. How do you check the system logs in Linux?
Answer: journalctl or /var/log/ directory.
37. How do you troubleshoot a high CPU usage issue?
Answer: Use top or htop to identify the process.
38. How do you troubleshoot a high memory usage issue?
Answer: Use free -h or top to check memory usage.