Notes
Notes
Notes
Evolution of Linux OS
The Linux OS
was developed by Linus Torvalds in 1991, which sprouted as an idea to improve the UNIX
OS. He suggested improvements but was rejected by UNIX designers. Therefore, he thought of
launching an OS, designed in a way that could be modified by its users.
2) System Libraries
System libraries are special programs that help in accessing the kernel's features. A kernel has to
be triggered to perform a task, and this triggering is done by the applications. But applications
must know how to place a system call because each kernel has a different set of system calls.
Programmers have developed a standard library of procedures to communicate with the kernel.
Each operating system supports these standards, and then these are transferred to system calls for
that operating system.
The most well-known system library for Linux is Glibc (GNU C library).
3) System Tools
Linux OS has a set of utility tools, which are usually simple commands. It is a software which
GNU project has written and publish under their open source license so that software is freely
available to everyone.
With the help of commands, you can access your files, edit and manipulate data in your
directories or files, change the location of files, or anything.
4) Development Tools
With the above three components, your OS is running and working.
But to update your system, you have additional tools and libraries.
These additional tools and libraries are written by the programmers
and are called toolchain. A toolchain is a vital development tool used
by the developers to produce a working application.
5) End User Tools
These end tools make a system unique for a user. End tools are not
required for the operating system but are necessary for a user.
Some examples of end tools are graphic design tools, office suites,
browsers, multimedia players,
What is Bash?
BASH is an acronym for Bourne Again Shell, a punning name, which is a tribute to Bourne
Shell (i.e., invented by Steven Bourne).
Bash is a shell program written by Brian Fox as an upgraded version of Bourne Shell
program 'sh'. It is an open source GNU project. It was released in 1989 as one of the most
popular shell distribution of GNU/Linux operating systems. It provides functional
improvements over Bourne Shell for both programming and interactive uses. It includes
command line editing, key bindings, command history with unlimited size, etc.
In basic terms, Bash is a command line interpreter that typically runs in a text window
where user can interpret commands to carry out various actions. The combination of these
commands as a series within a file is known as a Shell Script. Bash can read and execute
the commands from a Shell Script.
Bash is the default login shell for most Linux distributions and Apple's mac OS. It is also
accessible for Windows 10 with a version and default user shell in Solaris 11.
Command shortcuts
similar in other shells, but be aware there could be subtle
differences.
1. Tab
Tab is my ultimate friend - it never lets me down. It is the
handiest shortcut and time saver ever developed. It
autocompletes commands, file names, or directory names for
you. Simply start typing a command, file name, or directory
name, and then press the Tab key. The system will either
complete the string or display all available options to you.
2. Ctrl+C
Ctrl+C is a well-known shortcut that I use all the time. It
cleanly aborts most programs by sending the SIGINT signal to
the program that I want to interrupt and abort. Most programs
correctly catch it and exit cleanly. If the program does not
specify how to handle SIGINT, the underlying processes are
then self-terminated. Yes, it's safe to use.
3. Ctrl+R/O/G
I find this combination (reverse-i-search) very useful when
searching through my command history. I can bring up
commands that I used previously, navigate through them, and
repeat the command I need. This is very helpful with long and
chained commands.
• Ctrl+R: Recall the last command matching the characters
you provide.
• Ctrl+R (again): Navigate through the matching
commands.
• Ctrl+O: Send the command back to your terminal or
select Enter to execute the command from the search
mode.
• Ctrl+G: Leave the history search mode without running a
command.
4. Ctrl+L
This shortcut is equivalent to the clear command. It clears
your terminal screen.
5. Ctrl+D
This shortcut will effectively log you out of any terminal and
close it, or get you back to the original user when used
after su or sudo commands. It sends an EOF (End-of-file)
marker to bash. Bash exits when it receives this marker. This
shortcut is similar to running the exit command.
6. Ctrl+Alt+D
This shortcut will minimize all terminals/windows and show
your desktop. Repeat it to revert your windows back in the
same order.
7. Ctrl+U
This shortcut erases everything from the current cursor
position to the beginning of the line. I find this useful when I
mistype a command or see a syntax error and prefer to start
over. It's a very handy shortcut.
8. Ctrl+Z
This shortcut is useful if you need to get the terminal back
while working on something. It sends the SIGTSTP signal to
the foreground process. For example, you are working in a
text editor and need to break out to find some data. You can
use this shortcut to suspend and send the editor to the
background, do your other task, and then run fg to get back
into your application.
9. Ctrl+A
Move the cursor to the beginning of the line. Very handy when
you need that little flag added to the beginning of your 200
characters chained-command. I use this instead of the arrow
keys to save time.
10. Ctrl+E
This shortcut does the opposite of Ctrl+A. It moves the cursor
to the end of the line. I always use the Ctrl+A and Ctrl+E
shortcuts to quickly move my cursor around the current line
while typing long or chained commands.
• Every single file and directory starts from the root directory
• The only root user has the right to write under this directory
• /root is the root user’s home directory, which is not the same
as /
2. /bin : Essential command binaries that need to be available in
single-user mode; for all users, e.g., cat, ls, cp.
1. Files Listing
It returns the detailed listing of the files and directories in the current
directory. The command gives os the owner of the file and even which
file could be managed by which user or group and which user/group has
the right to access or execute which file.
2. Creating Files
touch command can be used to create a new file. It will create and open
a new blank file if the file with a filename does not exist. And in case the
file already exists then the file will not be affected.
$touch filename
3. Displaying File Contents
4. Copying a File
cp command could be used to create the copy of a file. It will create the
new file in destination with the same name and content as that of the file
‘filename’.
$cp source/filename destination/
5. Moving a File
mv command could be used to move a file from source to destination. It
will remove the file filename from the source folder and would be
creating a file with the same name and content in the destination folder.
$mv source/filename destination/
6. Renaming a File
7. Deleting a File
$rm filename