Unit - 1 Software Engineer Notes
Unit - 1 Software Engineer Notes
History:
Linux is an open-source operating system that was first created by Linus Torvalds
in 1991 while he was a student at the University of Helsinki in Finland. Torvalds
was interested in creating an operating system that was free and could be
customized by anyone, so he decided to create his own. Linux was originally
based on the Unix operating system and was released under the GNU General
Public License, which means that it is free to use and distribute. Since then, Linux
has become one of the most popular operating systems in the world, with millions
of users and developers working on it.
Architecture:
o Monolithic Kernel
o Micro kernels
o Exo kernels
o Hybrid kernels
5. Shell: It is an interface among the kernel and user. It can afford the services of
kernel. It can take commands through the user and runs the functions of the
kernel. The shell is available in distinct types of OSes. These operating systems
are categorized into two different types, which are the graphical
shells and command-line shells.
The graphical line shells facilitate the graphical user interface, while the
command line shells facilitate the command line interface. Thus, both of these
shells implement operations. However, the graphical user interface shells work
slower as compared to the command-line interface shells.
Features:
Linux is known for its many features and benefits, including:
1. Open-source: Linux is an open-source operating system, which means that
the source code is freely available to anyone who wants to use, modify, or
distribute it.
2. Customizable: Linux can be customized to suit the needs of the user or
organization. Users can choose from a wide range of software packages
and desktop environments to create their own unique Linux distribution.
3. Security: Linux is known for its strong security features, including access
control, encryption, and firewall support.
4. Stability: Linux is known for its stability and reliability. It is commonly
used in servers and other mission-critical systems where downtime is not
an option.
5. Compatibility: Linux supports a wide range of hardware platforms,
including desktops, servers, embedded systems, and mobile devices.
6. Performance: Linux is known for its high performance, especially in multi-
tasking and multi-user environments.
7. Community support: Linux has a large and active community of users and
developers who contribute to the development of the operating system and
provide support to other users.
Sudo :
The sudo command in Linux stands for "Superuser Do" and is used to execute
commands with administrative or root privileges.
When a command is executed with sudo, it runs with elevated permissions that
allow it to modify system files, directories, and other resources that are normally
restricted to regular users. This is useful for performing system maintenance tasks
or installing software that requires administrative privileges.
The basic syntax of the sudo command is:
sudo [options] [command]
Here, options can be used to specify additional arguments and command is the
command that you want to execute with elevated privileges.
Some common options used with sudo include:
-u : Run the command as a different user.
-s : Run the shell specified by the SHELL environment variable or the shell
specified by the sudoers file.
-i : Run the command with a clean environment.
-H : Set the HOME environment variable to the target user's home directory.
Note that sudo requires the user to enter their own password to confirm their
identity before executing the command with elevated privileges. The specific
requirements for using sudo can be configured in the /etc/sudoers file.
Using sudo can be dangerous, as it allows users to modify critical system files
and resources. As such, it should only be used by experienced users who
understand the risks involved.
To change a terminal setting, you would use the appropriate stty option followed
by the desired value. For example, to turn off terminal echo, you would use the
following command: stty -echo
This would disable echoing of input characters to the screen.
The stty command can be useful for configuring terminal settings for specific use
cases or troubleshooting terminal-related issues.
The umount command is a powerful tool for managing file systems in Linux. It
allows you to unmount file systems as needed, and to specify additional options
to control how the file system is unmounted.
To search for the word "apple" in the file, we can use the following command:
grep apple example.txt
This will output: apple
To search for the word "berry" in the file, ignoring case sensitivity, we can use the -i
option:
grep -i berry example.txt
This will output: elderberry
To search for the word "berry" in the file, showing the line numbers of the matching
lines, we can use the -n option:
grep -n berry example.txt
This will output: 5:elderberry
To search for the word "berry" in all files within a directory and its subdirectories
recursively, we can use the -r option:
grep -r berry /path/to/directory
This will output all matching lines in all files within the directory and its subdirectories.
The join command in Linux is used to combine two files on the basis of a
common field or key. It is used to join lines from two files on a specified field,
which must be present in both files. The join command assumes that the input
files are sorted on the join field.
Once you open a file in pg, you can use the following commands to navigate
through the file:
Press the spacebar to move forward one page.
Press the Enter key to move forward one line.
Press the b key to move backward one page.
Press the q key to quit the pg command.