0% found this document useful (0 votes)
16 views

Top Linux Interview Questions and Answers

Interview questions

Uploaded by

thisischinaphone
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Top Linux Interview Questions and Answers

Interview questions

Uploaded by

thisischinaphone
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Top Linux Interview Questions and Answers For Freshers

1. What is Linux?
o Linux is an open-source operating system based on Unix,
widely used for servers, desktops, and embedded systems.
It is known for its stability, security, and flexibility.
2. What are the key features of Linux?
o Key features include open-source, multiuser capabilities,
multitasking, portability, security features (like
permissions), and extensive community support.
3. What is the Linux Kernel?
o The Linux Kernel is the core part of the Linux operating
system that manages hardware resources and allows
communication between software and hardware.
4. Explain the basic directory structure in Linux.
o The basic structure includes directories like / (root), /bin
(user binaries), /etc (configuration files), /home (user
directories), and /usr (user utilities).
5. What is the difference between Linux and Unix?
o Linux is open-source and free, while Unix is a proprietary
operating system. Linux is more flexible and can run on
various hardware.
6. What are the types of Shells in Linux?
o Common shells include Bourne Shell (sh), Bourne Again
Shell (bash), C Shell (csh), and Z Shell (zsh).

Created By – Piyush Dwivedi


7. How do you check the current directory in Linux?
o You can check the current directory using the command
pwd.
8. What is the command to list files in a directory?
o The command to list files is ls.
9. How do you change file permissions in Linux?
o Use the chmod command followed by the permission
settings, for example, chmod 755 filename.
10. What does 'chmod 755 filename' mean?
o It sets the permissions for the file: owner can read, write,
and execute; group can read and execute; others can read
and execute.

11. How do you check the disk usage in Linux?


o Use the command df -h to check disk usage.
12. What is the difference between 'su' and 'sudo'?
o su switches to another user account, while sudo allows
you to run commands as another user, usually root,
without switching accounts.
13. How do you check the Linux system uptime?
o Use the command uptime.
14. What is the command to check running processes in
Linux?
o Use the command ps aux.
Created By – Piyush Dwivedi
15. How do you create a new user in Linux?
o Use the command sudo adduser username.
16. What is a symbolic link in Linux?
o A symbolic link is a file that points to another file or
directory.
17. How do you create and remove directories in Linux?
o Create with mkdir directoryname and remove with
rmdir directoryname.
18. What is the command to delete a file in Linux?
o Use rm filename to delete a file.
19. How do you find a file in Linux?
o Use the find command: find /path/to/search -
name filename.
20. What is the purpose of the 'grep' command?
o The grep command searches for specific patterns in files.
21. Explain how the 'cat' command works.
o The cat command concatenates and displays file content.
22. How do you view the contents of a file in Linux?
o You can use cat, more, or less commands.
23. What is the difference between 'rm' and 'rmdir'?
o rm removes files and directories; rmdir removes empty
directories.
24. What is the command to display the IP address of the
system?
o Use ip addr show.
Created By – Piyush Dwivedi
25. How do you compress files in Linux?
o Use tar -czvf archive.tar.gz
directoryname to compress files.
26. What is the use of the 'df' command?
o The df command displays disk space usage.

27. Explain how the 'ps' command works.


o The ps command shows currently running processes.
28. How do you check memory usage in Linux?
o Use free -h to check memory usage.
29. What is the 'kill' command used for?
o The kill command terminates processes by their process
ID (PID).
30. How do you schedule a job using 'cron'?
o Use crontab -e to edit cron jobs and schedule tasks.
31. What is the significance of the '/etc/passwd' file?
o This file contains user account information, including
usernames and home directories.
32. What is the 'fstab' file in Linux?
o The /etc/fstab file contains information about disk
partitions and their mount points.
33. How do you mount a file system in Linux?
o Use mount /dev/sdX /mount/point.

Created By – Piyush Dwivedi


34. What is LVM in Linux?
o LVM (Logical Volume Manager) allows flexible disk
management.
35. How do you change the default shell for a user?
o Use chsh -s /path/to/shell username.
36. Explain the difference between hard and soft links.
o Hard links point directly to the inode, while soft links
point to the filename.
37. How do you check for open ports in Linux?
o Use netstat -tuln.
38. What is SELinux?
o SELinux (Security-Enhanced Linux) provides access
control security policies.
39. How do you install software packages in Linux?
o Use package managers like apt or yum.
40. Explain the usage of the 'top' command.
o The top command shows real-time process management
and resource usage.
41. What is the 'tail' command?
o The tail command displays the last part of a file.

42. What are runlevels in Linux?


o Runlevels define the state of the system and which
services are running.
Created By – Piyush Dwivedi
43. What is the purpose of the 'chmod' and 'chown'
commands?
o chmod changes permissions, while chown changes
ownership.
44. What are inodes in Linux?
o Inodes store file metadata, excluding the filename.
45. What is swap space?
o Swap space acts as virtual memory when RAM is full.
46. How do you configure networking on a Linux system?
o Configure via files like /etc/network/interfaces
or using commands like ip.
47. Explain how to secure a Linux server.
o Secure a server by keeping it updated, configuring
firewalls, and using SSH.
48. What is the purpose of the '/etc/hosts' file?
o It maps hostnames to IP addresses for local resolution.
49. What is 'rsync' and how do you use it?
o rsync is a utility for efficiently transferring and
synchronizing files.
50. What is a package manager?
o A package manager automates the installation, upgrade,
and removal of software packages.

For more questions, click on the Link

Created By – Piyush Dwivedi

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy