Linux Questions Flashcards
How is Sudo different from Su?
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.
What is Sudo and why would you use it?
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.
What is GREP?
a Unix command used to search files for the occurrence of a string of characters that matches a specified pattern.
How do you pull up system processes in a Linux command line?
- Open the terminal window on Linux.
- For remote Linux server use the ssh command for log in purpose.
- Type the ps aux command to see all running process in Linux.
- Alternatively, you can issue the top command or htop command to view running process in Linux.
You try to delete a file and get “access denied”, what do you do?
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.
What are some important directories in a fresh new Linux installation? what is each one for?
/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
You just downloaded a file such as a script, what will you have to do to run it?
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 do you find out the hostname of the system you’re on in Linux?
Open a command-line terminal app (select Applications > Accessories > Terminal), and then type:
hostname. hostnamectl. cat /proc/sys/kernel/hostname.
Press [Enter] key.
How do you reboot a Linux system right now?
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.
What determines how many inodes you have on a Linux system?
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
What is the difference between load average and CPU usage?
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 to check the load of a Linux box?
Run the command, “uptime”