Recent

Top 40 Linux Interview Questions for Freshers with Answers

Top 40 Linux Interview Questions for Freshers with Answers

Hello friends, these are the best top 40 consolidated Linux Interview Questions and Answers for freshers.

Top 40 Linux Interview Questions for Freshers with Answers

1. How do you find out all processes that are currently running?
ps -f (-f does full-format listing.)

2. How do you kill a process?
kill -9  8 (if process_id 8) or kill -9  %7  (if job number 7)
kill -9 -1  (Kill all processes which you can kill.)
killall - kill processes by name most (Example : killall java)

3. How do you log in to a remote linux machine?
Using telnet server_name or ssh -l ( ssh - OpenSSH SSH client (remote login program))

4. How do you get help on a linux terminal?
man command_name
info command_name (more information)

5. How do you list contents of a directory including all of its subdirectories, providing full details and sorted by modification time? 
ls -lac
a all entries
c by time

6. What is a filesystem?   
Sum of all directories called file system where all our data's are stored in organized structure. File systems are made of inodes and superblocks.

7. How do you check the sizes of all users home directories (one command)?
du -s
df
The du command summarizes disk usage by directory. It recurses through all subdirectories and shows disk usage by each subdirectory with a final total at the end.

8. How do you check the list of processes running by user 'linux1'?
ps -fu linux1   (-f -full_format u -user_name )

9. Explain iostat, vmstat and netstat commands? 
iostat reports about terminal, disk and tape I/O activity.
vmstat reports about virtual memory statistics of processes, disk, tape and CPU activity.
netstat reports about the contents of network data structures.

10. How do you list the files including hidden files with detailed information?
ls -la

Also refer more interview questions and answers,
Veritas Cluster Interview Questions and Answers
Linux Interview Questions and Answers
Openstack Interview Questions and Answers
Vmware Interview Questions and Answers
Cluster Interview Questions and Answers
HR Interview Questions and Answers

11. How do you execute a linux command in the background?  
Use the “&” at the end of the command (Example : top &)

12. What Linux command controls the default file permissions when files are created?  
umask

13. Explain the read, write, and execute permissions on a Linux directory?
Read allows you to see and list the directory contents.
Write allows you to create, edit and delete files and subdirectories in the directory.
Execute gives you the permissions to run programs or shells from the directory.

14. Give the command to display space usage on the Linux file system?
df -h

15. What’s in the file /etc/ttys?
Configuration for virtual consoles for the startup. By default Linux has 8 virtual consoles.

16. The permissions of a file is 645. what it means?
The permissions value are always 4 for read, 2 for write, 1 for execute. The three numbers are always for owner, group, and everybody on the system. Therefore 645 means: owner - read and write, group - read only, everybody - read and execute.

17. How do you change your shell to bash?  
chsh -s /usr/local/bin/bash

18. In Linux OS, what is the file server?  
The file server is a machine that shares its disk storage and files with other machines on the network.

19. What is NFS? What is its job?
NFS stands for Network File System. NFS enables filesystems physically residing on one computer system to be used by other computers in the network, appearing to users on the remote host as just another local disk.

20. What is LILO?
LILO stands for Linux boot loader. It will load the MBR, master boot record, into the memory, and tell the system which partition and hard drive to boot from. Nowadays we use grub2 as a default boot loader.

21. How do you log in to a remote linux box? 
ssh -l remote_ip

22. What utility would you use to cut off the first column in a text file? 
awk, cut

23. How do you find out what’s your shell?
echo $SHELL

24. What’s the command to find out today’s date?
date

25. What’s the command to find out the logged in users on the system?
who

26. How do you find out the current directory you’re in?
pwd

27. How do you remove a file?
rm

28. How do you find out your own username?
Whoami

29. How do you count words, lines and characters in a file?
Use 'wc' commands

30. How do you search for a string inside a given file?
grep string filename


Also refer more interview questions and answers,
Veritas Cluster Interview Questions and Answers
Linux Interview Questions and Answers
Openstack Interview Questions and Answers
Vmware Interview Questions and Answers
Cluster Interview Questions and Answers
HR Interview Questions and Answers

31. How do you search for a string inside a directory?
grep string *

32. How do you search for a string in a directory with the subdirectories recursed?
grep -r string *

33. What are PIDs?
They are process IDs given to each processes. A PID can vary from 0 to 65535.

34. How do you list currently running process?
ps

35. How do you stop/kill a process?
kill pid

36. How do you stop all the processes, except the shell window?
kill 0

37. How do you refer to the arguments passed to a shell script?
$1, $2 and so on. $0 is your script name.

38. How to see the free memory in Linux?
/proc/meminfo   / free

39. How to see a port is opened or not?
netstat –an |grep LISTEN   (or)  nmap ipaddress

40. What are the process states in Linux?
As a process executes it changes state according to its circumstances. Unix processes have the following states:
Running : The process is either running or it is ready to run .
Waiting : The process is waiting for an event or for a resource.
Stopped : The process has been stopped, usually by receiving a signal.
Zombie : The process is dead but have not been removed from the process table.


Also refer more interview questions and answers,
Veritas Cluster Interview Questions and Answers
Linux Interview Questions and Answers
Openstack Interview Questions and Answers
Vmware Interview Questions and Answers
Cluster Interview Questions and Answers
HR Interview Questions and Answers
linux interview questions, linux questions and answers, linux interview questions and answers, linux basics interview questions, linux l3 interview questions, linux interview questions and answers pdf, interview questions on linux, linux interview questions for freshers
Thanks for reading our post. share with your friends. We appreciate your feedback, Leave your comments if any.

We have more articles to be updated soon. To not miss any updates, Follow us on social networking sites and Subscribe us on our Youtube channel. Basic linux interview questions, Basic interview questions of linux, linux interview questions for beginners, Most commonly asked linux interview questions, linux Technical Questions, linux cloud interview questions, linux admin interview questions, linux job interview questions, interview questions
Top 40 Linux Interview Questions for Freshers with Answers thumbnail Reviewed by Selva Kumar on 20:01 Rating: 5

No comments:

All Rights Reserved by Learn IT Guide © 2015 - 2025.

Contact Form

Name

Email *

Message *

Powered by Blogger.