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
What is the pwd command used for?
present working directory, helps navigatae where you are in the system
26
What is the difference between / and /root?
/ is the root filesystem, biggest. /root is the home directory of root user
27
How can we create a directory?
mkdir directory-name
28
What does directory structure mean?
In computing, the way the operating system arranges files and directories
29
How to create a directory structure /dev/app/apache?
mkdir -p /dev/app/apache
30
What does the -p flag mean in mkdir?
-p flag provides or creates the directory structure. parent
31
How can you list the directory tree structure?
tree command. tree directory-name
32
How can we update the time stamp of an existing file?
touch file-name
33
How can we long list files and sort by time stamp?
ls -lt
34
How can we recursively show the contents of the directory and sub- directory in the form of long list?
ls -lR
35
Difference between “>” and echo “>>” sign.
> will overwrite if the contents are already there >> will append the contents.
36
What is the difference between appending to a file Vs overriding a file, and how would you do that?
existing contents will still be in file, new contents will be added overwrite the existing contents.
37
Let’ say /var is 95% utilized, how would you know which files/dir(s) are consuming the most space under /var?
du -h /var | sort -rh | head
38
How would you nullify/truncate the contents without deleting the file?
echo > filename or > filename
39
For a given directory structure “/tmp/users/data” you are required to delete the Users directory and everything underneath it (recursively without getting prompted).
rm -rf /tmp/users
40
What is metadata? Where is metadata of a file or directory stored?
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
How to list the metadata of a file or directory?
stat file or directory name
42
How to find out the free inode numbers on /boot file system?
df -ih /boot
43
How to know the type of a file whether if it is a file, directory or archive?
file file name
44
How can we copy a file or directory while preserving the time stamp?
cp -p file or directory name
45
How to read 2 different files and redirect the output into one larger file?
cat file1 file2 >> file3
46
What is the head command? How many lines does it show by default?
it reads the file from the top and by default prints the first ten lines
47
What is tail command? How many lines does tail command show by default?
it reads the file from the bottom and by default prints the last ten lines
48
What is the difference between “/var/log/secure” and “/var/log/messages”?
security and authentication logs system error related logs
49
What is the path to the system error logs?
var/log/messages
50
What information /var/log/dmesg or command dmesg contain?
hardware related logs, info about hardware. boot related logs as well
51
How do you list the block devices?
lsblk
52
What are the slowest and fastest components of the system?
hard disk is slowest, cpu is fastest
53
Why do we need RAM if we have the hard disk for storage?
a very essential and critical component provides fast and temporary storage since hd cannot match the speed of the cpu, compliments the disk
54
When RAM gets full where does data go?
swap space
55
How can we get the Swap space available in system?
free -h, swapon --show
55
What is swap space and where does it resides?
virtual memory on the hard drive
56
What is the purpose of df command?
report the filesystem disk usage space. whole system. system wide disk utilization
57
How would you make df command human readable?
df -h
58
What is the purpose of du command?
disk usage or utilization of particular directory or filesystem
59
How can we get the disk utilization of a /tmp directory?
du -sh /tmp
60
How can you know that user is allowed to write in the file or not?
ls -l file will give the permissions. stat
61
List the last 15 messages from the file which contains authentication/security logs?
tail -15 /var/log/secure
62
How can we get the real time updates in /var/log/secure file?
tail -f /var/log/secure