Evaluation 1 Stuff Flashcards

1
Q

What is difference between hard link and soft link?

A

A hard link is a mirror or the original file, it updates the data when is created instead of copying. A soft link is basically a pointer, data is stored in the original file. The main difference is if original file is deleted or moved link will be broken.

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

Command to create symbolic or symlink or soft link?

A

*ln -s <source></source><target>
*ln -s /root/dir1 /root/link-dir1
*li</target>

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

You want to compress and achieve the /data file system. What command would you use to archive and compress / data in one shot?

A

Tar -cvfz <name> <source></source>
Tar -czvf tmp.tar.gz /tmp</name>

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

What daemon is responsible for the system log?

A

Rsyslogd daemon

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

Filesystem that was at 100% capacity, how would you find what was filling up that filesystem?

A

Du - sh

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

If users home directory is using 50B. User deletes a big file (25B) and checks but df -h still reports its size as 50GB. Why even though 25 GB file was deleted? What’s the issue?

A

System dont recognize the change , the delete file was open and being used at the time of deletion.
Type lsof command
Get the PID of the opened file
Kill -9 <PID></PID>

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

How can you go into single user mode and its purpose?

A

Init 1 or during boot stop the process and press “e” then add systemd.unit=emergency.target
Emergency mode basically for maintenance.

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

How can you change the root passwd in RHEL 7 if you forget it?

A

Reboot the server
Stop the grub menu by hitting any key
Press e to edit kernel cmdline entry
Go to the end of the line starting with Linux16 and type
Init=/bin/bash
Hit ctlr+×
Chroot/sysroot
#passwd and enter and new password
Touch/.autorelabel
Reboot -f

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

What are some of the run levels/targets?

A

0 = shutdown/emergency mode
1= single user
2= multi user w/no network
3= multi user w/network no /GUI
4= not used or undefined
5= multi user w/network and w/GUI
6= reboot

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

How can you go into single user mode and its purpose?

A

Init 1
Troubleshooting
Emergency mode

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

Which command will you use to change the run level?

A

Init
Systemctl set-default
Vi /etc/systemd/system/default.target

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

How can you perform a file system consistency check on a partition/hard drive?

A

First unmount disk umount command
Fsck /dev/sdb1

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

What is the advantage of yum over rpm?

A

Yum is easy to install and it will install the dependencies and the latest version.
Rmp doesn’t resolve dependencies and you have to do it separately and fo thru the dependency hell.

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

Commands to check OS release?kernel version? Uptime?

A

Cat /etc/redhat-release
uname -r
Uptime prints current time, how long system has been up, number of users online, load average. Number of processes over preceding 1,5,15min intervals

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

Major differences between RHEL 6 and RHEL 7?

A

RHEL 6. RHEL7
Bootloader grub. Grub 2
Kernel. 2.6. 3.10
Run level. Init. Systemd.target
Default system. Ext4. Xfs
File size. 16T. 500 T

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

What is the difference between grep and find command?

A

Grep allows us to reach a pattern inside a file
Find allows to search a file and directories at system level.

17
Q

What is $0? And $# ? In shell scripting?

A

$0 current shell working
$? Shows the status of the last executed command
$# number of arguments passed in shell scripting

18
Q

Command to change ownership and permissions such as rwx?

A

chown
chown julio:admin
r = read w= write x=execute
Chmod rwx chmod 757

19
Q

What is a zombie process?

A

Child process whose parent process has died, doesn’t take any resources.

20
Q

Difference between kill -9 and kill -15

A

Kill -9 kills abruptly
Kill - 15 kills gracefully

21
Q

What file contains yum repository?

A

/etc/yum.repos.d/

22
Q

What is configuration file of yum?

A

/etc/yum.conf

23
Q

List repos using yum command

A

Yum repolist

24
Q

How to update your system with a single command?

A

Yum update -y

25
Q

How can you perform a file system consistency check on a partition/hard drive?

A

Fsck /dev/sdb