This document provides an overview of a presentation on Linux programming and administration. It covers the history of Unix and Linux, files and directories in Linux, Linux installation, basic Linux commands, user and group administration, and LILO (Linux Loader). The document introduces key topics like Unix flavors, Linux distributions, partitioning and formatting disks for Linux installation, the file system hierarchy standard, and access permissions in Linux.
This document provides an introduction to Linux, including:
- What Linux is and where it came from, as an open source operating system created by Linus Torvalds in 1991.
- How to get Linux through downloading a distribution like Red Hat and the packages it includes.
- Why Linux has become significant due to its growing popularity, ability to run on multiple hardware platforms, and being free.
- An overview of Linux commands and utilities for file management, processes, users and permissions.
This document provides a summary of useful Linux commands organized into categories such as starting and stopping processes, accessing and mounting file systems, finding files, moving and copying files, installing software, user administration, printing, and configuration files. It includes brief descriptions of common commands like shutdown, mount, ls, find, rpm, adduser, lpr, and files like /etc/fstab, /etc/profile, and /etc/X11/XF86Config that configure system settings. The document is intended to serve as a one page reference for Linux users.
This document provides a summary of useful Linux commands organized into categories such as starting and stopping processes, accessing and mounting file systems, finding files, moving and copying files, installing software, user administration, printing, and configuration files. It includes brief descriptions of common commands like shutdown, mount, ls, find, rpm, adduser, lpr, and files like /etc/fstab, /etc/profile, and /etc/X11/XF86Config that configure system settings. The document is intended to serve as a one page reference for Linux users.
BITS: Introduction to Linux - Text manipulation tools for bioinformaticsBITS
The document provides an introduction to using the Linux command line for bioinformatics tasks. It covers navigating the file system, manipulating files and directories, input/output redirection, piping commands together, and commonly used text processing tools. The goal is to help users easily use command line tools, automate repetitive tasks, and parse/summarize text-based outputs.
Linux is an open source operating system created by Linus Torvalds in 1991. It uses a Linux kernel and includes many common Unix tools. Linux is free to use and modify due to its open source licensing. It runs on many hardware platforms and is growing in popularity for servers, desktops, and embedded systems due to its low cost, stability, and security. Users can download Linux from distributions like Red Hat which package the Linux kernel with additional software and support.
Useful Linux and Unix commands handbookWave Digitech
This article provides practical examples for most frequently used commands in Linux / UNIX. Helpful for Engineers and trainee engineers, Software developers. A handy notes for all Linux & Unix commands.
Solaris is a version of Unix developed by Sun Microsystems based on System V Unix. It has been widely used in enterprise environments. Learning Solaris involves understanding its design philosophy and basic commands before moving to more advanced topics. Some key commands include ps, df, and uname to check processes, disk space, and the OS version. Directories, files, and permissions can be managed using commands like mkdir, chown, chmod while groups and users are configured with useradd, groupadd, and usermod. Services are managed through SMF tools like svcadm rather than init scripts.
Unix is a multi-user networked operating system that handles files, runs programs, and handles input/output. It is designed for server use and networking is intrinsic. Each user has their own settings and permissions, and multiple users can be logged in simultaneously. The document then provides information about accessing Unix servers from Windows and using basic commands like ls, cd, mkdir and rm to navigate directories and manage files.
This document provides an introduction and overview of Linux shell scripting. It discusses key topics like kernels, shells, processes, redirection, pipes, filters, variables, writing shell scripts, command line arguments, and more advanced shell scripting commands. The goal is to explain the basics of shell programming through examples of shell scripts. While it does not serve as a manual, it aims to provide more examples than typical manuals to clarify concepts for beginners.
This document provides an overview of the Linux operating system. It discusses that Linux is an open-source operating system that provides a structured file system, multi-user capabilities, and strong security. It describes the Linux file structure with directories like /bin, /boot, /dev, /etc, and explains commands to view processes, manage users and files, and install packages. Network services like Apache web server, OpenSSH, and FTP are also summarized.
The structure of Linux - Introduction to Linux for bioinformaticsBITS
This 3th slide deck of the training 'Introduction to linux for bioinformatics' gives a broad overview of the file system structure of linux. We very gently introducte the command line in this presentation.
This document provides a tutorial on Unix/Linux. It begins with an overview of the Unix system including the kernel, shell, multi-user and multi-process capabilities, and important directory structures. It then covers basic commands, relative and absolute paths, redirecting and piping output, permissions, process management, installing software, text editors, running jobs in the foreground and background, and remote login/file transfer. The goal is to introduce fundamental Unix concepts and commands to new users.
The document provides information on installing and customizing Linux, maintaining Linux systems, and monitoring system performance. It discusses downloading and burning Linux installation ISO images, preparing for installation, installing packages and configuring X windows. It also covers Linux system maintenance including backups and basic Linux commands. Finally, it lists advanced Linux commands for checking system information and hardware details.
The document provides an overview of various operating systems including UNIX, Linux, and Windows. It discusses the history and development of UNIX including early projects at Bell Labs and Berkeley. It also summarizes key features of UNIX such as security, reliability, and multi-user support. The document then describes the UNIX directory structure and common commands like ls, cd, cat, and man.
Linux is a multi-user, multitasking operating system with a kernel that manages resources and passes commands to applications. The shell interprets commands from the user and sends them to the kernel to execute. Common Linux commands allow users to navigate and manage the filesystem, files, and directories from the command line.
Linux is an open-source operating system that can be used as a server or standalone OS. It offers advantages like stability, robustness, security, and high performance. Linux directories include / for the root directory, /bin for essential programs, /home for user files, and /var for variable data. Common Linux commands include ls to list files, cd to change directories, grep to search files, and vi/emacs for text editing. Cron jobs allow scheduling commands to run periodically using a crontab file.
Linux is a prominent example of free and open source software. It can be installed on a wide variety of devices from embedded systems to supercomputers. Linux is commonly used for servers, with estimates that it powers around 60% of web servers. Linux distributions package the Linux kernel with other software like utilities, libraries and desktop environments. Programming languages and build tools like GCC are supported. Embedded Linux is often used in devices due to its low cost and ease of modification.
Linux is a free, open-source operating system that provides functionality similar to Unix systems. The document then lists and describes several common Linux commands used to navigate directories, view files and system information, manage processes, and edit text files. It also includes a diagram of the standard Linux directory structure and brief descriptions of the purpose of each top-level directory.
PC Software - Computer Application - Office Automation Toolszatax
The document provides an index and overview of commands and functions for Microsoft DOS and Windows. It includes sections on basic DOS commands, the concept of Windows, creating folders and files, word processing, spreadsheets, presentations, and using the internet. Examples are provided for various DOS commands like DIR, MD, RD, CD, COPY, DEL, REN, and TYPE. Internal and external DOS commands are also categorized in a table.
The document describes the standard Linux filesystem hierarchy, including the purpose and some examples of the contents of the top-level directories like /bin, /boot, /dev, /etc, /home, /lib, /media, /mnt, /opt, /proc, /root, /sbin, /usr, and /var. Many directories contain essential system files and programs needed for booting, administration, and operation of the system, while others provide variable storage and mounting points for removable devices. The filesystem layout separates core operating system, user, and variable files for security and manageability.
Common Linux commands are used to navigate files and directories, view and edit file contents, manage permissions and ownership, find files, copy and move files, set the system date and time, check disk usage, create and delete files and directories, and remotely access other Linux systems. Some of the most common commands are cat, cd, chmod, chown, cp, date, df, du, grep, kill, less, ls, man, mkdir, mv, pwd, rm, and ssh.
Linux is an open-source alternative to Microsoft Windows that is freely available and reliable. It has a command line interface and features like virtual memory, networking capabilities, multiple users, and graphical user interfaces. Common Linux commands include ls, cd, mkdir, rmdir, cat, cp, and editors like vi, emacs, nano are used to create and edit files. The Linux directory structure is hierarchical with key directories being /, /home, /usr, /var, and editors allow editing files in different modes like insert and command modes.
Command line for the beginner - Using the command line in developing for the...Jim Birch
This document provides an introduction to using the command line interface for web development. It begins with basic commands and concepts like archiving files. It then covers more advanced topics such as connecting to servers via SSH, using version control with Git, and automating tasks with Grunt or Gulp. The document aims to bring beginners up to an intermediate level of command line proficiency and provide pointers to resources for continuing to an advanced level.
This document discusses Linux file permissions and ownership. It explains that Linux uses a user/group ownership model where files and directories have read, write and execute permissions for the owner, group and others. It also describes how to change permissions and ownership using the chmod and chown commands. The document provides examples of using these commands and includes a lab activity asking the user to create files, set permissions on them, and test access.
SVD is a powerful matrix factorization technique used in machine learning, data science, and AI. It helps with dimensionality reduction, image compression, noise filtering, and more.
Mastering SVD can give you an edge in handling complex data efficiently!
Ad
More Related Content
Similar to Introduction to Linux OS (Part 2) - Tutorial (20)
Solaris is a version of Unix developed by Sun Microsystems based on System V Unix. It has been widely used in enterprise environments. Learning Solaris involves understanding its design philosophy and basic commands before moving to more advanced topics. Some key commands include ps, df, and uname to check processes, disk space, and the OS version. Directories, files, and permissions can be managed using commands like mkdir, chown, chmod while groups and users are configured with useradd, groupadd, and usermod. Services are managed through SMF tools like svcadm rather than init scripts.
Unix is a multi-user networked operating system that handles files, runs programs, and handles input/output. It is designed for server use and networking is intrinsic. Each user has their own settings and permissions, and multiple users can be logged in simultaneously. The document then provides information about accessing Unix servers from Windows and using basic commands like ls, cd, mkdir and rm to navigate directories and manage files.
This document provides an introduction and overview of Linux shell scripting. It discusses key topics like kernels, shells, processes, redirection, pipes, filters, variables, writing shell scripts, command line arguments, and more advanced shell scripting commands. The goal is to explain the basics of shell programming through examples of shell scripts. While it does not serve as a manual, it aims to provide more examples than typical manuals to clarify concepts for beginners.
This document provides an overview of the Linux operating system. It discusses that Linux is an open-source operating system that provides a structured file system, multi-user capabilities, and strong security. It describes the Linux file structure with directories like /bin, /boot, /dev, /etc, and explains commands to view processes, manage users and files, and install packages. Network services like Apache web server, OpenSSH, and FTP are also summarized.
The structure of Linux - Introduction to Linux for bioinformaticsBITS
This 3th slide deck of the training 'Introduction to linux for bioinformatics' gives a broad overview of the file system structure of linux. We very gently introducte the command line in this presentation.
This document provides a tutorial on Unix/Linux. It begins with an overview of the Unix system including the kernel, shell, multi-user and multi-process capabilities, and important directory structures. It then covers basic commands, relative and absolute paths, redirecting and piping output, permissions, process management, installing software, text editors, running jobs in the foreground and background, and remote login/file transfer. The goal is to introduce fundamental Unix concepts and commands to new users.
The document provides information on installing and customizing Linux, maintaining Linux systems, and monitoring system performance. It discusses downloading and burning Linux installation ISO images, preparing for installation, installing packages and configuring X windows. It also covers Linux system maintenance including backups and basic Linux commands. Finally, it lists advanced Linux commands for checking system information and hardware details.
The document provides an overview of various operating systems including UNIX, Linux, and Windows. It discusses the history and development of UNIX including early projects at Bell Labs and Berkeley. It also summarizes key features of UNIX such as security, reliability, and multi-user support. The document then describes the UNIX directory structure and common commands like ls, cd, cat, and man.
Linux is a multi-user, multitasking operating system with a kernel that manages resources and passes commands to applications. The shell interprets commands from the user and sends them to the kernel to execute. Common Linux commands allow users to navigate and manage the filesystem, files, and directories from the command line.
Linux is an open-source operating system that can be used as a server or standalone OS. It offers advantages like stability, robustness, security, and high performance. Linux directories include / for the root directory, /bin for essential programs, /home for user files, and /var for variable data. Common Linux commands include ls to list files, cd to change directories, grep to search files, and vi/emacs for text editing. Cron jobs allow scheduling commands to run periodically using a crontab file.
Linux is a prominent example of free and open source software. It can be installed on a wide variety of devices from embedded systems to supercomputers. Linux is commonly used for servers, with estimates that it powers around 60% of web servers. Linux distributions package the Linux kernel with other software like utilities, libraries and desktop environments. Programming languages and build tools like GCC are supported. Embedded Linux is often used in devices due to its low cost and ease of modification.
Linux is a free, open-source operating system that provides functionality similar to Unix systems. The document then lists and describes several common Linux commands used to navigate directories, view files and system information, manage processes, and edit text files. It also includes a diagram of the standard Linux directory structure and brief descriptions of the purpose of each top-level directory.
PC Software - Computer Application - Office Automation Toolszatax
The document provides an index and overview of commands and functions for Microsoft DOS and Windows. It includes sections on basic DOS commands, the concept of Windows, creating folders and files, word processing, spreadsheets, presentations, and using the internet. Examples are provided for various DOS commands like DIR, MD, RD, CD, COPY, DEL, REN, and TYPE. Internal and external DOS commands are also categorized in a table.
The document describes the standard Linux filesystem hierarchy, including the purpose and some examples of the contents of the top-level directories like /bin, /boot, /dev, /etc, /home, /lib, /media, /mnt, /opt, /proc, /root, /sbin, /usr, and /var. Many directories contain essential system files and programs needed for booting, administration, and operation of the system, while others provide variable storage and mounting points for removable devices. The filesystem layout separates core operating system, user, and variable files for security and manageability.
Common Linux commands are used to navigate files and directories, view and edit file contents, manage permissions and ownership, find files, copy and move files, set the system date and time, check disk usage, create and delete files and directories, and remotely access other Linux systems. Some of the most common commands are cat, cd, chmod, chown, cp, date, df, du, grep, kill, less, ls, man, mkdir, mv, pwd, rm, and ssh.
Linux is an open-source alternative to Microsoft Windows that is freely available and reliable. It has a command line interface and features like virtual memory, networking capabilities, multiple users, and graphical user interfaces. Common Linux commands include ls, cd, mkdir, rmdir, cat, cp, and editors like vi, emacs, nano are used to create and edit files. The Linux directory structure is hierarchical with key directories being /, /home, /usr, /var, and editors allow editing files in different modes like insert and command modes.
Command line for the beginner - Using the command line in developing for the...Jim Birch
This document provides an introduction to using the command line interface for web development. It begins with basic commands and concepts like archiving files. It then covers more advanced topics such as connecting to servers via SSH, using version control with Git, and automating tasks with Grunt or Gulp. The document aims to bring beginners up to an intermediate level of command line proficiency and provide pointers to resources for continuing to an advanced level.
This document discusses Linux file permissions and ownership. It explains that Linux uses a user/group ownership model where files and directories have read, write and execute permissions for the owner, group and others. It also describes how to change permissions and ownership using the chmod and chown commands. The document provides examples of using these commands and includes a lab activity asking the user to create files, set permissions on them, and test access.
SVD is a powerful matrix factorization technique used in machine learning, data science, and AI. It helps with dimensionality reduction, image compression, noise filtering, and more.
Mastering SVD can give you an edge in handling complex data efficiently!
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...Celine George
Analytic accounts are used to track and manage financial transactions related to specific projects, departments, or business units. They provide detailed insights into costs and revenues at a granular level, independent of the main accounting system. This helps to better understand profitability, performance, and resource allocation, making it easier to make informed financial decisions and strategic planning.
How to Manage Opening & Closing Controls in Odoo 17 POSCeline George
In Odoo 17 Point of Sale, the opening and closing controls are key for cash management. At the start of a shift, cashiers log in and enter the starting cash amount, marking the beginning of financial tracking. Throughout the shift, every transaction is recorded, creating an audit trail.
*Metamorphosis* is a biological process where an animal undergoes a dramatic transformation from a juvenile or larval stage to a adult stage, often involving significant changes in form and structure. This process is commonly seen in insects, amphibians, and some other animals.
Contact Lens:::: An Overview.pptx.: OptometryMushahidRaza8
A comprehensive guide for Optometry students: understanding in easy launguage of contact lens.
Don't forget to like,share and comments if you found it useful!.
How to Set warnings for invoicing specific customers in odooCeline George
Odoo 16 offers a powerful platform for managing sales documents and invoicing efficiently. One of its standout features is the ability to set warnings and block messages for specific customers during the invoicing process.
Geography Sem II Unit 1C Correlation of Geography with other school subjectsProfDrShaikhImran
The correlation of school subjects refers to the interconnectedness and mutual reinforcement between different academic disciplines. This concept highlights how knowledge and skills in one subject can support, enhance, or overlap with learning in another. Recognizing these correlations helps in creating a more holistic and meaningful educational experience.
"Basics of Heterocyclic Compounds and Their Naming Rules"rupalinirmalbpharm
This video is about heterocyclic compounds, which are chemical compounds with rings that include atoms like nitrogen, oxygen, or sulfur along with carbon. It covers:
Introduction – What heterocyclic compounds are.
Prefix for heteroatom – How to name the different non-carbon atoms in the ring.
Suffix for heterocyclic compounds – How to finish the name depending on the ring size and type.
Nomenclature rules – Simple rules for naming these compounds the right way.
Common rings – Examples of popular heterocyclic compounds used in real life.
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schoolsdogden2
Algebra 1 is often described as a “gateway” class, a pivotal moment that can shape the rest of a student’s K–12 education. Early access is key: successfully completing Algebra 1 in middle school allows students to complete advanced math and science coursework in high school, which research shows lead to higher wages and lower rates of unemployment in adulthood.
Learn how The Atlanta Public Schools is using their data to create a more equitable enrollment in middle school Algebra classes.
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsesushreesangita003
what is pulse ?
Purpose
physiology and Regulation of pulse
Characteristics of pulse
factors affecting pulse
Sites of pulse
Alteration of pulse
for BSC Nursing 1st semester
for Gnm Nursing 1st year
Students .
vitalsign
APM event hosted by the Midlands Network on 30 April 2025.
Speaker: Sacha Hind, Senior Programme Manager, Network Rail
With fierce competition in today’s job market, candidates need a lot more than a good CV and interview skills to stand out from the crowd.
Based on her own experience of progressing to a senior project role and leading a team of 35 project professionals, Sacha shared not just how to land that dream role, but how to be successful in it and most importantly, how to enjoy it!
Sacha included her top tips for aspiring leaders – the things you really need to know but people rarely tell you!
We also celebrated our Midlands Regional Network Awards 2025, and presenting the award for Midlands Student of the Year 2025.
This session provided the opportunity for personal reflection on areas attendees are currently focussing on in order to be successful versus what really makes a difference.
Sacha answered some common questions about what it takes to thrive at a senior level in a fast-paced project environment: Do I need a degree? How do I balance work with family and life outside of work? How do I get leadership experience before I become a line manager?
The session was full of practical takeaways and the audience also had the opportunity to get their questions answered on the evening with a live Q&A session.
Attendees hopefully came away feeling more confident, motivated and empowered to progress their careers
Title: A Quick and Illustrated Guide to APA Style Referencing (7th Edition)
This visual and beginner-friendly guide simplifies the APA referencing style (7th edition) for academic writing. Designed especially for commerce students and research beginners, it includes:
✅ Real examples from original research papers
✅ Color-coded diagrams for clarity
✅ Key rules for in-text citation and reference list formatting
✅ Free citation tools like Mendeley & Zotero explained
Whether you're writing a college assignment, dissertation, or academic article, this guide will help you cite your sources correctly, confidently, and consistent.
Created by: Prof. Ishika Ghosh,
Faculty.
📩 For queries or feedback: [email protected]
The Pala kings were people-protectors. In fact, Gopal was elected to the throne only to end Matsya Nyaya. Bhagalpur Abhiledh states that Dharmapala imposed only fair taxes on the people. Rampala abolished the unjust taxes imposed by Bhima. The Pala rulers were lovers of learning. Vikramshila University was established by Dharmapala. He opened 50 other learning centers. A famous Buddhist scholar named Haribhadra was to be present in his court. Devpala appointed another Buddhist scholar named Veerdeva as the vice president of Nalanda Vihar. Among other scholars of this period, Sandhyakar Nandi, Chakrapani Dutta and Vajradatta are especially famous. Sandhyakar Nandi wrote the famous poem of this period 'Ramcharit'.
2. Information Technology Institute (ITI)
Dr. Mohamed Gamal 2
Linux Users and Groups
Linux/Unix operating systems have the ability to multitask in a manner similar to other operating systems.
However, Linux’s major difference from other operating systems is its ability to have multiple users. Linux
was designed to allow more than one user to have access to the system at the same time. In order for this
multiuser design to work properly, there needs to be a method to protect users from each other. This is where
permissions come into play.
Linux Primary and Secondary Groups
A primary group is the default group that a user account belongs to. Every user on Linux belongs to a primary
group, usually stored in the `/etc/passwd` file.
$ cat /etc/passwd or $ tail -n 1 /etc/passwd
The /etc/passwd file in Linux and Unix-like systems stores basic information about each user or account. It is
world-readable by default and can be viewed using tools like cat or a text editor.
Each line in the file represents a user and contains seven fields separated by colons:
» Name: The user's unique login name.
» Password: Originally stored an encrypted password, now replaced by x (actual passwords are stored in
/etc/shadow).
» User ID (UID): A numeric identifier for the user; 0 is for root, and 100-999 are for regular users.
» Group ID (GID): The user's primary group ID, usually matching the UID.
» GECOS: General user information, like real name; often unused or empty.
» Home Directory: The user's starting directory upon login.
» Shell: The user's default shell (e.g., /bin/bash).
Once a user has been created with their primary group, they can be added to other secondary groups with a
maximum of 15 secondary groups, usually stored in the `/etc/group` file.
$ cat /etc/group
3. Information Technology Institute (ITI)
Dr. Mohamed Gamal 3
Add a new user Delete (or remove) a user
$ sudo adduser <username> $ sudo userdel <username>
$ sudo adduser Ahmed $ sudo userdel Ahmed
Change a user’s password Change user details
$ sudo passwd <username>
$ sudo chfn <username>
$ sudo chfn -f "" -o "" -p "" -h "" <username>
$ sudo nano /etc/passwd
$ sudo passwd Ahmed
$ sudo chfn Ahmed
$ sudo chfn -f "Ahmed" -o "" -p "" -h "" Ahmed
Switch to another user (su: switch user)
$ su <username>
$ su Ahmed
Create a new group Delete (or remove) a group
$ sudo groupadd <group name> $ groupdel <group name>
$ sudo groupadd Marketing $ groupdel Marketing
Add a group to a user (a: append, G: group) Remove a user from a group
$ usermod -a -G <group name> <username> $ gpasswd -d <username> <group name>
$ usermod -a -G Marketing Ahmed $ gpasswd -d Ahmed Marketing
View all groups a user in
$ groups <username>
$ groups Ahmed
4. Information Technology Institute (ITI)
Dr. Mohamed Gamal 4
View all sudoers file and edit user permissions
The sudoers file is a configuration file that defines which users or groups have permission to run commands
with elevated privileges (i.e., using sudo), and under what conditions, usually located at /etc/sudoers.
$ sudo visudo
Ahmed All=(ALL) NOPASSWD: /usr/bin/top, /usr/bin/ls
Now Ahmed is a sudoer!
$ su Ahmed
$ sudo ls
Edit group permissions
$ sudo visudo
%Marketing ALL=NOPASSWD: /usr/bin/ls, /usr/bin/less, /usr/bin/apt
5. Information Technology Institute (ITI)
Dr. Mohamed Gamal 5
Linux File Permissions
A process is a task or a group of tasks running on your computer. It's different from a program or a command.
One command can start multiple processes at once. Processes can work independently or be related, and a
problem in one process might not always affect others. Processes use resources like memory, CPU time,
and devices (like printers or hard drives). The operating system manages these resources to keep everything
running smoothly.
-/d rw-r--r-- 1 centos9 centos9 56 Aug 5 16:52 file.py
↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
Type
(file/dir)
User Group Other
No. hard
links
Owner/User Group Size Date Time Name
6. Information Technology Institute (ITI)
Dr. Mohamed Gamal 6
Manipulating Files
Change mode of a file
$ chmod [u/g/o/a] [+/-/=] [r/w/x] [filename/dirname]
Type Explanation
u user
g group
o other
a all three
Type Explanation
+ add permission
- remove permission
= set only this permission to u/g/i=o
Use -R flag to apply the permission changes to all files and directories within a specific directory.
Function Example
Adding Permissions
$ chmod a+w file.py
$ chmod u+x file.py
$ chmod -R a+w Games
Removing Permissions
$ chmod -R a-w Games
$ chmod -R a=w Games
$ chmod a=wr file.py
Adding permissions to all
(user, group, other users)
$ chmod +x file.txt
$ chmod g+w,o-rw,a+x file.txt
» Use comma-separated permissions without spaces.
Changing the owner of the file
$ chown Options New_Owner:NEW_GROUP [filename/dirname]
Examples
$ chown Ahmed file.txt
$ chown :developers file.txt
$ chown Ahmed:developers file.txt
$ chown -R Ahmed Games
7. Information Technology Institute (ITI)
Dr. Mohamed Gamal 7
Text Editors (Nano, Vi/Vim)
1) Nano
$ nano file.txt
If the file exists, nano will open it, otherwise it will create a new file.
Description Command
Help CTRL + G
Save As CTRL + O
Cancel CTRL + C
Exit/Close CTRL + X
Highlight/Select CTRL + 6
Copy ALT + 6
Cut CTRL + K
Paste CTRL + U
8. Information Technology Institute (ITI)
Dr. Mohamed Gamal 8
2) Vi/Vim
$ vi file.txt or $ vim file.txt
Mode Key Description
Command Mode ESC
• The default mode when you start Vi/Vim.
• You use this mode to execute commands for
navigating, copying, deleting, and more.
Insert Mode i
• This is where you can type and edit text.
• Press ESC to return to Command Mode.
Visual Mode v
• Used for highlighting/selecting text.
• Press ESC to return to Command Mode.
9. Information Technology Institute (ITI)
Dr. Mohamed Gamal 9
Function Key Mode Description
Copy (Yank) y Visual/Command
Copy the selected text or a
specified range.
Paste Text p Command Mode
Paste the copied text after the
cursor.
Delete Text d Visual/Command
Delete the selected text or a
specified range.
Delete Line dd or [num]dd Command Mode Delete the current line(s).
Delete Word dw or d[num]w Command Mode Delete a word(s).
Undo Change u Command Mode Undo the last change.
Redo Change CTRL + r Command Mode
Redo the change that was
undone.
Searching /<pattern> or ?<pattern> Command Mode
Start a forward/reverse search for
<pattern>.
Move to Line Start 0 Command Mode
Move the cursor to the beginning
of the current line.
Move to Line End CTRL + e Command Mode
Move the cursor to the end of the
current line.
Save and Exit :wq or ZZ Command Mode Save changes and exit Vim.
Exit Without Saving :q! Command Mode Exit Vim without saving changes.
Split Window
(Horizontal)
:split <filename> Command Mode
Open a file in a new horizontal
split window.
Split Window
(Vertical)
:vsplit <filename> Command Mode
Open a file in a new vertical split
window.
Move Between Splits
CTRL + w + arrow key or
h, j, k, l
Command Mode Move between split wind
Graphical Editors
So far we’ve learned about various command line editors. However, if you are running Linux as a desktop
operating system you might be interesting in some graphical text editors and word processors.
» emacs – Emacs has both graphical and command line modes.
» gedit – The default text editor for the Gnome desktop environment.
» gvim – The graphical version of vim.
» kedit – The default text editor for the KDE (K Desktop Environment) desktop environment.
10. Information Technology Institute (ITI)
Dr. Mohamed Gamal 10
Microsoft Word Replacement
If you are looking for a Microsoft Word replacement, consider
– AbiWord or
– LibreOffice which is a complete office suite with a spreadsheet program, a database, and
presentation software.
Code/Text Editors for Linux
– Visual Studio Code (VS Code)
– Sublime Text
– Gedit – GNOME's simple and lightweight text editor.
– Kate
– etc.
Steps to Set Your Default Editor
You can set $EDITOR in your personal initialization files to ensure your favorite editor is used, be it nano,
emacs, vi, or something else.
1) Open your shell's configuration file (i.e., ~/.bashrc)
$ nano ~/.bashrc
2) Set the $EDITOR variable
$ export EDITOR='vim'
3) Apply the changes
$ source ~/.bashrc
Now, whenever you invoke a command that requires an editor (e.g., crontab -e, git commit, etc.), it will
open in your preferred editor.
11. Information Technology Institute (ITI)
Dr. Mohamed Gamal 11
Creating a Collection of Files
If you want to bundle a group of files and/or directories together in an archive (not compressing), you can use
the tar command which is one of the oldest and common methods for creating and working with
compressed backup archives.
– You may want to create a copy or backup of a group of files.
– You may have several files you want to transfer at once or as a set.
$ tar [-] c|x|t f <tarfile> <pattern>
Note that you have the choice to precede the tar arguments with a hyphen ( - ) or omit it. For example, $ tar
cf file.tar it is the same as $ tar -cf file.tar.
tar option Description
c Create a tar archive.
x Extract files from the archive.
t Display the table of contents (list).
v Causes tar to be verbose.
f <file> The tar archive file to perform operations against.
$ cd /home/MG
$ mkdir data
$ touch data/file.txt data/report.doc
$ tar cf archived.tar data/
$ tar tf archived.tar
$ file archived.tar
$ cd /tmp
$ tar xf /home/MG/ archived.tar
$ ls data/
$ touch secret secret.bak
$ tar cvf misc.tar sec* data
12. Information Technology Institute (ITI)
Dr. Mohamed Gamal 12
Compressing Files To Save Space
Compressing files in Linux is a common way to save space on disk. Linux provides several tools and utilities
to compress files and directories effectively.
Command Description
$ gzip <file> Compress file. The resulting compressed file is named file.gz.
$ gunzip <file> Uncompress files.
$ gzcat or zcat Concatenates and prints compressed files.
Hint: You can use the command du to display how much space is used by the file.
$ du -h archived.tar
$ gzip archived.tar
$ ls -lh
$ du -h archived.tar.gz
$ gunzip archived.tar.gz
$ ls -lh
Linux provides several other tools and utilities to compress files and directories effectively.
Command Decompression
$ bzip2 <file> $ bunzip2
$ zip <file> $ unzip
$ xz <file> $ xz
13. Information Technology Institute (ITI)
Dr. Mohamed Gamal 13
Compressing Archives using tar
In modern versions of the tar command gzip , bzip2, and xz compressions are built-in.
$ tar zcfv compressed_gzip.tar.gz data
$ tar jcfv compressed_bzip2.tar.bz2 data
$ tar Jcfv compressed_xz.tar.xz data
14. Information Technology Institute (ITI)
Dr. Mohamed Gamal 14
Connecting remotely to other machines using SSH in Linux?
It's a protocol used to securely run a shell on a remote system. If you have a user account on a remote Linux
System providing SSH services, you can remotely log into and run commands on that system.
Command Usage
sudo systemctl start sshd Starts the SSH service on the system using systemctl.
sudo systemctl stop sshd Stops the SSH service on a system using systemctl.
sudo systemctl status sshd
Displays the status of the SSH service using the service
command.
whoami Displays the username of the current user.
ip a Displays all IP addresses and network interfaces.
ssh username@ip_address
Connects to a remote machine using SSH with a specified
username and IP address.
exit Exits the current shell or terminates the SSH session.
Copying Files between Hosts
To copy files between hosts in a Linux environment, you can use several tools, with scp, rsync, and sftp
being the most common.
Tool Usage Strengths Command Example
scp Copy files securely over SSH
Simple, secure, works with
individual files
$ scp file
user@host:/path/to/destination
rsync Copy files securely with efficient
synchronization
Fast, supports incremental
copying
$ rsync -avz file
user@host:/path/to/destination
sftp Interactive file transfer over SSH
Allows navigation and file
management
$ sftp user@host
Note: If you are running Windows, you can use the PuTTY Secure Copy Client (pscp.exe) and the PuTTY Secure File
Transfer client (psftp.exe) programs.
15. Information Technology Institute (ITI)
Dr. Mohamed Gamal 15
1. Using scp (Secure Copy)
scp is a command-line tool for securely copying files between local and remote hosts over SSH.
$ scp [options] source_file username@destination_host:destination_path
▪ Copying a file from local to remote:
$ scp /path/to/local/file username@remote_host/ip:/path/to/remote/directory
$ scp /C/Users/MG/Downloads/file.txt [email protected]:/home/MG
▪ Copying a file from remote to local:
$ scp username@remote_host:/path/to/remote/file /path/to/local/directory
$ scp [email protected]:/home/MG/data.csv /C/Users/MG/Downloads
▪ Copying a directory recursively ( -r flag ):
$ scp -r /path/to/local/directory username@remote_host:/path/to/remote/directory
$ scp -r username@remote_host:/path/to/remote/directory /path/to/local/directory
$ scp -r /C/Users/MG/Downloads/Test [email protected]:/home/MG
$ scp -r [email protected]:/home/MG/Pictures /C/Users/MG/Downloads
▪ Using a different SSH port (default port is 22):
$ scp -P port /path/to/local/file username@remote_host:/path/to/remote/directory
$ scp -P 22 [email protected]:/home/MG/data.csv /C/Users/MG/Downloads
Other Similar Commands:
– rsync
– sftp
16. Information Technology Institute (ITI)
Dr. Mohamed Gamal 16
Listing Processes and Displaying Information
Process Types:
– A process is a program which is being executed.
– Any process may create a child process.
– All processes are descendants of the first system process, which is system.
– A process can run in the background or foreground.
$ echo $$ (See the PID of your current shell process)
$ exit
$ echo $$
The ps (process status) command in Linux is used to list processes and display information about them. It
provides various options to customize the output, depending on what information you want.
The ps command uses /proc directory to gather information about running processes. When you run ps, it
reads process-related files in the /proc directory to provide details.
$ ls -lh /proc
$ ps [options]
Option Description
-e Everything, all processes.
-f Full format listing.
-u <username> Display processes running as username.
-p <PID> Display process information for PID.
-l Display Parent PID ‘PPID’.
aux Display a comprehensive list of all processes currently running.
… …
17. Information Technology Institute (ITI)
Dr. Mohamed Gamal 17
$ ps
$ ps -ef
$ ps -ef | head -n 5
$ ps -fu MG
$ ps -l (display Parent PID ‘PPID’)
$ ps aux | head
$ ps aux | grep -i vim
$ ls /proc/
$ ps aux | grep 813 (which is shown in /proc)
Other similar command
$ pstree Display running processes in a tree format.
Command Description
$ pidof <process name>
$ pgrep <process name>
Find the PID of a running program.
$ pidof vim (find the PID of a running process named vim)
$ pgrep vim (find the PID of a running process named vim)
Here’re other commands that allow you to view running processes as well but for real-time monitoring.
Option Description
top
Interactive process viewer.
» Type 1 to displays all CPU cores' activity individually.
» Type s to change the refresh rate (delay between updates).
» Type h for help.
» Type k to kill a process by entering its PID.
» Type r to renice a process to change its priority (-20 to 19, where lower is higher priority).
» Press q to quit.
» Type z or Z to toggle color display for better readability.
» Type n to change the number of processes shown.
» Type O to filter processes based on their names (COMMAND=NAME).
» Type Shift+P to sort by CPU usage.
» Type Shift+T to sort by process time (CPU time used).
» Type Shift+M to by memory usage.
uptime Display for how long the system has been running.
18. Information Technology Institute (ITI)
Dr. Mohamed Gamal 18
$ top
PID The ID of the running process.
USER The process owner.
PR The priority of the process.
NI The nice value of the process.
VIRT The virtual memory size used by the process.
RES The resident memory size used by the process (physical memory).
SHR The amount of shared memory used by the process.
S
The state of the process.
» R: Running.
» S: Sleeping.
» D: Uninterruptible sleep.
» Z: Zombie.
» T: Stopped or traced.
» I: Idle
%CPU The CPU usage percentage by the process.
%MEM The memory usage percentage by the process.
TIME+ The total CPU time the process has used since it started.
COMMAND The name or command that started the process.
20. Information Technology Institute (ITI)
Dr. Mohamed Gamal 20
Running Processes in the Foreground and Background
Up until this point all the commands we have been executing have been running in the foreground. When a
command, process, or program is running in the foreground the shell prompt will not be displayed until that
process exits.
Why run processes in the background?
– For long running programs it can be convenient to send them to the background.
– Processes that are backgrounded still execute and perform their task, however they do not block you
from entering further commands at the shell prompt.
Command Description Example
$ <command> Start command in the foreground. $ ls -lh
$ <command> & Start command in the background. $ sleep 1000 &
CTRL + C Kill the running foreground process. -
CTRL + Z Suspend the foreground process. -
$ bg [%num] Background a suspended process. $ bg %1
$ fg [%num] Foreground a background process. $ fg %1
$ kill [%num] Kill a process by job number or PID. $ kill %1
$ jobs [%num]
List jobs.
» Plus sign (+): the current job.
» Minus sign (-): the previous job.
$ jobs
21. Information Technology Institute (ITI)
Dr. Mohamed Gamal 21
Killing Processes
Killing processes in Linux involves terminating processes by sending signals, typically using commands like kill, pkill,
or killall.
Command Description
CTRL + C Kill the running foreground process.
$ kill -[signal] <PID> Send a signal to a process by PID.
$ kill -l Display a list of signals.
$ man 7 signal Display the manual for all signals.
$ pkill <process name> Send a signal to process by name.
$ killall <process name> Sends a signal to all processes with a specific name.
» SIGINT (2): Interrupt signal, sent when you press CTRL+C in the terminal.
» SIGTERM (15): Politely asks a process to terminate gracefully, this is the default signal.
» SIGKILL (9): Forces termination if a process does not respond.
» SIGSTOP (19): Stops (pauses) a process.
» SIGCONT (18): Resumes a stopped process.
Running all the following is equivalent which is the default behavior.
$ kill <PID>
$ kill -15 <PID>
$ kill -TERM <PID>
$ kill -SIGTERM <PID>
22. Information Technology Institute (ITI)
Dr. Mohamed Gamal 22
Priority and Nice Values in Linux (Article)
Some processes may be highly CPU-intensive but not as important as others and hence can have a lower
priority while others may or may not be highly CPU intensive but are very important and hence should have
higher priority.
– For example, if there is a process A, which detects fraud with input data and there is another process
B, which makes hourly backups of some data, then the priority(A) > priority(B).
– This ensures that if both A and B are running at the same time, A would be allocated more
processing bandwidth.
Priority Value: Determines the actual priority of a process, used by the Linux kernel for scheduling.
– Range: 0–139 (real-time: 0–99, user-space: 100–139).
Real-time processes in Linux are high-priority tasks that must complete within strict timing constraints, ensuring they get
CPU time before other processes (e.g., embedded systems, telecommunications, …, etc.).
User processes in Linux are regular tasks initiated by normal users, with lower priority than real-time processes, and their
execution can be adjusted using the nice value.
Nice Value: A user-controlled value to influence process priority.
– Range: -20 to +19 (-20 is highest priority, 0 is default, +19 is lowest priority)
Priority Value = Nice Value + 20
To see how these work together let us run a process that takes a lot of processing power continuously, we
will use a shell script (infinite.sh) which uses an infinite loop in it to demonstrate how this works.
$ cat > infinite.sh # take input from the terminal
#!/bin/bash
while true; do
echo "Running..."
done
# Press Ctrl+D here to save and exit
Run $ sh infinite.sh & to run the script in the background, use $ top then CTRL+P to see that this process
(PID-3227 for example) is taking high processing power of the CPU.
23. Information Technology Institute (ITI)
Dr. Mohamed Gamal 23
If we run two more processes of infinite.sh then all of them (e.g., PID-3227, 3328, 3295) get equal CPU as all
have the same priority (e.g., %CPU = 16.9 for all the three).
Now let us give these processes different nice values, there are two ways to do this:
1) Start a new process with a nice value using the $ nice command
$ nice -n <nice_val> [command]
$ nice -n 10 sh infinite.sh &
• When we run this we get another process (PID-8509) with the priority as 30
• Priority = 20 + 10 = 30
• As it has the least priority, it gets the least amount of CPU.
24. Information Technology Institute (ITI)
Dr. Mohamed Gamal 24
2) Change a running process nice value by its PID using $ renice command
$ renice -n <nice_val> -p [PID]
$ renice -n 5 -p 8585
• When we run this, the process with PID-8585 get its priority changed to 25.
• Priority = 20 + 5 = 25
• The CPU is allocated accordingly as well.
Note that:
» Regular users can only set positive nice values (0 to 19) to lower a process's priority.
» Only the root user (administrator) can set negative nice values (-20 to -1) to increase a process's priority.
Summary
Feature $ nice $ renice
When used When starting a new process For changing running processes
Root privilege Required for negative nice values
Effect Sets the initial nice value Modifies an existing nice value
25. Information Technology Institute (ITI)
Dr. Mohamed Gamal 25
Analyzing and Sorting Logs
In Linux, system logs are stored in the /var/log directory, which contains log filesfor various system activities, applications,
services, and security. Analyzing and sorting logs in Linux is a crucial step for troubleshooting, monitoring, and
understanding the behavior of the system.
Log File Purpose
/var/log/messages Most syslog messages.
/var/log/secure Log file for security and authentication-related messages and errors.
/var/log/maillog Log file with main server-related messages.
/var/log/boot.log Messages related to system start up.
… …
$ df -h (report file system disk space usage)
$ cat /var/log/messages
$ less /var/log/boot.log
$ tail -f /var/log/messages
$ grep "error" /var/log/messages
$ sort /var/log/messages
$ awk '{print $1, $2, $3}' /var/log/ messages
26. Information Technology Institute (ITI)
Dr. Mohamed Gamal 26
Scheduling Jobs
Cron is a time-based job scheduling service that automates tasks or performs routine maintenance. It
checks for scheduled jobs every minute and executes them accordingly.
– cron: the service responsible for running scheduled jobs, typically started when the system boots.
– Crontab (Cron Table): a program used to create, read, update, and delete job schedules. The crontab file
defines when and what commands to run, with five time specification fields (minutes, hour, day of the month,
month, and day of the week), followed by the command to execute.
Commands
$ crontab -e Edit (e) the crontab file for the current user.
$ crontab -l List (l) current user's crontab entries.
$ crontab -r Remove (r) the current user's crontab file.
Examples (Crontab Generator):
0 0 * * 3 <exec_file> (Cron job every Wednesday at midnight)
* /30 * * * ls –l (Cron job every half hour)
0 0 * * 1-5 (Run on weekdays only at midnight)
$ crontab -e # open crontab file
* /30 * * * ls –l
Once you write and save a crontab entry using $ crontab -e, the cron daemon (cron) automatically
schedules the job based on the specified timing.
$ sudo systemctl status crond
27. Information Technology Institute (ITI)
Dr. Mohamed Gamal 27
Package Management on CentOS, Fedora, and RedHat-based
Distributions (Installing Software)
A package in Linux is a collection of files that make up an application, along with metadata such as the app's
description, version, and dependencies. To install or remove packages, superuser privileges are required.
A package manager is used to install, upgrade, and remove packages, while also handling dependencies and
tracking installed packages and their versions.
1) Using $ yum Command
The yum command is a package management tool for RPM-based distributions like CentOS, Fedora, and
RedHat.
Search for a package
$ yum search <package name>
$ yum search inkscape
Install a package
$ sudo yum install <package name>
$ sudo yum install inkscape
Remove a package
$ sudo yum remove <package name>
$ sudo yum remove inkscape
Get information about a package
$ yum info <package name>
$ yum info inkscape
Update a Specific Package
$ sudo yum update <package name>
$ sudo yum update nginx
Update All System Packages
$ sudo yum update
$ sudo yum update
2) Using rpm Command
The $rpm command can also be used to manage packages, such as listing installed packages, installing a
package from a file, and listing files belonging to a package.
List all installed packages
$ rpm -qa
$ rpm -qa | sort | head
Install a package
$ rpm -ivh <package-file.rpm>
$ sudo rpm -ivh SpiderOak-5.0.3-1.i386.rpm
List all files belonging to a package
$ rpm -ql <package name>
$ rpm -ql inkscape
28. Information Technology Institute (ITI)
Dr. Mohamed Gamal 28
The dnf package manager is an improved, modern version of yum, designed to address its limitations while
maintaining its core functionality.
yum/dnf