Linux Assignment(IS371)
Linux Assignment(IS371)
5.code sudo rm -r testing is used tp delete testing directory with its files within
Consider the following:
6.The command sudo chmod 755 guest is used to change the quest directory permissions to
(Execute, write, read, read-execute and read-execute), those numbers 7-5-5 has its meaning from :
0 = Nothing
1 = Execute
2 = Write
3 = Execute & Write (2 + 1)
4 = Read
5 = Execute & Read (4 + 1)
6 = Read & Write (4 + 2)
7 = Execute & Read & Write (4 + 2 + 1)
as for the 7- user, 5- group and others-5
7. The difference between a single user and multi-user run level are as follows:
Run levels refer to a mode of operation that determines which system services and applications are
available to users.
Single User Multi-user
• Is a mode of operation in which only one • Is a mode of operation in which multiple
user is allowed to log in and use the users are allowed to log in and use the
system. In this mode system simultaneously.
• Only a minimal set of system services • A full set of system services and
and programs are running programs are running
• The system is generally configured for • The system is configured for normal
maintenance or recovery tasks operation
• Example in Linux OS run levels 0, 1, and • Example in Linux OS run levels 2
6 are reserved for system shutdown, through 5 are used for multi-user
single-user mode, and reboot, operation.
respectively
8. Identify and configure system startup files.
The System startup files are located in the home directory
.bashrc The file is a shell script, which means it can contain commands and other
programming
.bash_profile Shell script for the Bash shell
.cshrc The file is a shell script using C(korn) shell constructs.
.login This runs only when you log in
.emacs An editor which consists of LISP functions
.exrc For the vi editor
Xdefaults For programs using the X Window System
.xinitrc For the X Window System with shell commands that run whenever you log into an
X session.
9. To shutdown the system immediately, you can use the shutdown command with the -h option and
the now argument. For example:
sudo shutdown -h now
this command will immediately halt the system and power it off.
10. “rm -rf /home/user/documents/*.txt”, this command will delete all files with .txt extension in
particular folder.
11. “runlevel” command. This command will display the previous and current runlevels of the
system.
12. “boot/grub/grub.cfg” This file specifies the menu options that are displayed when the system
boots, as well as the kernel and initrd images that should be loaded.
sudo grub-mkconfig -o /boot/grub/grub.cfg
13. “sudo apt-get remove elvis” this command will remove “elvis” package and dependencies but
will keep configuration files for the package.
While “sudo apt-get purge elvis” this command will completely remove “elvis” package leaving
nothing in check.
14. to install the chrome package using dpkg. The following command will be used:
sudo dpkg -i google-chrome-stable_current_amd64.deb
15. df -l –block-size=M
17 The initrd line in a GRUB (GRand Unified Bootloader) configuration specifies the location of an
initial RAM disk (initrd) file. An initrd is a small filesystem that is loaded into memory during the
boot process, before the real root filesystem is mounted. It is used to provide the kernel with a
minimal set of drivers and tools that are needed to mount the real root filesystem.
18. To find information about a public Wi-Fi network that you want to connect to, you can use the
“iwlist” command as root. This command allows you to scan for available wireless networks and
display information about them.
To scan for available wireless networks using “iwlist” you can use the following command:
iwlist wlan0 scan
This command will scan for available wireless networks using the “wlan0” interface and display a
list of the networks that are found. The output will include the name of each network (also known
as SSID), as well as other relevant information such as the network’s security type and signal
strength.
19. The first program that the Linux kernel runs after it has finished initializing itself is the init
program. The init program is responsible for starting all of the other programs and services that are
required to bring the system up and make it ready for use.
The specific behavior of the init program depends on the system's initialization system, which is
usually one of the following:
System V init: This is the traditional initialization system used by many Linux distributions.
It is configured through a set of scripts and configuration files located in the /etc/init.d and
/etc/rc*.d directories.
Upstart: This is an event-based initialization system that was developed as an alternative to
System V init. It is configured through a set of configuration files located in the /etc/init
directory.
systemd: This is a system and service manager that has become the default initialization
system for many modern Linux distributions. It is configured through a set of configuration
files located in the /etc/systemd/system directory.
Regardless of which initialization system is being used, the init program is responsible for starting
all of the other programs and services that are required to bring the system up and make it ready for
use.
20. The /etc/init.d directory is typically used to store scripts that are used to start, stop, and
otherwise manage system services on a Linux system that is using the System V init initialization
system. These scripts are typically shell scripts that are executed by the init program as it starts up
the system and brings it to a fully operational state.