Linux Questions Flashcards

1
Q

How is Sudo different from Su?

A

Both Su and Sudo elevate privileges assigned to the current user. The main difference between the two is that Su requires the password of the target account while Sudo requires the password of the current user.

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

What is Sudo and why would you use it?

A

The sudo command allows you to run programs with the security privileges of another user (by default, as the superuser). It prompts you for your personal password and confirms your request to execute a command by checking a file, called sudoers , which the system administrator configures.

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

What is GREP?

A

a Unix command used to search files for the occurrence of a string of characters that matches a specified pattern.

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

How do you pull up system processes in a Linux command line?

A
  1. Open the terminal window on Linux.
  2. For remote Linux server use the ssh command for log in purpose.
  3. Type the ps aux command to see all running process in Linux.
  4. Alternatively, you can issue the top command or htop command to view running process in Linux.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You try to delete a file and get “access denied”, what do you do?

A

Check to see what octal bits are assigned, User and Group. To resolve you can become the user or root or you can change the ownership of the file.

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

What are some important directories in a fresh new Linux installation? what is each one for?

A

/bin - This folder will contain most if not all of the programs or applications of the machine
/CDROM - self explanatory
/boot - for static boot files
/dev - where all your devices live
/etc - for all configuration files
/home - for home folders
/Media - where you can mount and unmount devices

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

You just downloaded a file such as a script, what will you have to do to run it?

A

By default, the shell script will not run. You need to set execute permission for your shell script. You can execute by running the command. hmod +x script-name-here

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

How do you find out the hostname of the system you’re on in Linux?

A

Open a command-line terminal app (select Applications > Accessories > Terminal), and then type:
hostname. hostnamectl. cat /proc/sys/kernel/hostname.
Press [Enter] key.

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

How do you reboot a Linux system right now?

A

To reboot the Linux system from a terminal session, sign in or “su”/”sudo” to the “root” account.
Then type “ sudo reboot ” to reboot the box.

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

What determines how many inodes you have on a Linux system?

A

The amount of inodes available on a system is decided upon creation of the partition. For instance, a default partition of EXT3/EXT4 has a bytes-per-inode ratio of one inode every 16384 bytes (16 Kb). A 10GB partition would have would have around 622.592 inodes. A 100GB partition has around 5.976

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

What is the difference between load average and CPU usage?

A

the load average and CPU utilization are actually two different things. Load average is a measurement of how many tasks are waiting in a kernel run queue (not just CPU time but also disk activity) over a period of time. CPU utilization is a measure of how busy the CPU is right now.

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

How to check the load of a Linux box?

A

Run the command, “uptime”

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