Operating System
Section 2
• TA: Eng. Abdelrahman Mohsen
• TA: Eng. Ruba Hesham
Textbook for Linux Commands
The Linux Command Line Fifth Internet Edition
Download
Windows Vs. Linux File System
• In Microsoft Windows, files are stored in folders on different data
drives like C: D: E:
• But, in Linux, files are ordered in a tree structure starting with
the root directory.
• This root directory can be considered as the start of the file
system, and it further branches out various other subdirectories.
The root is denoted with a forward slash '/'.
Windows Linux
Windows uses different data drives Unix/Linux uses a hierarchical file
like C:, D:, E: to store files and folders. system (tree structure).
Windows has different drives like C:, There are no drives in Linux.
D:, E:.
Hard drives, CD-ROMs, and printers Peripherals like hard drives, CD-
are considered as devices. ROMs, and printers are also
considered devices in Linux/Unix.
There are 4 types of user accounts: 1) There are 3 types of user account
Windows Vs. Administrator, 2) Standard, 3) Child,
4) Guest.
types: 1) Root, 2) Standard, 3) Service
Account.
Linux File System Administrator user has all
administrative privileges of the
computer.
The root user is the superuser and
has all administrative privileges.
In Windows, you cannot have 2 files Linux file naming is case-sensitive,
with the same name in the same meaning ‘sample’ and ‘SAMPLE’ are
folder. treated as different files.
In Windows, "My Documents" is the In Linux, each user has a
default home directory. ‘/home/username’ directory, which is
the user's home directory.
Linux File
Hierarchy
Structure
Linux File Hierarchy Structure
• The Linux file system hierarchy is an organized directory structure that
defines where files and directories are stored on the system. It is
standardized under the Filesystem Hierarchy Standard (FHS), ensuring
consistency across different Linux distributions.
• The Linux file hierarchy is carefully designed to separate different types of
files and functions, ensuring the system remains organized and efficient.
• computer terminal, a device that
enables a computer to receive or
deliver data. Computer terminals
What is a vary greatly depending on the
format of the data they handle. For
terminal on example, a simple early terminal
comprised a typewriter keyboard for
a computer? input and a typewriter printing
element for alphanumeric output.
Why learn Command Line Interface?
• Comparatively, Commands offer more options & are flexible. Piping and
stdin/stdout are immensely powerful are not available in GUI
• Some configurations in GUI are up to 5 screens deep while in a CLI it's
just a single command
• Moving, renaming 1000's of the file in GUI will be time- consuming (Using
Control /Shift to select multiple files), while in CLI, using regular expressions
so can do the same task with a single command.
• CLI load fast and do not consume RAM compared to GUI.
In crunch scenarios this matters.
• Both GUI and CLI have their specific uses. For example, in GUI, performance
monitoring graphs give instant visual feedback on system health, while
seeing hundreds of lines of logs in CLI is an eyesore.
• A program that interprets commands
• Allows a user to execute commands by
What is typing them manually at a terminal, or
automatically in programs called shell
scripts.
the Shell ? • A shell is not an operating system. It is a
way to interface with the operating
system and run commands.
•Terminal: The window where you
type commands.
Difference •Shell: The program that
understands and processes those
commands.
What is BASH ?
• BASH = Bourne Again Shell
• Bash is a shell written as a free replacement to the standard
Bourne Shell (/bin/sh) originally written by Steve Bourne for
UNIX systems.
• It has all of the features of the original Bourne Shell, plus
additions that make it easier to program with and use from
the command line.
• Since it is Free Software, it has been adopted as
• the default shell on most Linux systems.
Components of Ubuntu
Components of Ubuntu
Launching the Terminal on Ubuntu
• There are 2 ways to launch the
terminal.
• 1) Go to the Dash and type terminal
• 2) Or you can press CTRL + Alt + T to
launch the Terminal
Content of Ubuntu terminal
Computer/machine name Separator
Represents
Username regular
user
Home directory
Root user
• To become root user type: sudo -i. sudo -s.
• Note: If the last character of the prompt is a pound sign (“#”) rather
than a dollar sign, the terminal session has superuser privileges. This
means either we are logged in as the root user or we selected a terminal
emulator that provides supe ruser (administrative) privileges
Switch to user
• To become return to regular user type: su username.
How is BASH different from the DOS command prompt?
Case Sensitivity
• In Linux/UNIX, commands and filenames are case sensitive,
meaning that typing “EXIT” instead of the proper “exit” is a
mistake.
• “\” vs. “/”
• In DOS, the forward-slash “/” is the command argument
delimiter, while the backslash “\” is a directory separator.
• In Linux/UNIX, the “/” is the directory separator, and the
“\” is an escape character. More about these special
characters in a minute!
How is BASH different from the DOS command prompt?
Ctrl+Alt+F
1
Virtual Ctrl + Alt + F (1 to 6)
key
Terminals
You can navigate between the 6 virtual
terminals using the following
command.
To return to the home screen of the
Linux system, use Ctrl+Alt+F7 and it
would take to you the terminal
date
Try a few cal
commands
df
free
date command
which displays the current time and date.
cal command which displays a calendar of the current month.
df command
To see the current amount of free space on our disk drives, enter df.
free command
to display the amount of free memory, enter the free
command.
exit command/Ending a Terminal Session
We can end a terminal session by either closing the
terminal emulator window, by enter ing the exit
command at the shell prompt, or pressing Ctrl-d.
Any
Questions?