General Flashcards

1
Q

Do you know the basic differences between Red Hat and CentOS?

A

Centos is free but is community supported, while redhat isn’t free but has support (for troubleshooting) provided by paid vendors. Centos for individual personal use, redhat for corporate use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why would you prefer Linux over Windows or any other operating system?

A

Linux is open source,
secure, multitasking, light weight, provides more uptime, less vendor dependency.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which RHEL versions are you familiar with?

A

RHEL 7, 8, 9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which ticketing system are you familiar with?

A

Jira

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the structure of Linux, or what are the core components of the Linux OS?

A

The structure of Linux, or the core components of the Linux OS, typically includes:
Kernel: The core of the operating system that interacts with the hardware and manages system resources.
Shell: The interface that allows users to interact with the operating system through command-line commands or scripts.
Filesystem: The hierarchy of directories and files that store data and programs. Libraries: Collections of precompiled functions and routines that applications can use.
Utilities: Various command-line and GUI tools for managing the system and performing tasks.
Processes: Running instances of programs or commands that perform tasks.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the difference between shell and Kernel?

A

shell is the interface between the user and the
kernel.

kernel is an interface between the shell and hardware.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which commands do you use on a routine basis?

A

uname, ifconfig, lsblk, du, df, hostname, w, who,
uptime, top, ps, nmcli

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How can we check the hostname?

A

hostname, hostnamectl

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the command to check the OS release?

A

cat /etc/os-release, cat /etc/redhat-release

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you find out the kernel version of a Linux system?

A

uname -r

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the difference between “su” and “su -“?

A

su: switch users to a new user by adding a shell, while keeping the environment (home directory for example) of the PREVIOUS user.

su -: switch users to a new user by adding a shell, while maintaining the environment (home directory for example) of the NEW user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which command do we use to get the commands you executed recently?

A

history and up arrow

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are binaries, and where are they stored?

A

Binaries are executable files written in binary code.
They are stored in /bin for the regular user, and system binaries are stored in /sbin.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the /boot and /etc directories?

A

/boot – booting files
/etc – configuration
files

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does the /proc file system contain, and what is the size of this file system?

A

virtual file system
with 0 byte size. contains the kernel related files. it does not take space from the disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the basic difference between the /bin and /sbin directories?

A

/bin stores user binaries

/sbin stores system binaries

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which file system contains system configuration files?

A

/etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is the path to the directory that contains environmental files?

A

/etc/skel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Do you know how to execute multiple commands in a terminal?

A

; semicolon to separate commands and execute them in one go. -exec with find

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Where are system binaries kept?

A

/sbin

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does the /opt directory/file system contain?

A

contains the optional or third party tools

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What information can we extract from the uptime command?

A

current time of the system, how long system is up, no. of users logged in, load average at 1, 5 and 15 minutes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the command to list all logged-in users and the time the server has been up for?

A

w, who

w
command is more organized and gives more information

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What types of different timings are kept in record by Linux for files and directories, and which command would exhibit that information?

A

stat <filename> gives the
access (last time file was opened)
modify (change contents)
change (change metadata)</filename>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

What is the pwd command used for?

A

present working directory, helps navigatae where you are
in the system

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What is the difference between / and /root?

A

/ is the root filesystem, biggest.
/root is the home directory of root user

27
Q

How can we create a directory?

A

mkdir directory-name

28
Q

What does directory structure mean?

A

In computing, the way the operating system arranges files and directories

29
Q

How to create a directory structure /dev/app/apache?

A

mkdir -p /dev/app/apache

30
Q

What does the -p flag mean in mkdir?

A

-p flag provides or creates the directory structure. parent

31
Q

How can you list the directory tree structure?

A

tree command.
tree directory-name

32
Q

How can we update the time stamp of an existing file?

A

touch file-name

33
Q

How can we long list files and sort by time stamp?

A

ls -lt

34
Q

How can we recursively show the contents of the directory and sub- directory in the form of long list?

A

ls -lR

35
Q

Difference between “>” and echo “»” sign.

A

> will overwrite if the contents are already there

> > will append the contents.

36
Q

What is the difference between appending to a file Vs overriding a file, and how would you do that?

A

existing contents will still be in file, new contents will be added
overwrite the existing contents.

37
Q

Let’ say /var is 95% utilized, how would you know which files/dir(s) are consuming the most space under /var?

A

du -h /var | sort -rh | head

38
Q

How would you nullify/truncate the contents without deleting the file?

A

echo > filename or
> filename

39
Q

For a given directory structure “/tmp/users/data” you are required to delete the Users directory and everything underneath it (recursively without getting prompted).

A

rm -rf /tmp/users

40
Q

What is metadata? Where is metadata of a file or directory stored?

A

Metadata is data about data, such as information about a file or directory (permissions, ownership, timestamps (atime, mtime, ctime), size, and file type)

It’s stored within the inode (index node) associated with each file or directory

41
Q

How to list the metadata of a file or directory?

A

stat file or directory name

42
Q

How to find out the free inode numbers on /boot file system?

A

df -ih /boot

43
Q

How to know the type of a file whether if it is a file, directory or archive?

A

file file name

44
Q

How can we copy a file or directory while preserving the time stamp?

A

cp -p file or directory name

45
Q

How to read 2 different files and redirect the output into one larger file?

A

cat file1 file2&raquo_space; file3

46
Q

What is the head command? How many lines does it show by default?

A

it reads the file from the top and by default prints the first ten lines

47
Q

What is tail command? How many lines does tail command show by default?

A

it reads the file from
the bottom and by default prints the last ten lines

48
Q

What is the difference between “/var/log/secure” and “/var/log/messages”?

A

security and authentication logs
system error related logs

49
Q

What is the path to the system error logs?

A

var/log/messages

50
Q

What information /var/log/dmesg or command dmesg contain?

A

hardware related logs, info about
hardware. boot related logs as well

51
Q

How do you list the block devices?

A

lsblk

52
Q

What are the slowest and fastest components of the system?

A

hard disk is slowest, cpu is fastest

53
Q

Why do we need RAM if we have the hard disk for storage?

A

a very essential and critical component provides fast and temporary storage since hd cannot match the speed of the cpu, compliments the
disk

54
Q

When RAM gets full where does data go?

A

swap space

55
Q

How can we get the Swap space available in system?

A

free -h, swapon –show

55
Q

What is swap space and where does it resides?

A

virtual memory on the hard drive

56
Q

What is the purpose of df command?

A

report the filesystem disk usage space. whole system. system
wide disk utilization

57
Q

How would you make df command human readable?

A

df -h

58
Q

What is the purpose of du command?

A

disk usage or utilization of particular directory or filesystem

59
Q

How can we get the disk utilization of a /tmp directory?

A

du -sh /tmp

60
Q

How can you know that user is allowed to write in the file or not?

A

ls -l file will give the permissions.
stat

61
Q

List the last 15 messages from the file which contains authentication/security logs?

A

tail -15
/var/log/secure

62
Q

How can we get the real time updates in /var/log/secure file?

A

tail -f /var/log/secure