Linux interview Questions :

 1).How to recover accidently deleted /etc/fstab into linux os ?


anyone deleted this /etc/fstab .after this we can' boot ur os.



boot into recovery mode .


then go to the linux terminal page .


here we have to execute the blkid command 


here it will list out the avilble partions and attached filesystems .



if your deleting the /etc/fatab.that time root parttion won't be work 


now we can mount the root parttion in rw mode


mount -t ext4 -0 rw,remount dev/sda1 /



2).VMSTAT command into linux ?


3).iostat and dstat command into linux os ?


4).LInux free command into linux os ?



in this way we can check it our the memeory usage and swap memeory as well.



then it will display out the ,


used,space avilble ,total ,buffer/catche abd shared


what is free space



we can execute the command like as the,


free -b command :


we will get the particular output for the bits 


so if you want to getto int the outpit in kilobytes :


so we can execut ethe comamnd like as the,


free -k


free -g:


it will show the o


then we can execute the ,


free -w command :


it will display the catche annd buffer separatelt


shared memeonet means shaed the multiple process.


are utilizing the meoery


buffer :


its a reserved memeory.


catche :


recently accessed files , that only its showing here 


it could be single or multiple files


free -l


it will list out low and high-test memory



free -c 7 it will print the 7 times


------------------



1).how to craete the alias for a command?


ALias command is a user-defined shortcut for a command and the group of commands .


then , its replaces one string from the shell with another string.


alais ll = ls -l 




How to remove the alias from command into linux os ?


so we can execute the command like as the,


unalias l 


so in this way we can remove the alias from the particular command 




2).what is the use of ~/.bashrc


which is used to set the alias , define functions and 

customize their command line experiences


which is used to customize the shell environments into linux os 


how to find the ,~/ bashrc 


so we can execute the command like as the,


la -al:


bashrc configuration files:


vim bashrc


here we can define the alais and we can define the functions and which is used to customize their shell environments




3).what is the use of /home/user/.bash profile?


system profile file:


which is sued set the variable ,alias ,functions for the globally system for the all the user 


user profile file 


which is used to paramnetly define the variable ,alaias, functions for each user 


if you want to check the profile file,


so we can execut ethe ccomman =d like as the,


cat /etc/profile


which is used to tell about the shell 


grep PATH /etc/profile 


we will get the path for /etc/profile


only root user can user evrthing.likr varibale set laisla for other user.


which is used to execute the other shell scripts 


user profile file:


in each and every user account we have hidden files are there.



4).how to upgrade kernel version into linux os?


5).How to recover corrupted grub into linux os ?




6).what is the use of sudo bash vs sudo su - comamnd into linux os ?


7).then learn backup process for your linux os 


using cp ,tar command we can take the backup of your files and directory into linux os 


cp ---backup source destination path


tar -cvf the filename ends with .tar /destination oath



restore the backup from linux os :


tar -xvf (which file u are going to be backup with .tar (directory name)


xvf fullform:


x  - extract

v-verbose

f-filename type


-------------------------------------------------



14).what is difference between vi and vim into linux os ?

15).what are mode of vim command ?


16).How to copy /delete /edit/lines in vim editor?


17).How will you replace an string in vim editor?


:s%/nandhini/replace/g/

18).How to run linux terminal command if you are in vim editor?


19).How to compare the 2 files using vim?


20).How do I search text in vim?


21).How to enter insert mode from command mode?


--------



1).How to ist corntab entries?


2).How to edit crontab entries for specific user?



crontab -lu nandhini or root

3).How to remove crontab entries for one user?


crontab -ru nandhini

4).How to run muliplt commands with single cron?


we can execut ethe comamnd like as the,


crontab -e


insode we can add the comamnd like as the,



df -Th && ping -C 4 8.8.8.8 && ls -l 


four time will be executed . 


5).How to schedule the system wide cron into linux os?



we can see the multiple crontab files for system wise



6).how to enable confirmation with cron?



if you get notification ,we can schedule the cron . obviously we will get the mail .

7).Can you schedule a cron that should run every sunday 

12.30 AM?



30 12 * *  0 


--------------



22).where do we use chmod and setfacl command into linux os ?


23).How to check if there is an acl implemented on a file?


24).How to change default attribute of a file?


25).How to modify access time of a file?



touch --reference /etc/passwd root



26).Can i chnage modify time of a file to some past date ?


----------------------------------------------


27).How to check total no.of disk?

28).How to check uuuid of a disk ?

29).How to mount disk parmently?

30).what is the use of fidk command into linux os ?

31).How to create /reduce /extend LVM?


--------------


25 linux commands every sysadmin should know:


crul

check the connectivity 


cat :


in this way we can display the file content 


ls -


list out the directories' and files and permissions


tail :


it will print last 10 lines into file


telnet :


Telnet transfers the data in plain text while in SSH data is sent in encrypted format via a secure channel. Telnet is suitable for private networks. On the other hand, SSH is suitable for public networks.6 Feb 2024




grep command:


in this way we can figure out particular process



ps command :


it will list out the active pieces


env command:


top 


netstat


dig: which used to gather dns information's 


which is used to check it out the domains information's and helps troubleshoot dns problems


nslookup into linux os :


nameserver lookup :



which is used for getting information for dns server.



nslookup : provides the basic data in dns 


dig: supports a wider variety of record types.


hosts:









Comments

Popular posts from this blog

AWs Interview Questions