21 articles interview Questions

How can I find out how much memory my Linux is using?

From a command shell, use the “concatenate” command: cat /proc/meminfo for memory usage information. You should see a line starting MemTotal:  see below.  ie: MemTotal: 15733472 or 15GB, MemFree: and MemAvailable: This is the total memory Linux thinks it has available to use.           You can also use commands free -…

How do you change permissions under Linux? Explain chmod?

So long as you are the system administrator or the owner of a file or directory, you can grant permission using the chmod command. Use + symbol to add permission or – symbol to deny permission, along with any of the following letters: u (user), g (group), o (others), a (all), r (read), w (write)…

Explain the OIS Seven-Layer Model – Linux Interview Questions

THE OSI SEVEN-LAYER NETWORK MODEL LINUX The Open System Interconnect (OSI) seven-layer model [OSI7498] was first specified in the early 1980s. Although neither traditional nor modern networking protocols fit neatly into this model, it has been the common framework to discuss and explain networking protocols for over 20 years. The layered model is often called…

How can I speed up performance of my RH using multiple swap partitions?

If your system (especially a server) has multiple drives set up as a RAID 0 array (data striping), it would automatically spread the data across all the drives in parallel, greatly increasing the speed of disk writes versus a non-RAID setup, where the swap partition is on only one drive. Of course, not everyone can…

What are the contents of /usr/local?

It contains locally installed files. This directory matters in environments where files are stored on the network. Specifically, locally-installed files go to /usr/local/bin, /usr/local/lib, etc.). Another application of this directory is that it is used for software packages installed from source, or software not officially shipped with the distribution.

How would you reduce or shrink the size of LVM partition?

Answer: Unmount the filesystem using unmount command, Use resize2fs command , e.g resiz2fs /dev/mapper/myvg-mylv 10G Now use the lvreduce command as lvreduce -L 10G /dev/mapper/myvg-mylv The above Command will shrink the size LVM partition and fixes the filesystem size to 10GB.Most in-depth, industry-led curriculum in linux.

How can I recursively count files in a Linux directory?

How can I recursively count files in a Linux directory? I found this: find DIR_NAME -type f | wc -l or see example below: ” Found 187550 files in the directory /var/* Write a command that will do the following: -look for all files in the current and subsequent directories with an extension c,v -strip…

What does Sar provide? Where are Sar logs stored?

Sar collects, reports, or saves system activity information, sar serves to log and evaluate a variety of information regarding system activity. With performance problems, sar also permits retroactive analysis of the load values for various sub-systems (CPUs, memory, disks, interrupts, network interfaces and so forth) and limitation of problems in this manner. If CPU utilization…

What is LD_LIBRARY_PATH?

LD_LIBRARY_PATH is an environment variable. It is used for debugging a new library or a non-standard library. It is also used to identify what directories need to be searched. Path to search for directories needs to given. The variable can be set using setenv—LD_LIBRARY_PATH–$PATH. It is used to search for the shared objects / dynamic…

Explain sysctl and where do you use it? Linux Interview Question

Can you explain sysctl and where do you use it? The Linux kernel is flexible, and you can even modify the way it works on the fly by dynamically changing some of its parameters, thanks to the sysctl command. Sysctl provides an interface that allows you to examine and change several hundred kernel parameters in…

How would you list modules in the Kernel in Linux?

Module Commands depmod – handle dependency descriptions for loadable kernel modules. insmod – install loadable kernel module. lsmod – list loaded modules. modinfo – display information about a kernel module. modprobe – high level handling of loadable modules. rmmod – unload loadable modules. 2. What file allows you to update kernel parameters? 3. What is the main path of the main system log? There are Three…