Practical 1 - 9 COM 115
Practical 1 - 9 COM 115
c. Job accounting:
Operating system Keeps track of time and resources used by various tasks and users, this information
can be used to track resource usage for a particular user or group of users.
f. Memory Management:
The operating system manages the Primary Memory or Main Memory. Main memory is made up of a
large array of bytes or words where each byte or word is assigned a certain address. Main memory is
fast storage and it can be accessed directly by the CPU. For a program to be executed, it should be
first loaded in the main memory. An Operating System performs the following activities for memory
management.
Apple iOS:
Apple iOS from Apple is used on smartphones and tablets manufactured by the same company. Users of this
system have access to hundreds of applications. The operating system offers strong encryption capabilities to
control unauthorized access to users' private data.\
Apple macOS:
Developed by Apple, this proprietary operating system runs on the manufacturer's personal computers and
desktops. All Apple and Macintosh computers come equipped with the latest version of macOS, previously
known as OS X systems. The ability to prevent bugs and fend off hackers make Apple operating systems
popular with their users.
NAME: KOMOLAFE JOSEPH OLUWATOYIN
MATRIC NO: F/ND/22/3210026
COURSE: INTRODUCTION TO LINUX OPERATING SYSTEM (PRACTICAL)
COURSE CODE: COM 111
b. Security
On default, Linux is designed to be secure. Unlike Windows, Linux is not much exposed to viruses. On
very rare occasions, Linux is virus affected. That is the reason why Linux users do not normally install an
Antivirus software. And also hackers are not very interested in Linux due to its low market share. Even if it
is, they cannot easily hijack the system since there are locks on each layers.
c. Source Code
Linux is an operating system which is of open source base. Which means that the code is free to
modify. Users can easily change the code based on their needs. Thus, you can customize your own
personal operating system. However, you will need to have the appropriate programming knowledge.
d. System Requirements
Linux OS can even run on systems with low specifications. It is not very resource intensive like windows
operating system. All the components like memory, diskspace and CPU are lower in this OS. So you do not
need to upgrade your existing hardware for existing hardware for installing this OS. This is a fact that
makes Linux a greater choice for all systems.
b. Software Compatibility
Popular applications which are made for Windows and Mac are not available for Linux. Many
developers are not interested in making softwares for Linux due to its small market value. Some of such
softwares are MS Office, iTunes and Photoshop. Even though there are alternatives to these softwares,
they cannot match up to the original level.
c. Gaming
Similar to sofwares, games too doesn't natively support Linux. Because Linux is not a platform which is
not widely used, gaming developers are not much interested in Linux. So you cannot expect your favorite
game to run on Linux. However, the number of games developed for Linux is on a rise in the recent years.
Al though you can use third party softwares like Steam to download any gaming title, still the game will not
run smoothly as it does on native operating system.
d. Hardware Compatibility
Almost all the hardware’s can be connected to a Linux operating system. But the problem comes with the
drivers. The concept of drivers in Linux is very different from other operating system. The drivers here are
inbuilt inside the Kernel. Since the drivers are already preinstalled, the newly connected hardware device
may not have the proper drivers. This makes the connected hardware device to be incompatible.
2. What kinds of Linux are there and how do you choose the one that fits the you?
a. Debian
Debian is renowned for being a mother to popular Linux distributions such as Deepin, Ubuntu, and
Mint which have provided solid performance, stability, and unparalleled user experience. The latest stable
release is Debian 10.5, an update of Debian 10 colloquially known as Debian Buster.
b. Gentoo
Gentoo is a distro built for professional use and experts who take into consideration what packages
they are working with from the word go. This category includes developers, system & network
administrators. As such, it’s not ideal for beginners in Linux. Gentoo comes recommended for those who
want to have a deeper understanding of the ins and outs of the Linux operating system.
c. Ubuntu
Created and maintained by Canonical, Ubuntu is one of the most popular Linux distros enjoyed across
the globe by beginners, intermediate users, and professionals alike. Ubuntu was specifically designed for
beginners in Linux or those transitioning from mac and Windows.
Choosing the linux os that suits you, you should take into consideration how strong your pc is. Its also
advisable to pick the most user friendly linux os for easy understanding.
GNU movements?
GNU is a Unix-like operating system. That means it is a collection of many programs: applications,
libraries, developer tools, even games. The development of GNU, started in January 1984, is known as the
GNU Project. Many of the programs in GNU are released under the auspices of the GNU Project; those we
call GNU packages.
The name “GNU” is a recursive acronym for “GNU's Not Unix.” “GNU” is pronounced g'noo, as one syllable,
like saying “grew” but replacing the r with n.
The program in a Unix-like system that allocates machine resources and talks to the hardware is called the
“kernel”. GNU is typically used with a kernel called Linux. This combination is the GNU/Linux operating
system. GNU/Linux is used by millions, though many call it “Linux” by mistake.
GNU's own kernel, the GNU Hurd, was started in 1990 (before Linux was started). Volunteers continue
developing the Hurd because it is an interesting technical project.
NAME: KOMOLAFE JOSEPH OLUWATOYIN
MATRIC NO: F/ND/22/3210026
COURSE: INTRODUCTION TO LINUX OPERATING SYSTEM (PRACTICAL)
COURSE CODE: COM 111
The following command lines can be used to connect and disconnect depending on the Wireless card, wireless
security and wireless router settings. Before proceeding, make sure the network service is enabled (For cases
where you might start Ubuntu using Recovery mode): Depending on your Ubuntu Version, you would need to
start it using one of the following way:
2. iwlist wlan0 s
(The s is for Scan. wlan0 is my wireless card but could be different for each user. Some have eth0, others
wlan2.. You need sudo to execute this option.To find out the name of your wireless card simply type iwlist
and press TAB. This should autocomplete the line with the network card's name. You can also
type iwconfig and find the name on the list that will show.)
If you do not know the name of your wireless devices type: iwconfig which will show you your
wired/wireless devices and their names. They might be something like wlan0, wlan1, eth1, eth2..
3. The lookup will show you all possible Access Points (AP) visible to you. After you see your router in the list
try to connect to it:
$ file -v
file-5.33
magic file from /etc/magic:/usr/share/misc/magic
1. The simplest file command is as follows where you just provide a file whose type you want to find out.
$ file etc
$ file -f files.list
4. The -s option causes file to also read block or character special files, for example.
$ file -s /dev/sda
$ file -z backup
Determine
Compressed Files
3. Describe how to find help in Linux environment
What is a Shell?
It refers to a special user program or an environment that provides a user with an interface for using the
services of the operating system. A shell executes various programs on the basis of the input that a user
provides.
What is a Kernel?
A kernel is basically the core and the heart of an OS (Operating system). It functions to manage the operations
of the hardware and the computer. A kernel basically acts as a bridge between any user and the various
resources offered by a system by accessing the various resources of a computer, such as the I/O devices, CPU,
and various other resources.
Parameters Shell
Basics A shell is basically an interface present between the kernel and the user.
Uses and A shell allows all of its users to establish communication with the kernel.
Purpose
Types Korn Shell, C Shell, Bourne Shell, etc., are types of shells.
Functions We can use shell commands such as mkdir, ls, and many more for requesting the completion of the
operating system (OS).
Layer of OS The shell forms the outer layer of the operating system.
Head
Sometimes the information needed is in the first lines of a file. In that case, use the head command to view
the first ten lines of a file in Linux. For example, users can display basic information about the CPU used by
viewing the beginning of the /proc/cpuinfo file.
Like the tail command, use the -n flag with the head command to display the desired number of lines, starting
from the beginning of a given file. For example, head -5 shows the first five lines of a given file.
Tail
While the cat command is helpful when dealing with a small file, it is not the best way to view large log files.
The tail command allows viewing the last ten lines of a file by default instead of filling your terminal window
with a wall of text, making it the perfect command to use if you want to check the last log entries.
Here is the output of the tail command.
3. What are the properties of file and describe how to change file permissions
ls -lah
In the output example above, the first character in each line indicates whether the listed object is a file or a
directory. Directories are indicated by a (d); the absence of a d at the beginning of the first line indicates
that myfile.txt is a regular file.
Note the multiple instances of r, w, and x. These are grouped into three sets that represent different levels of
ownership:
Owner or user permissions: After the directory (d) slot, the first set of three characters indicate permission
settings for the owner (also known as the user).
In the example -rw-r--r--, the owner permissions are rw-, indicating that the owner can read and write to the
file but can't execute it as a program.
In the example drwxr-xr-x, the owner permissions are rwx, indicating that the owner can view, modify, and
enter the directory.
Group permissions: The second rwx set indicates the group permissions. In the fourth column of the example
above, group1 is the group name.
In the example -rw-r--r--, group members can only read the file.
In the example drwxr-xr-x, group members can view as well as enter the directory.
Other permissions: The final rwx set is for "other" (sometimes referred to as "world"). This is anyone outside
the group. In both examples above, these are set to the same permissions as the group.
Change file permissions
To change file and directory permissions, use the command chmod (change mode). The owner of a file can
change the permissions for user (u), group (g), or others (o) by adding (+) or subtracting (-) the read, write, and
execute permissions.
There are two basic ways of using chmod to change file permissions: The symbolic method and the absolute
form.
Multiuser
A multi-user operating system is an operating system that permits several users to access a single system
running to a single operating system. These systems are frequently quite complex, and they must manage the
tasks that the various users connected to them require. Users will usually sit at terminals or computers
connected to the system via a network and other system machines like printers. A multi-user operating system
varies from a connected single-user operating system in that each user accesses the same operating system
from different machines.
Multitasking in Linux
Today most major operating systems employ multitasking. Earlier versions of the Macintosh and Microsoft
Windows used cooperative multitasking. Preemptive multitasking operating systems include Linux and
other Unix-like systems, Microsoft Windows NT/2000/XP, Mac OS X and OS/2.
Unix-like operating systems were developed right from the start as preemptive multitasking and multi-user
systems. These are among the features that have helped make them an extremely efficient and robust (as well
as highly successful and long-lived) family of operating systems. (They are also multiprocessor operating
systems, which means that they can make effective use of computers that have more than a single CPU.)
A signal is one of the basic things you would have frequently encountered once you start getting familiar with a
Linux system. Getting to know about how they work is important since signals play a big role in processes.As
usual, we will start off with some basics and then move on to some advanced topics.A signal is a notification to
a process that an event has occurred. Signals are sometimes described as software interrupts, because in most
cases, they interrupt the normal flow of execution of a program and their arrival is unpredictable.A signal can
be sent by Kernel or a Process.
Different ways for the reception of a signal
For the rest of the article, we will focus on signals sent by the Kernel and not by processes.
1. When a hardware exception has occurred and that exception needs to be notified to the process. For eg.
Attempting division by zero, or referencing the part of memory that is inaccessible.
2. Some software event occurred outside the process’s control but effects the process. For instance, input
became available on a file descriptor, the terminal window got resized, process’s CPU time limit exceeded,
etc.
3. User typed some terminal special characters like interrupt(Ctrl+C) or suspend character(Ctrl+Z).
The signals sent by the Kernel to notify processes about events are called traditional signals.
3. Explain the process of system startup and shutdown in Linux operating system
1. Make sure all cables (such as power, display monitor cable, and keyboard) are properly connected. See
your owner's guide and hardware guide for complete information about cabling your particular
workstation or server.
2. Turn on the power switches on the display monitor (or console terminal) and the computer.
The computer runs power-on diagnostics and displays some copyright messages and some system
startup information. These messages appear on the console screen or on the screen of a diagnostics
terminal (an ASCII terminal connected to the first serial port) of a server. A copy of these messages is
also written to the /var/adm/SYSLOG file in case you miss them.
This section describes how to turn off a workstation or server from multiuser or single-user mode.
1. Use the who(1) command to determine which users are logged in to the operating system, if any:
Notify any users that the system is shutting down. Issue the /etc/wall(1M) command:
wall
2. When you finish entering your message, type <Ctrl-D>. The message is sent to all users on the system.
They see something like this:
The above command specifies a 10 minute (600 second) grace period to allow users to clean up and log
off. The other flags indicate that the system is to be completely shut down (-i0) and that the system
can assume that all answers to any prompts regarding the shutdown are ``yes.'' You see the following
message:
The Command Monitor prompt or System Maintenance menu appears. Wait for a Command Monitor
prompt or System Maintenance menu to appear before turning off power to the workstation or you
may damage your hard disk.
For more information on shutting down the system, see the halt(1M) and shutdown(1M) reference pages.
Remember that you should shut down the system only when something is wrong or if modifications to the
software or hardware are necessary.
Use the STDOUT redirection operator > for redirecting the output to a file like this:
The example below demonstrates it better. It first saves the output of ls -l command. And then later, it
replaces the content of the file with the output of ls *.c command.
Basically, 0 stands for standard input, 1 for standard output and 2 for standard error. Here, you are redirecting
(>) standard error (2) to same address (&) as standard output (1).
0 seconds of 30 secondsVolume 0%
Let us start with echo.
Echo is a command used to output a string or multiple strings as arguments. Echo is available n all Linux
distributions, making it a good tool for redirecting output to a file.
Let us start by verifying the file is not empty.
cat multiple.tx
As shown in the output above, the file is not empty; it contains lines of text.
To add multiple lines to a file with echo, use the -e option and separate each line with \n.
When you use the -e option, it tells echo to evaluate backslash characters such as \n for new line.
cat multiple.txt
The printf
Let us now look at printf. Using the printf command is very similar to the echo command. To append multiple
lines with printf command:
cat multiple.txt
NAME: KOMOLAFE JOSEPH OLUWATOYIN
MATRIC NO: F/ND/22/3210026
COURSE: INTRODUCTION TO LINUX OPERATING SYSTEM (PRACTICAL)
COURSE CODE: COM 111
commands that configure the shell, define command aliases and set
user logs into a shell, along with .bashrc. The .bash_logout file is
cleanup operations and other commands that you want the shell to execute
commands that clear the screen and print a farewell message. Unlike the
clear the screen and print a reminder to the user to take her diskette
clear
echo "don't forget to remove your homework exercises diskette from the
diskette drive!"
OTHER SHELLS
of .bash_logout. The PDKSH shell uses the .profile and .kshrc files for
Despite its ability to run as a self-contained app, an AppImage usually offers to do some soft system
integration.
If you accept this offer, a local .desktop file is installed to your home directory. A .desktop file is a small
configuration file used by the Applications menu and mimetype system of a Linux desktop. Essentially, placing
the desktop config file in your home directory's application list "installs" the application without actually
installing it. You get all the benefits of having installed something, and the benefits of being able to run
something locally, as a "portable app."
Application directory
Sometimes, a developer just compiles an application and posts the result as a download, with no install script
and no packaging. Usually, this means that you download a TAR file, extract it, and then double-click the
executable file (it's usually the one with the name of the software you downloaded)
When presented with this style of software delivery, you can either leave it where you downloaded it and
launch it manually when you need it, or you can do a quick and dirty install yourself. This involves two simple
steps:
1. Save the directory to a standard location and launch it manually when you need it.
2. Save the directory to a standard location and create a .desktop file to integrate it into your system.
If you're just installing applications for yourself, it's traditional to keep a bin directory (short for "binary") in
your home directory as a storage location for locally installed applications and scripts. If you have other users
on your system who need access to the applications, it's traditional to place the binaries in /opt. Ultimately,
it's up to you where you store the application.
Downloads often come in directories with versioned names, such as twine_2.13 or pcgen-v6.07.04. Since it's
reasonable to assume you'll update the application at some point, it's a good idea to either remove the
version number or to create a symlink to the directory. This way, the launcher that you create for the
application can remain the same, even though you update the application itself.
To create a .desktop launcher file, open a text editor and create a file called twine.desktop. The Desktop Entry
Specification is defined by FreeDesktop.org. Here is a simple launcher for a game development IDE called
Twine, installed to the system-wide /opt directory:
[Desktop Entry]
Encoding=UTF-8
Name=Twine
GenericName=Twine
Comment=Twine
Exec=/opt/twine/Twine
Icon=/usr/share/icons/oxygen/64x64/categories/applications-games.png
Terminal=false
Type=Application
Categories=Development;IDE;
The tricky line is the Exec line. It must contain a valid command to start the application. Usually, it's just the
full path to the thing you downloaded, but in some cases, it's something more complex. For example, a Java
application might need to be launched as an argument to Java itself:
Sometimes, a project includes a wrapper script that you can run so you don't have to figure out the right
command:
Exec=/opt/foo/foo-launcher.sh
In the Twine example, there's no icon bundled with the download, so the example .desktop file assigns a
generic gaming icon that shipped with the KDE desktop. You can use workarounds like that, but if you're more
artistic, you can just create your own icon, or you can search the Internet for a good icon. As long as
the Icon line points to a valid PNG or SVG file, your application will inherit the icon.
The example script also sets the application category primarily to Development, so in KDE, GNOME, and most
other Application menus, Twine appears under the Development category.
To get this example to appear in an Application menu, place the twine.desktop file into one of two places:
Place it in ~/.local/share/applications if you're storing the application in your own home directory.
Place it in /usr/share/applications if you're storing the application in /opt or another system-wide location
and want it to appear in all your users' Application menus.
And now the application is installed as it needs to be and integrated with the rest of your system.
Finally, there's the truly universal install format: source code. Compiling an application from source code is a
great way to learn how applications are structured, how they interact with your system, and how they can be
customized. It's by no means a push-button process, though. It requires a build environment, it usually
involves installing dependency libraries and header files, and sometimes a little bit of debugging.
$ fc-list : file
Tip:
You can also check the list of Xorg's known font paths using the command xset q.
Use /var/log/Xorg.0.log if Xorg is run with root privileges.
Keep in mind that Xorg does not search recursively through the /usr/share/fonts/ directory like Fontconfig
does. To add a path, the full path must be used:
Section "Files"
FontPath "/usr/share/fonts/local/"
EndSection
NAME: KOMOLAFE JOSEPH OLUWATOYIN
MATRIC NO: F/ND/22/3210026
COURSE: INTRODUCTION TO LINUX OPERATING SYSTEM (PRACTICAL)
COURSE CODE: COM 111
Syntax
2 -p, --prefix=STRINGReformat beginning lines with specified STRING, reattaching the prefix
to reformatted lines.
Only the most commonly used options are shown here. For other options, see thelpstat(1) man page.
-p printer-name
Shows if a printer is active or idle, when the printer was enabled or disabled, and whether the printer is
accepting print requests.
You can specify multiple printer names with this command. Use a space or a comma to separate
printer names. If you use spaces, enclose the list of printer names in quotation marks. If you don't
specify printer-name, the status of all printers is displayed.
-D
-l
-t
Shows status information about the LP print service, including the status of all printers, such as
whether they are active and whether they are accepting print requests.
The following example shows how to display the system's default printer.
$ lpstat -d
system default destination: luna
The following example shows how to display the status of the printer luna.
$ lpstat -p luna
printer luna is idle. enabled since Jul 12 11:17 2001. available.
The following example shows how to display the description of the printers asteroid and luna.
The following example shows how to display the characteristics of the printer luna.
$ lpstat -p luna -l
printer luna is idle. enabled since Thu Jul 12 15:02:32 PM PDT
Form mounted:
Content types: postscript
Printer types: PS
Description:
Connection: direct
Interface: /usr/lib/lp/model/standard
PPD: none
After fault: continue
Users allowed:
(all)
Forms allowed:
(none)
Banner not required
Character sets:
(none)
Default pitch:
Default page size: 80 wide 66 long
Default port settings:
Usb Printer
1. Make sure that the printer is connected to your system and powered on.
2. Open a terminal/console and check if the usb kernel modules are loaded:
$ lsmod | grep usb
3. Unplug the USB printer cable from your computer and enter this command:
$ tail -f /var/log/syslog
4. Reconnect the USB printer cable, you should see some messages appearing.
5. Press Ctrl-C to stop the logging.
6. Check whether the printer gets correctly detected by the USB subsystem and determine its USB
vendor/product IDs and the USB bus and device addresses:
$ lsusb
Note: The USB bus and device addresses change if you turn off or unplug the printer. Please re-run this
command if needed.
7. Check whether the device files for the printer get created and the ownerships ("root lp") and
permissions (non-HP: "crw-rw-r--", HP: "crw-rw-r--+") correctly set:
$ ls -l /dev/usb/lp* /dev/bus/usb/*/*
8. Determine the printer's device ID strings:
$ sudo usb_printerid /dev/usb/lp0
$ sudo usb_printerid /dev/usb/lp1
...
For HP printers also use
$ hp-info -i
and choose the printer with the problem from the text menu, then copy the "deviceid" entry from the
output (can be several lines).
9. For HP printers: Check that you have the latest version of HPLIP and whether HPLIP connects to them:
$ hp-makeuri <Bus>:<Device>
Replace "<Bus>" and "<Device>" by the bus and device numbers from the "lsusb" output (not vendor
and product ID). The numbers must be supplied with three digits, zero-padded from the left, like
"008:015". (More information from http://hplipopensource.com/.)
10. Find out if your printer gets detected by CUPS:
$ lpinfo -v
11. Attach the output of the above commands to the bug report.
Note that problems cannot only caused by CUPS but also by the kernel (package "linux"), libusb, HPLIP
(package "hplip"), and several third-party printer drivers.
1. Make sure that the printer is connected to your system and powered on.
2. Open a terminal/console and check if the lp, ppdev, and parport_pc kernel modules are loaded:
$ lsmod | grep lp
$ lsmod | grep ppdev
$ lsmod | grep parport_pc
3. Check if the kernel detected the parallel port during bootup:
$ dmesg | grep par
4. Check if the device files of the parallel port(s) are created and have the correct permissions and
ownerships:
$ ls -l /dev/lp* /dev/parport*
5. Check if the printer auto-detection result appears in the kernel's virtual file system:
$ ls -l /proc/sys/dev/parport/parport*/autoprobe*
$ sudo cat /proc/sys/dev/parport/parport*/autoprobe*
6. Find out if your printer gets detected by CUPS:
$ lpinfo -v
7. Run the parallel port CUPS backend separately, once with standard user privileges and once as root:
$ /usr/lib/cups/backend/parallel
$ sudo /usr/lib/cups/backend/parallel
8. Attach the output of the above commands to the bug report.
Note that problems can be caused not only by CUPS, but also by the kernel (package "linux"), HPLIP (package
"hplip"), and several third-party printer drivers.