0% found this document useful (0 votes)
2 views9 pages

Linux

Linux is an open-source operating system developed as a free alternative to Unix, featuring multitasking, multi-user support, and a layered architecture consisting of hardware, kernel, shell, applications, and utilities. It allows interaction through internal commands (built into the shell) and external commands (stored as executable files), with various commands available for file management and system operations. Key commands include 'cd' for changing directories, 'ls' for listing files, and 'rm' for removing files, among others.

Uploaded by

impu1616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views9 pages

Linux

Linux is an open-source operating system developed as a free alternative to Unix, featuring multitasking, multi-user support, and a layered architecture consisting of hardware, kernel, shell, applications, and utilities. It allows interaction through internal commands (built into the shell) and external commands (stored as executable files), with various commands available for file management and system operations. Key commands include 'cd' for changing directories, 'ls' for listing files, and 'rm' for removing files, among others.

Uploaded by

impu1616
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Introduction to Linux.

• Unix is a powerful operation system that supports multiple users and multitasking.
• It was developed in the late 1960’s at Bell labs by Ken Thompson, Dennis Ritchie.
• Linux was created as a free and open alternative to Unix.
It was developed by Linus Torvolds in 1991
• Define Linux?
• Linux is an open source OS that is based on Unix Architecture. It is free to use,
modify & distribute. It was developed by Linus Torvolds in 1991.
Features of Linux.
• 1. Open Source
• 2. Multitasking
• 3. Multi user support
• 4. Portability
• 5. File system Support.
• 6. Linux provides both CLI & GUI
• 7.Shell and scripting support
Architecture of Linux.

• Linux follows a layered architecture.


• It mainly consists of 4 layers:
1.Hardware layer
2.Kernel
3.Shell
4.Applications
5.Utilities
• Hardware layer − Hardware consists of all peripheral devices (RAM/ HDD/ CPU
etc).
• Linux interacts directly with the hardware through the Kernel.
• Kernel − It is the core component of Linux Operating System.
• interacts directly with hardware
• Provides low level services to upper layer components.
• It creates a bridge between Hardware & software.
• Shell − The shell acts as an interface between user and Kernel.
• The shell takes commands from the user and converts them into system calls that
the Kernel understands.
• The Shell allows the users to interact with the system using CLI & GUI.
• Types Of Shells:
• Bash(Bourne Again Shell).
• Sh(Bourne Shell)
• C Shell (csh)
• Korn Shell(ksh)
• Z Shell(zsh)
• Applications: Applications are software programs that run on top of the linux
system.
• These includes web browsers, media players & other user programs
• Applications interact with the shell & Kernel to access system resources.
• Utilities − These are system tools that help users manage & control linux
operations
• Internal and External Commands in Linux 1.
• Introduction to Linux Commands.
• Linux commands are used to interact with the operating system via the terminal.
• These commands are categorized into: - Internal Commands (Built-in Commands)

• External Commands
• Internal Commands Definition: Internal commands are built into the shell (e.g.,
Bash). These commands are executed directly by the shell.
• Features: - Stored in the shell's memory.
• Do not require separate executable files.
• Faster execution compared to external commands.
• Ex : $type cd
• cd is a shell builtin
• //specifying that cd is internal type//

• Examples of Internal Commands: -


• cd: Change directory –
• pwd: Print current working directory –
• echo: Display a message or variable value –
• set: Set shell variables –
• exit: Close the terminal session –
• alias: Create shortcuts for commands –
• history: Show command history

• 3. External Commands Definition: External commands are stored as separate


executable files in directories like /bin, /usr/bin, and /sbin.
• Features: - Require an executable file.
• Can be customized or replaced. –
• Slower execution compared to internal commands.
• Ex : $type cat
• cat is /bin/cat
• //specifying that cat is external type//
• Examples of External Commands: -
• ls: List files and directories –
• grep: Search for a pattern in files –
• find: Search for files in a directory –
• cp: Copy files and directories
• chmod: Change file permissions
4. How to Identify Internal and External Commands –
• Use the "type" command: `type cd`, `type ls` -
• Use the "which" command for external commands: `which ls`
• Check the "help" command for internal commands: `help cd`

5. Difference Between Internal and External Commands

Linux Command: These are the simple text instructions used to control the computer
through CLI.
Special Characters in command: Special characters in linux are used to modify
command behavior & enhance functionality.
Some common special characters include.

Feature Internal Commands External Commands

1. Location Built into the shell Stored in system directories

2. Execution Speed Faster Slower

3. Dependency No external files required Needs separate executable files

4. Example Commands cd, pwd, echo ls, grep, cp


• 1. cd (Change Directory):
• Used to navigate to different directories within the file system.
• Example: cd Documents moves to the "Documents" directory.
• cd .. moves to the parent directory.
• cd ~ or cd alone returns you to your home directory.
• cd - takes you back to the previous directory.
• 2. ls (List Directory):
• Displays the contents of a directory, including files and subdirectories.
• Example: ls lists the contents of the current directory.
• ls -l provides a long listing format with detailed information.
• ls -a displays hidden files and directories (those starting with ".").
• 3. mkdir (Make Directory):
• Creates a new directory and Example: mkdir new_directory creates a directory
named "new_directory".
• 4. rmdir (Remove Directory):
• Removes an empty directory.
• Example: rmdir empty_directory removes the "empty_directory" if it's empty.

• 7. mv (Move/Rename):
• Moves files or directories, or renames them.
• Example: mv old_name.txt new_name.txt renames a file.
• mv file.txt new_directory moves the file to a different location.
• 8. rm (Remove):
• Deletes files or directories.
• Caution: rm can permanently delete files and directories, so use it with care.
• Example: rm file.txt deletes the file "file.txt".
File Related commands.
• These commands allows users to create, view, modify, copy, move, delete &
manage files efficiently.
• ls: Lists the contents of the current directory in a short format.
• ls [directory]: Lists the contents of the specified directory.
• ls -a: Lists all files and directories, including hidden ones (those starting with a
".").
• ls -l: Lists files and directories in a long format, providing detailed information
like permissions, owner, size, and modification time.
• ls -R: Lists the contents of a directory recursively, including all subdirectories and
their contents.
• ls -t: Lists files and directories in order of last modified time.
• ls -h: Displays file sizes in human-readable format (e.g., KB, MB, GB).

Cat- Command,
• The cat command in Linux is used to read, concatenate,& displays the content of
files.
cp-Copying Files and Directories.

Command Description

Cp file1.txt file2.txt Copies a file to a new


location

Cp file.txt /home/user/documents/ Copies a file into a


directory

mv-Renaming & Moving Files or Directories.

Command Description

mv file1.txt file2.txt Renames a file

mv file.txt /home/user/Documents/ Moves a file into directory

rm- Removing files and Directories.

Command Description

rm file.txt Deletes a single file

rm * Deletes all files in the current directory


wc-Counting Words,Lines,Characters & Bytes.
• wc command in linux is used to count the number of lines,words,characters &
bytes in a file.

You might also like