0% found this document useful (0 votes)
17 views

BIO 401 Note... Introduction To Linux

Linux Biochemistry
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

BIO 401 Note... Introduction To Linux

Linux Biochemistry
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Introduction to Linux

What is Linux?
 Definition: Linux is an open-source, Unix-like operating system based on the Linux
kernel, developed by Linus Torvalds in 1991.
 Kernel vs. Operating System:
o Kernel: The core part of Linux, managing hardware resources and
communication between hardware and software.
o Operating System (OS): Linux distributions include the kernel, applications, and
system utilities to form a complete OS.
 Characteristics:
o Open-Source: Free to use, modify, and distribute. Encourages collaborative
development.
o Multitasking & Multi-user: Allows multiple users and applications to run
simultaneously.
o Portability: Runs on various hardware platforms (PCs, servers, smartphones,
embedded devices).

Brief History of Linux


 Unix Origins: Developed in the 1960s at AT&T Bell Labs as a multi-user, multitasking
OS for mainframes.
 GNU Project: Started by Richard Stallman in 1983 to develop a free Unix-like OS (GNU
stands for "GNU's Not Unix").
 Linux Kernel: In 1991, Linus Torvalds developed the Linux kernel and released it under
the GNU General Public License (GPL).
 Growth of Distributions: Many distributions (distros) have emerged since the 1990s,
like Ubuntu, Fedora, Debian, and CentOS, each serving different user needs.

Linux Distributions
 Popular Distributions:
o Ubuntu: User-friendly, popular for desktops and beginners.
o Debian: Stable, secure, preferred for servers.
o Fedora: Often cutting-edge, developed by Red Hat, with a focus on new features.
o CentOS: Enterprise-grade, free version of Red Hat Enterprise Linux (RHEL).
o Arch Linux: Minimalist, ideal for advanced users.
 Components of a Distribution:
o Kernel: Core of the OS.
o Shell: Interface for executing commands (e.g., Bash, Zsh).
o Package Manager: Manages installation, updating, and removal of software
(e.g., apt for Debian/Ubuntu, yum for RHEL/CentOS).
o Desktop Environment (Optional): For graphical user interface (GUI), e.g.,
GNOME, KDE, XFCE.

Linux System Architecture


 User Space vs. Kernel Space:
o Kernel Space: Manages hardware and system-level functions.
o User Space: Applications and utilities that interact with the kernel.
 Major Components:
o Kernel: Handles process management, memory management, device drivers,
system calls, and security.
o System Libraries: Provide essential functionality to applications, linking
programs with kernel functions.
o Shell: Command-line interface to interact with the OS.
o Utilities and Applications: Tools and programs like text editors, compilers,
browsers.

Basic Linux Commands


 Navigation:
o pwd: Displays the current directory.
o ls: Lists files and directories in the current directory.
o cd [directory]: Changes the current directory.
 File Operations:
o touch [filename]: Creates a new empty file.
o mkdir [directory]: Creates a new directory.
o cp [source] [destination]: Copies files or directories.
o mv [source] [destination]: Moves or renames files or directories.
o rm [filename]: Deletes a file (use rm -r [directory] for directories).
 File Viewing:
o cat [filename]: Displays file contents.
o less [filename]: Views file contents page-by-page.
o head [filename]: Shows the first few lines of a file.
o tail [filename]: Shows the last few lines of a file.
 Permissions:
o chmod [permissions] [filename]: Changes file permissions.
o chown [owner:group] [filename]: Changes file ownership.
o Common Permission Notation:
 Read (r), Write (w), Execute (x)
 Numeric notation: 4 for read, 2 for write, 1 for execute (e.g., chmod 755
for full permissions for owner, read & execute for others).

Understanding Linux File System


 Hierarchy: Linux uses a tree-like structure starting at the root directory /.
o Important Directories:
 /bin: Essential command binaries.
 /home: User directories.
 /etc: System configuration files.
 /var: Variable data files (logs, databases).
 /usr: User applications and files.
 /tmp: Temporary files.
 /dev: Device files (e.g., USB, HDD).
 /proc: Virtual directory for system information.
 File Types: Regular files, directories, symbolic links, and device files.
Introduction to Shell Scripting
 What is a Shell Script?: A file containing a series of commands that can be executed as
a program.
 Basics of Shell Scripting:
o Shebang (#!): Indicates interpreter (e.g., #!/bin/bash).
o Variables: Store data for reuse (e.g., var="Hello").
o Control Structures: Loops and conditionals (if, for, while).
o Executing a Script: bash [scriptname] or making it executable (chmod +x
[scriptname] then ./[scriptname]).

Package Management
 Common Package Managers:
o apt: For Debian/Ubuntu-based systems.
o yum/dnf: For RHEL/CentOS-based systems.
o pacman: For Arch Linux.
 Basic Package Commands:
o install: Installs a package (e.g., apt install [package]).
o update/upgrade: Updates package lists or upgrades packages.
o remove: Uninstalls a package.

Linux System Administration Basics


 User and Group Management:
o adduser [username]: Adds a new user.
o passwd [username]: Sets or changes a user password.
o groupadd [groupname]: Adds a new group.
 System Monitoring:
o top/htop: Displays running processes.
o df -h: Shows disk usage.
o free -h: Shows memory usage.
 Process Management:
o ps: Displays currently running processes.
o kill [PID]: Terminates a process by its ID.
o pkill [processname]: Terminates processes by name.

Networking Basics in Linux


 Key Commands:
o ifconfig/ip addr: Displays network interfaces.
o ping [hostname/IP]: Checks connectivity.
o netstat: Shows network connections.
o ssh [user@hostname]: Connects to another machine via SSH.
 Editing Network Configuration Files:
o Static IP: Edit network configuration files (e.g., /etc/network/interfaces in Debian
or ifcfg-* files in RHEL).
o Dynamic IP: Configured by DHCP (Dynamic Host Configuration Protocol).
Benefits of Using Linux
 Cost-Effective: No license fee, lower total cost of ownership.
 Security: Built-in security features, with a strong user and permission model.
 Stability and Reliability: Used in many servers, supercomputers, and embedded systems
due to its stability.
 Community Support: Strong community with forums, tutorials, and extensive
documentation.
 Customization: Highly configurable for different use cases.

You might also like