LINUX FOR DEVICES
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Department of Computer
Objective and Learning Outcome Science and Engineering
Objective:
◦ To be able to understand the basics of Linux
◦ To explores the basic characteristics of Linux Networking
◦ To helps in learning about Linux Shell, File Structure and Network Administration Services
◦ It gives overview about the Linux Security Techniques
Learning Outcomes
Student will be able to
◦ Perform the basic operations for Linux.
◦ Compare the various Linux security techniques.
◦ Implement the Docker in Linux.
◦ Execute the shell scripts on Linux.
◦ Devise the network administration services.
◦ Able to design device drivers
Department of Computer
Recommended Reading Science and Engineering
◦ Christopher Negus, "Linux Bible: The comprehensive Tutorial, Resource ",
8nd Edition, John Wiley
◦ Richard Petersen "Linux: The Complete Reference,“ 6th Edition, Tata Mc
Graw Hill
◦ Jonathan Corbet, Alessandro Rubini, Greg Kroah-Hartman, “Linux
Device Drivers”, 3rd ed, O'Reilly
Module Assessment and Self Work Department of Computer
Science and Engineering
Module Assessment
◦ Quiz
◦ Assignment
PSDA (Self Work)
◦ Minor Experiment
◦ Group Discussion
◦ Case study
Module I - Topics to be covered Department of Computer
Science and Engineering
◦ Introduction to Linux
◦ File System of the Linux
◦ General usage of Linux kernel & basic commands
◦ Linux users and group
◦ Permissions for file, directory and users
◦ Searching a file & directory
◦ zipping and unzipping concepts
◦ Linux for the Industry 4.0 Era,
◦ OPENIL and its advantages, Features of OPENIL
Department of Computer
Science and Engineering
About Linux, Linux System Architecture
Department of Computer
Science and Engineering
Linux Kernel
LINUX FOR DEVICES
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
File System Structure Department of Computer
Science and Engineering
◦ All the files in your Linux system are connected into one overall directory tree
◦ Parts of the tree may reside on different storage devices such as hard drives
or CD-ROMs.
◦ Files on a particular storage device are organized into that is referred to as a
file system.
◦ A file system is a formatted device, with its own tree of directories and files.
◦ Linux directory tree may encompass several file systems, each on different
storage devices.
◦ The files themselves are organized into one seamless tree of directories,
beginning from the root directory
File System Hierarchy Standard (FHS) Department of Computer
Science and Engineering
◦ Linux organizes its files and directories into one overall interconnected
tree, beginning from the root directory and extending down to system
and user directories.
◦ The organization and layout for the system directories are determined
by the file system hierarchy standard (FHS).
◦ The FHS provides a standardized layout that all Linux distributions
should follow in setting up their system directories.
◦ Linux distributions, developers, and administrators all follow the FHS to
provide a consistent organization to the Linux file system.
File System Structure Department of Computer
Science and Engineering
◦ Root Directory: /
◦ System Directories
◦ Program Directories
◦ Configuration Directories and Files
◦ The /proc File System
◦ The sysfs File System: /sys
◦ Device Files: /dev, udev, and HAL
◦ Floppy and Hard Disk Devices
◦ CD-ROM Devices
◦ Mounting File Systems
◦ File System Information
◦ Journaling
◦ Mounting File Systems Automatically: /etc/fstab
Root Directory: / Department of Computer
Science and Engineering
System Directories Department of Computer
Science and Engineering
Program Directories Department of Computer
Science and Engineering
◦ Directories with bin in the name are used to hold programs.
◦ The /bin directory holds basic user programs, such as login, shells
and file commands
◦ The /sbin directory holds specialized system programs for such
tasks as file system management and system operations.
◦ The /usr/bin directory holds program files designed for user tasks.
◦ The /usr/sbin directory holds user-related system operation.
◦ The /lib directory holds all the libraries your system makes use of
and subdirectories such as modules, which holds all the current
kernel modules.
Configuration Directories and Files Department of Computer
Science and Engineering
◦ When you configure different elements of your system, such as user
accounts, applications, servers, or network connections, you make
use of configuration files kept in certain system directories.
◦ Configuration files are placed in the /etc directory.
The /usr Directory Department of Computer
Science and Engineering
The /var Directory Department of Computer
Science and Engineering
The /proc File System Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Linux for Devices
Module-1, Lecture-4
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Linux Shell Department of Computer
Science and Engineering
◦ The shell is program used to interpret and manage commands.
◦ It provides a way to create executable script files, run programs, work with
file systems, compile computer code, and manage the computer.
◦ It is a command interpreter that provides a line-oriented interactive and
noninteractive interface between the user and the operating system.
◦ The commands entered on a command line are interpreted by the shell
and then sent as instructions to the operating system
◦ Commands can be placed in a script file to be executed consecutively a
normal program.
◦ Different types of shells have been developed for Linux
Linux Shell Department of Computer
Science and Engineering
◦ Bourne shell-sh (first shell on Unix systems)
◦ Bourne Again shell (BASH)-bash (Linux standard shell)
◦ Korn shell-ksh (UNIX System V users)
◦ C shell-csh (BSD UNIX users)
◦ TCSH shell-tcsh (an improved C shell)
◦ Z shell-zsh (extended Bourne shell with many improvements)
◦ Dash shell-dash (Ubuntu default)
Linux Shell Department of Computer
Science and Engineering
◦ Linux commands
◦ Shell scripts
◦ chmod command
◦ Command line arguments
◦ Taking input
◦ Printing output
◦ man, help, etc
◦ Internal and External commands
◦ cat for input
Linux Shell Department of Computer
Science and Engineering
◦ expr
◦ Backslash (\) for escapes
◦ Command Line Editing
Linux Shell Department of Computer
Science and Engineering
Linux Shell Department of Computer
Science and Engineering
Linux Shell Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Linux for Devices
Module-1, Lecture-5
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Linux users and group Department of Computer
Science and Engineering
• Understanding /etc/group
• Adding a Group (groupadd) (groupadd -g GID GNAME)
• Understanding /etc/passwd
• Understanding /etc/shadow
• Adding a User (useradd)
• useradd -u 210 -g cse -c “Dr A K Yadav” -d /home/akyadav -s /bin/ksh -m akyadav
• Modifying and Removing Users (usermod and userdel)
Permissions for file & directory Department of Computer
Science and Engineering
• Listing File Attributes (ls –l)
• Type and Permissions
• Links
• Ownership and Group Ownership
• Size
• Last Modification Time
• Filename
Changing File Permissions Department of Computer
Science and Engineering
• chmod
• relative manner
• absolute manner
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Linux for Devices
Module-1, Lecture-6
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Searching a file or directory Department of Computer
Science and Engineering
• Find command
• Locate command
• Which command
• whereis command
Find command Department of Computer
Science and Engineering
• find options path_list selection_criteria action
• find [-H] [-L] [-P] [-D debugopts] [-Olevel] [starting-point...] [expression]
• The options controls the treatment of the symbolic links, debugging options,
and optimization method.
• The path defines the starting directory or directories from where find will start
searching the files.
• The expression attribute is made up of options, search patterns, and actions
separated by operators.
Department of Computer
Science and Engineering
• [-H] option: Do not follow symbolic links, except while processing the
command line arguments. When find examines or prints information about
files, the information used shall be taken from the properties of the symbolic
link itself. The only exception to this behaviour is when a file specified on
the command line is a symbolic link, and the link can be resolved.
• [-L] option: Follow symbolic links. When find examines or prints information
about files, the information used shall be taken from the properties of the
file to which the link points, not from the link itself (unless it is a broken
symbolic link or find is unable to examine the file to which the link points)
Department of Computer
Science and Engineering
• [-P] option: Never follow symbolic links. This is the default behaviour. When
find examines or prints information about a file, and the file is a symbolic
link, the information used shall be taken from the properties of the symbolic
link itself.
• [-D debugopts] option: Print diagnostic information; this can be helpful to
diagnose problems with why find is not doing what you want. The list of
debug options should be comma separated.
• [-Olevel] option: Enables query optimization. The find program reorders tests
to speed up execution while preserving the overall effect
Locate command Department of Computer
Science and Engineering
• Locate command: find files by name
• locate [OPTION]... PATTERN...
• Example locate -b '\NAME’: To search for a file named exactly NAME (not
*NAME*). \ is a globing character, this disables the implicit replacement of
NAME by *NAME*.
which, whereis and type Department of Computer
Science and Engineering
• The which command tells you the directory that contains the command
• It searching the directories of PATH in sequence, and abandons its search
just after it locates a file
• The locate command is faster than the find command because it uses a
previously built database, whereas the find command searches in the real
system, through all the actual directories and files. The locate command
returns a list of all path names containing the specified group of characters
Department of Computer
Science and Engineering
• The “which” command returns the absolute path of the executable that is
called when a command is issued.
• This is useful in finding the location of an executable for creating a shortcut to
the program on the desktop, on a panel, or other place in the desktop
manager.
• The whereis command is used to find out where the binary, source, and man
page files for a command are located
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Linux for Devices
Module-1, Lecture-8
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Linux for the Industry 4.0 Era Department of Computer
Science and Engineering
• Industry 4.0 as the Fourth Industrial Revolution
• Origin and Characterization of Industry 4.0
• Industry 4.0—A Challenge
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Linux for Devices
Module-1, Lecture-7
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Zipping and Unzipping concepts Department of Computer
Science and Engineering
• gzip & gunzip
• zip & unzip
• bzip2
• tar
• zipcloak
• gpg-zip
• gpgtar
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering
Linux for Devices
Module-1, Lecture-8
By: Dr. A K Yadav (9911375598)
Dept of CSE, ASET, AUUP
Linux for the Industry 4.0 Era Department of Computer
Science and Engineering
• Industry 4.0 as the Fourth Industrial Revolution
• Origin and Characterization of Industry 4.0
• Industry 4.0 - A Challenge
OpenIL Department of Computer
Science and Engineering
• NXP Semiconductors, a leader in advanced secure connectivity solutions,
has announced an industrial Linux distribution with real-time OS extensions
and Time-Sensitive Networking (TSN) support for factory-automation Original
Equipment Manufacturer (OEMs).
• By breaking down the barriers of real-time computing and networking in a
standard, community-based distribution, Open Industrial Linux (OpenIL)
helps OEMs usher in the Industry 4.0 era.
Department of Computer
Science and Engineering
• OpenIL provides industrial grade security, trusted computing, hardened
software, cryptographic operations and end to end security
OpenIL features Department of Computer
Science and Engineering
• Xenomai — a real-time framework for Linux
• XML and NETCONF network configuration utilities
• Precision time synchronization using gPTP
• Ethernet drivers for time-sensitive networking
• Support for edge computing services
Department of Computer
Science and Engineering
Department of Computer
Science and Engineering