You are on page 1of 145

LFAD211 - LINUX FUNDAMENTALS

AND ADMINISTRATION

Linux Suse Enterprise Server


History of Linux
• Linux began in 1991 as a personal project by Finnish student Linus
Torvalds: to create a new free operating system kernel.
• resulting Linux kernel has been marked by constant growth
throughout its history.
• initial release of its source code in 1991, it has grown from a small
number of C files under a license prohibiting commercial distribution
to the 4.15 version in 2018 with more than 23.3 million lines of source
code, not counting comments, under the GNU General Public
License v2.

Linux Suse Enterprise Server


History of Linux
• Linus Benedict Torvalds
• Finland Swedish
• born 28 December 1969
• is a Finnish-American software engineer who is the creator and,
historically, the principal developer of the Linux kernel, which is the
kernel for Linux operating systems (distributions) and other operating
systems such as Android and Chrome OS.

Linux Suse Enterprise Server


SUSE Linux Enterprise
• SUSE Linux Enterprise Server, a secure, open source server
operating system designed to tackle mission-critical workloads.
• designed for servers, mainframes, and workstations
• SUSE Linux Enterprise Server administration concepts.
• set up a server to use Secure Boot, manage users and groups, and
administer the most common network services.
• covers various file systems, and using logical volume management to
optimize your storage.

Linux Suse Enterprise Server


SUSE Linux
• is a computer operating system developed by SUSE. It is built on top
of the free and open source Linux kernel and is distributed with
system and application software from other open source projects.
• is of German origin, an acronym of “Software und System-
Entwicklung” (software and systems development), and was mainly
developed in Europe.
• first version appeared in early 1994, making SUSE one of the oldest
existing commercial distributions. It is known for its YaST
configuration tool.

Linux Suse Enterprise Server


SUSE Linux
• Novell bought the SUSE (then "SuSE") brands and trademarks in
2003
• founded on 2 September 1992 in Nuremberg, Germany, by Roland
Dyroff, Thomas Fehr, Burchard Steinbild, and Hubert Mantel.
• mathematics students at a university

Linux Suse Enterprise Server


SUSE Linux Logo
• The official logo and current mascot of the distribution is a veiled
chameleon officially named, "GEEKO" (portmanteau of "Gecko" and
"geek"), following a competition. As with the company's name, the
"GEEKO" logo brand has evolved over time to reflect the name
changes.
• SUSE – A Malaysian term a type of lizard

Linux Suse Enterprise Server


openSUSE Project
• On 4 August 2005, Novell announced that the SUSE Professional
series would become more open, with the launch of the openSUSE
Project community.
• software always had been open source, but openSUSE opened the
development process, allowing developers and users to test and
develop it. Previously, all development work had been accomplished
in-house by SUSE.
• Version 10.0 was the first version that offered public beta testing.

Linux Suse Enterprise Server


Microsoft agreement
• On 3 November 2006 (renewed 25 July 2011), Novell signed an
agreement with Microsoft covering improvement of SUSE's ability to
interoperate with Microsoft Windows, cross-promotion/marketing of
both products and patent cross-licensing.
• Agreement is considered controversial by some in the Free Software
community.
• Free software or libre software is computer software distributed
under terms that allow users to run the software for any purpose as
well as to study, change, and distribute it and any adapted versions.
• Example: VLC Player, Firefox Web, Xfce desktop environment, GIMP image editor, Vim text
editor

Linux Suse Enterprise Server


SUSE Distributions
• S.u.S.E Linux (Slackware-based)
• S.u.S.E Linux (jurix-based)
• SuSE Linux
• SUSE Linux Enterprise

Linux Suse Enterprise Server


SUSE Linux Enterprise
SLES version FCS Release date
1 October 31, 2000
7 October 31, 2001
8 October 1, 2002
9 August 3, 2004
10 June 17, 2006
11 March 24, 2009
12 October 27, 2014
15 July 16, 2018

Linux Suse Enterprise Server


Five Common Operating Systems
What Operating Systems Do
• Operating systems define how a computer stores files, switches
between different applications, manages memory, keeps itself
secure, and interacts with peripherals like printers and cameras.
– Microsoft Windows
– Apple iOS
– Apple macOS
– Linux Operating System
– Google's Android OS

Linux Suse Enterprise Server


Linux Distributions
• Ubuntu
• Linux Mint Cinnamon
• Zorin OS
• Elementary OS
• Linux Mint Mate
• Manjaro Linux
• Redhat
• Debian
• Fedora
• Solaris
• Suse
Linux Suse Enterprise Server
Mac OS
• Mac OS X Public Beta
• Mac OS X 10.0 Cheetah
• Mac OS X 10.1 Puma
• Mac OS X 10.2 Jaguar
• Mac OS X 10.3 Panther
• Mac OS X 10.4 Tiger
• Mac OS X 10.5 Leopard
• Mac OS X 10.6 Snow Leopard
• Mac OS X 10.7 Lion
• OS X 10.8 Mountain Lion
• OS X 10.9 Mavericks
• OS X 10.10 Yosemite
• OS X 10.11 El Capitan
• macOS 10.12 Sierra
• macOS 10.13 High Sierra
• macOS 10.14 Mojave
• macOS 10.15 Catalina
iOS
• Phone OS 1 – derived from "OS X" (At the time, "macOS" was still known as "Mac OS X"
and not "OS X" as it was known from 2012 to 2016.)
• iPhone OS 2
• iPhone OS 3
• iOS 4 – continued from iPhone OS 3
• iOS 5
• iOS 6
• iOS 7
• iOS 8
• iOS 9
• iOS 10
• iOS 11
• iOS 12
• iOS 13

Linux Suse Enterprise Server


Microsoft Windows
• MS-DOS
• Windows 1.0 - 2.0
• Windows 3.0 – 3.1
• Windows 95
• Windows 98
• Windows ME - Millennium Edition
• Windows NT 31. - 4.0
• Windows 2000
• Windows XP
• Windows Vista
• Windows 7
• Windows 8
• Windows 10
• Windows Server
• Windows Home Server
• Windows CE

Linux Suse Enterprise Server


Android
• Android 1.5: Android Cupcake
• Android 1.6: Android Donut
• Android 2.0: Android Eclair
• Android 2.2: Android Froyo
• Android 2.3: Android Gingerbread
• Android 3.0: Android Honeycomb
• Android 4.0: Android Ice Cream Sandwich
• Android 4.1 to 4.3.1: Android Jelly Bean
• Android 4.4 to 4.4.4: Android KitKat
• Android 5.0 to 5.1.1: Android Lollipop
• Android 6.0 to 6.0.1: Android Marshmallow
• Android 7.0 to 7.1: Android Nougat
• Android 8.0 to Android 8.1: Android Oreo
• Android 9.0: Android Pie

Linux Suse Enterprise Server


SUSE Linux Enterprise Desktop
• SLED version 12 has included a modified version of the GNOME
Classic Shell to include a layout with one panel on the bottom of the
screen, traditional application menus, and desktop icons for
traditional desktop users.
• includes LibreOffice, Mozilla Firefox, and Evolution along with many
standard GNOME utilities, such as GNOME Documents and GNOME
Files. As well, the YaST Control Center allows end users to make
advanced changes to the system from the command line.

Linux Suse Enterprise Server


Linux Suse Enterprise Server
GNOME (GNU Network Object Model
Environment)
• is a graphical user interface (GUI) and set of computer desktop
applications for users of the Linux computer operating system.
• Linux operating system easy to use for non-programmers and
generally corresponds to the Windows desktop interface and its most
common set of applications.

Linux Suse Enterprise Server


Linux Suse Enterprise Server
Graphical User Interface (GUI)
• is a form of user interface that allows users to interact with electronic
devices through graphical icons and audio indicator such as primary
notation, instead of text-based user interfaces, typed command
labels or text navigation.

Linux Suse Enterprise Server


Linux kernel
• is a free and open-source, monolithic, Unix-like operating system
kernel.
• deployed on a wide variety of computing systems, from personal
computers, mobile devices, mainframes, and supercomputer to
embedded devices, such as routers, wireless access points, private
branch exchanges, set-top boxes, FTA receivers, smart TVs,
personal video recorders, and NAS appliances.

Linux Suse Enterprise Server


Linux Suse Enterprise Server
What is open source?
• Open source products include permission to use the source code,
design documents, or content of the product. It most commonly
refers to the open-source model.
• open-source software or other products are released under an open-
source license as part of the open-source-software movement.

Linux Suse Enterprise Server


What is YaST?
• (Yet another Setup Tool) is a Linux operating system setup and
configuration tool.
• released first in April 1995
• featured in the openSUSE Linux distribution and SUSE's derived
commercial distributions.
• YaST Control Center

Linux Suse Enterprise Server


Installation of Linux Suse
• 1 Overview • 9 Add-On Product
• 2 Installer Self-Update • 10 System Role
• 3 Language, Keyboard, and• 11 Partitioning
Product Selection • 12 Clock and Time Zone
• 4 License Agreement • 13 Create New User
• 5 IBM Z: Disk Activation • 14 Authentication for the System
• 6 Network Settings Administrator “root”
• 7 Registration • 15 Installation Settings
• 8 Extension and Module• 16 Performing the Installation
Selection

Linux Suse Enterprise Server


Hardware Requirements
• All CPUs available on the market to date are supported
• maximum number of CPUs supported by software design is 8192 for
Intel 64 and AMD64.
• A minimum of 1024 MB of memory is required for a minimal
installation.
• Hard Disk Requirements

Linux Suse Enterprise Server


Boot Screen on Machines Equipped
with Traditional BIOS

Linux Suse Enterprise Server


Boot Screen on Machines Equipped
with UEFI

Linux Suse Enterprise Server


Language, Keyboard, and Product
Selection

Linux Suse Enterprise Server


License Agreement

Linux Suse Enterprise Server


IBM Z: Disk Activation

Linux Suse Enterprise Server


Configuring DASD Disks

Linux Suse Enterprise Server


Network Settings

Linux Suse Enterprise Server


Registering Manually

Linux Suse Enterprise Server


Installing without Registration

Linux Suse Enterprise Server


Selecting Extensions and Modules with
Registration

Linux Suse Enterprise Server


Selecting Extensions and Modules
without Registration

Linux Suse Enterprise Server


Add-On Product

Linux Suse Enterprise Server


System Role

Linux Suse Enterprise Server


Suggested Partitioning

Linux Suse Enterprise Server


Clock and Time Zone

Linux Suse Enterprise Server


Create New User

Linux Suse Enterprise Server


Authentication for the System
Administrator “root”

Linux Suse Enterprise Server


Installation Settings

Linux Suse Enterprise Server


Software

Linux Suse Enterprise Server


Registering SUSE Linux Enterprise and
Managing Modules/Extensions
Registering with YaST

Linux Suse Enterprise Server


Registering with YaST

Linux Suse Enterprise Server


additional packages

Linux Suse Enterprise Server


Adding Modules and Extensions with
YaST

Linux Suse Enterprise Server


Deleting Modules and Extensions with
YaST

Linux Suse Enterprise Server


Using the Expert Partitioner

Linux Suse Enterprise Server


Managing Btrfs Subvolumes using
YaST

Linux Suse Enterprise Server


Creating Volume Groups

Linux Suse Enterprise Server


Configuring Logical Volumes

Linux Suse Enterprise Server


Soft RAID Configuration

Linux Suse Enterprise Server


SUSE Linux Enterprise Server
Deployment Guide

https://documentation.suse.com/sles/15-SP1/html/SLES-all/book-sle-
deployment.html

Linux Suse Enterprise Server


Getting Started with the GNOME
Desktop
Logging In

Linux Suse Enterprise Server


Switching the Session Type Before
Logging In

Linux Suse Enterprise Server


Desktop Basics
• Applications menu
• Places menu
• Task switcher
• Notification indicator (not always visible)
• Workspace switcher
• Date and time
• Status icons

Linux Suse Enterprise Server


Managing Files and Directories

Linux Suse Enterprise Server


E-mail and Scheduling

Linux Suse Enterprise Server


Creating, Displaying, and
Decompressing Archives

Linux Suse Enterprise Server


Customizing Your Settings
GNOME Settings Dialog
• Personal
• Hardware
• System

Linux Suse Enterprise Server


Getting Started with the GNOME
Desktop
https://doc.opensuse.org/documentation/leap/archive/42.2/gnomeuser/h
tml/book.gnomeuser/cha.gnomeuser.start.html

Linux Suse Enterprise Server


Linux Suse Enterprise Server
LFAD211 - LINUX FUNDAMENTALS
AND ADMINISTRATION

Linux Suse Enterprise Server


Topics
• The Terminal
• Main Pages
• Info Pages
• Access Release Notes
• Install Package

Linux Suse Enterprise Server


The Terminal
• press the windows key on your keyboard. Type “Terminal” in the
popup search box
• click the icon with a “Terminal” title. OK
• To list directory contents, type ls in the terminal.

Linux Suse Enterprise Server


The Terminal
• ls /home - show all contents stored in your /home directory.
• -l: - display a long list with additional useful information like
permissions, file size and last modification time.
• -a - will show hidden files or sub directories
• pwd command stands for “print working directory and will show the
name of current working directory – means “where you are” right now
• cd command, stands for “change directory”, can change your current
working directory.

Linux Suse Enterprise Server


The Terminal
• rm is used for deleting files or directories.
• clear command will clear the terminal screen.
• mv command will move your files or directories to somewhere else.
• command <i>mkdir<i> means “make directory” and allows for the
creation of new directories.
• cp is a command used to copy files or directories.
• su command can help to switch to superuser.
• command poweroff shuts down the running system, while the
command reboot cares for a reset of your system.

Linux Suse Enterprise Server


Man Pages
• an essential part of any Linux system
• Man pages can be accessed with man followed by the name of the
command.
• displayed directly in the shell.
• MAN PAGES—CATEGORIES AND DESCRIPTIONS

Linux Suse Enterprise Server


Example: man man
will list how to use the command man.

Linux Suse Enterprise Server


Man page has of several parts
• NAME - name of the command or function, followed by a one-line
description of what it does.
• SYNOPSIS - a command, a formal description of how to run it and
what command line options it takes.
• DESCRIPTION - A textual description of the functioning of the
command or function.
• EXAMPLES - Some examples of common usage.
• SEE ALSO - A list of related commands or functions.

Linux Suse Enterprise Server


To navigate
• move up and down with Page ↑ and Page ↓.
• Move between the beginning and the end of a document with
[Home] and [End].
• End this viewing mode by pressing Q.
• P (previous page)
• N (next page)

Linux Suse Enterprise Server


man command in Linux with Examples
• No Option: It displays the whole manual of the command.
• Syntax :
• $ man [COMMAND NAME]
• Example:
• $ man printf

• Output:

Linux Suse Enterprise Server


Linux Suse Enterprise Server
man command in Linux with Examples
• Section-num: a manual is divided into multiple sections so this option
is used to display only a specific section of a manual.
• Syntax :
• $ man [SECTION-NUM] [COMMAND NAME]
• Example:
• $ man 2 intro

Linux Suse Enterprise Server


Linux Suse Enterprise Server
man command in Linux with Examples
• -f option: One may not be able to remember the sections in which a
command is present.
• Syntax:
• $ man -f [COMMAND NAME]
• Example:
• $ man -f ls

Linux Suse Enterprise Server


man command in Linux with Examples
• -a option: This option helps us to display all the available intro
manual pages in succession.
• Syntax:
• $ man -a [COMMAND NAME]
• Example:
• $ man -a intro

Linux Suse Enterprise Server


Linux Suse Enterprise Server
man command in Linux with Examples
• -k option: This option searches the given command as a regular
expression in all the manuals and it returns the manual pages with
the section number in which it is found.
• Syntax:
• $ man -k [COMMAND NAME]
• Example:
• $ man -k cd

Linux Suse Enterprise Server


man command in Linux with Examples

Linux Suse Enterprise Server


man command in Linux with Examples
-w option: This option returns the location in which the manual page of a
given command is present.

Syntax:
$ man -w [COMMAND NAME]
Example:
• $ man -w ls

Linux Suse Enterprise Server


man command in Linux with Examples
-I option: It considers the command as case sensitive.

Syntax:
$ man -I [COMMAND NAME]
Example:
• $ man -I printf

Linux Suse Enterprise Server


\

Linux Suse Enterprise Server


man command in Linux with Examples
• command ‘printf‘ is taken as case-sensitive i.e ‘printf‘ returns the
manual pages but ‘Printf‘ gives error.

Linux Suse Enterprise Server


Info Pages
• more detailed than man pages.
• divided into different nodes.
• pages that can be read with an info reader, which works much like a
web browser.
• To view the info page for a certain command, enter info followed by
the name of the command, for example, info ls.
– Use Space to move forward and <— to move backward. Within a node, you
can also browse with Page ↑ and Page ↓ but only Space and <— will take you
also to the previous or subsequent node. Press Q to end the viewing mode.
Not every command comes with an info page and vice versa.
– default location of info documentation is /usr/share/info.
– Syntax: info [OPTION]... [MENU-ITEM...]

Linux Suse Enterprise Server


Info Pages
• -a, –all: It use all matching manuals.
• -k, –apropos=STRING: It look up STRING in all indices of all manuals.
• -d, –directory=DIR: It add DIR to INFOPATH.
• -f, –file=MANUAL: It specify Info manual to visit.
• -h, –help: It display this help and exit.
• -n, –node=NODENAME: It specify nodes in first visited Info file.
• -o, –output=FILE: It output selected nodes to FILE.
• -O, –show-options, –usage: It go to command-line options node.
• -v, –variable VAR=VALUE: It assign VALUE to Info variable VAR.
• –version: It display version information and exit.
• -w, –where, –location: It print physical location of Info file.

Linux Suse Enterprise Server


Info Pages with Examples
• Examples:
• -a : It use all matching manuals and display them for a particular
command.
• info -a cvs

Linux Suse Enterprise Server


Info Pages with Examples
• -k : It look up STRING in all indices of all manuals and then display
the same.
• info -k cvs

Linux Suse Enterprise Server


Info Pages with Examples
• -d : It adds DIR to INFOPATH and also display the same.
• info -d cvs

Linux Suse Enterprise Server


Info Pages with Examples
• -O : It go to command-line options node for a particular command
and display the same.
• info -O cvs

Linux Suse Enterprise Server


Info Pages with Examples
• -w Command : It print physical location of Info file.
• info -w cvs

Linux Suse Enterprise Server


Info Pages with Examples
• To check for the manual page of info command, use the following
command:
• man info

• To check the help page of info command, use the following


command:
• info --help

Linux Suse Enterprise Server


Link for Man and Info Pages

https://documentation.suse.com/sles/12-SP4/html/SLES-all/cha-
adminhelp.html

Linux Suse Enterprise Server


Access Release Notes
• provides a high-level overview of features, capabilities, and
limitations of SUSE Linux.
– About the Release Notes
– Modules, Extensions, and Related Products
– Installation and Upgrade
– General Features & Fixes
– Specific Features & Fixes
– Known Issues & Workarounds
– Removed and Deprecated Features and Packages
– Obtaining Source Code
– Legal Notices
» https://www.suse.com/releasenotes/x86_64/SUSE-SLES/15-SP2/

Linux Suse Enterprise Server


Installing or Removing Software
• YaST's software management module to search for software
components you want to add or remove.
– Registering an Installed System
– Using the YaST Software Manager
– Managing Software Repositories and Services
– The GNOME Package Updater
– Updating Packages with GNOME Software

Linux Suse Enterprise Server


Installing or Removing Software

Linux Suse Enterprise Server


How to use
• Overview – Using Package Hub is as simple as, Register your
product, Enable the SUSE Package Hub extension and Search for
and install package.
• Availability - is available as a free extension to all users with valid
subscriptions.
• Enabling During Installation - the Package Hub extension can be
enabled and packages selected to be included during the initial OS
installation.
• Enabling Post Installation
– YaST2 Registration Module
– Enabling with SUSEConnect

Linux Suse Enterprise Server


Linux Suse Enterprise Server
LFAD211 - LINUX FUNDAMENTALS
AND ADMINISTRATION

Linux Suse Enterprise Server


Files and Directories
• Linux files are organized in a logical fashion for ease of
administration.

• This logical division of files is maintained in hundreds of directories


that are located in larger containers called file system.

• RED HAT LINUX follows the FILE SYSTEM Hierarchy


standard(FHS) for file organization.

Linux Suse Enterprise Server


File System
• Disk Based:
– DISK-based file systems are created on physical media such as
a hard disk.

• Memory- Based:
– Memory- based file systems, also called virtual file system, are
created at system boot up and destroyed at shut down.

Linux Suse Enterprise Server


Files System Tree
• The Linux file system structure is like an inverted tree with the root of
the tree at the top and branches and leaves at bottom.

• The top level is referred to as root and represented by forward


slash(/) character.
• Two file systems -/ and /boot- are created, by default, when RHEL is
installed.
• The custom installation procedure provided later in this, also creates
/var, /usr,/tmp,/opt and /home file systems in addition to / and /boot.

Linux Suse Enterprise Server


File System Tree
• These directories hold Static and Dynamic(or variable) information.

– The Static refers to file contents that are not usually modified.
– Static dir normally contain cmds, lib routines, kernel files, devices files, etc.
– The Dynamic or variable data refers to file contents that are modified as
required.
– DD hold log files, status files, configuration files, temporary files, etc.
• RHEL provides a graphical file manager called nautilus that can be
used to view and navigate within the directory structure.

Linux Suse Enterprise Server


Linux Directory Hierarchy

Linux Suse Enterprise Server


• The Binary directory (/bin):
– The binary directory contains crucial user executable commands.
– This directory holds static data files.
• The library directory (/lib):
– The library directory contains shared library files required by programs.
– It contains sub-directories that hold static data files.
• The System Binary Directory (/sbin):
– Most commands required at system up are located in the system binary
directory.
– In addition, most cmds requiring root privileges to run are also located here.
– The /sbin dir holds static data files.

Linux Suse Enterprise Server


• The etcetera directory(/etc):
– The etcetera directory holds most configuration files.
– The /etc dir contains dynamic data files.
• The lost+ found dir(/lost+found):
– This directory is used to hold files that become orphan after system crash.
– An orphan file is a file that has lost its name and it holds dynamic data.
• /root:
– This is default home directory location for the root user.
• /srv:
– This dir holds server data associated with database, website, etc.

Linux Suse Enterprise Server


• /boot:
– It contains linux kernels, boot loader and boot configuration files in addition to
other files required to boot RHEL.
– The /boot file system contains static data files.
• /var:
– /var contains data that frequently change while the system is up and running.
• UNIX system Resoucres file system(/usr):
– Disk based, this file system contains general files related to the system.

Linux Suse Enterprise Server


ext2
• The ext2 or second extended filesystem is a file system for the
Linux kernel.

• It was initially designed by Rémy Card as a replacement for the


extended file system (ext).
• ext2 was the default filesystem in several Linux distributions.
• ext2 is still the filesystem of choice for flash-based storage media
(such as SD cards, and USB flash drives), since its lack of a journal
minimizes the number of writes.

Linux Suse Enterprise Server


ext3
• ext3, or third extended filesystem, is a journaled file system that is
commonly used by the Linux kernel.

• It is the default file system for many popular Linux distributions.


• Its main advantage over ext2 is journaling, which improves reliability
and eliminates the need to check the file system after an unclean
shutdown.
• Its successor is ext4.

Linux Suse Enterprise Server


Journaling
• A journaling is a file system that keeps track of the changes that will
be made in a journal (usually a circular log in a dedicated area of the
file system) before committing them to the main file system.

• In the event of a system crash or power failure, such file systems are
quicker to bring back online (stable state)and less likely to become
corrupted.
• Journaling provides for fast and effective recovery in case of disk
crashes, instead of using e2fsck or fsck.

Linux Suse Enterprise Server


ReiserFS
• The Reiser file system is a journaling FS designed for fast server
performance, especially in directories containing thousands of files.

• It is more space efficient than most other file system, because it


does not take up a minimum of one block per file.
• If we want to write a bunch of really small files to disk, ReiserFS
squeezes them all into one block instead of writing one small file to
one block file.

Linux Suse Enterprise Server


Linux Suse Enterprise Server
LFAD211 - LINUX FUNDAMENTALS
AND ADMINISTRATION

Linux Suse Enterprise Server


Managing Files and Directories
• manage the files on your system and using a shell prompt

• details of using a shell prompt

• method of management

Linux Suse Enterprise Server


File System Terms
• extension
– An extension is that part of a filename that is found after the final ".". In the
filename foo.txt ".txt" is the le's extension. Extensions are used to indicate le
type.

• path
– A path is the string of directories and sub-directories you would have to
navigate through in order to reach a given location in the le system.

Linux Suse Enterprise Server


File System Terms
• root access
– To have root access means to be logged in using the root account. This can be
done from the main login screen, a shell prompt, or any application that
requires your root password. Root access means that the user has permission
to do anything on the system, so use root access with care.

• root directory
– The root directory is the top-most directory of the le system. All other les and
directories exist in this directory or one of its sub-directories. Do not confuse
the root directory, /, with root's home directory, /root/.

Linux Suse Enterprise Server


Larger Picture of the File System
• Every operating system has a method of storing data in files and
directories so that it can keep track
• of additions, modifications, and other changes. In Red Hat Enterprise
Linux, every file is stored in
• a directory. Directories can also contain directories: these
subdirectories may also contain files and
• other subdirectories. You might think of the le system as a tree and
• directories as branches.
• away the directories branch, everything is connected to the root
directory, which is represented as a
• singe forward slash (/).

Linux Suse Enterprise Server


Paths

/home/user/

Linux Suse Enterprise Server


Managing Files
• File Types
• Naming Conventions
• Finding the Correct File Extension

Linux Suse Enterprise Server


Managing Files-File Types

Linux Suse Enterprise Server


Managing Files-File Types
– Compressed and Archived Files
– .bz2. a file compressed with bzip2
– .gz. a file compressed with gzip
– . .tar. a file archived with tar (short for tape archive), also known as a tar file
– . .tbz or .tar.bz. a tarred and bzipped le
– . .tgz or .tar.gz. a tarred and gzipped le
– . .zip.a le compressed with ZIP compression, commonly found in MS-DOS
applications; most compressed les for Linux use the gzip compression, so
nding a .zip archive for Linux les is rare

Linux Suse Enterprise Server


Managing Files-File Formats
• .au. an audio le
• .gif. a GIF image le (short for Graphics Interchange Format)
• .html or .htm. an HTML le (short for Hyper Text Markup Language)
• .jpg. a JPEG image le (short for Joint Photographic Experts Group)
• .pdf. an electronic image of a document; PDF stands for Portable Document Format
• .png. a PNG image le (short for Portable Network Graphic)
• .ps. a PostScript file; formatted for printing
• .txt. a plain ASCII text file
• .wav. an audio le
• .xpm. an image le (short for X Pixelmap)

Linux Suse Enterprise Server


Managing Files-File Types
• Programming and Scripting Files
– .c . a C program language source code le
– .cpp . a C++ program language source
– code le
– .h . a C or C++ program language header le
– .o . a program object le
– .pl . a Perl script
– .py. a Python script
– .so . a library file
– .sh. a shell script
– .tcl . a TCL script

Linux Suse Enterprise Server


Managing Files
• File Types
• Naming Conventions
• Finding the Correct File Extension

Linux Suse Enterprise Server


Managing Files
• Naming Conventions
– Dot Files
– Using Spaces in File Names
– Using Symbols in File Names
– Files with Multiple Extensions

Linux Suse Enterprise Server


Managing Files
• Naming Conventions
– Dot Files
– Using Spaces in File Names
– Using Symbols in File Names
– Files with Multiple Extensions

Linux Suse Enterprise Server


Managing Files
• Naming Conventions
– Dot Files
– Using Spaces in File Names
– Using Symbols in File Names
– Files with Multiple Extensions

Linux Suse Enterprise Server


Managing Files-Dot Files
• Files whose name begins with a ".", called "dot" files, are hidden
files. These files can be viewed in both graphical file managers like
Nautilus and from the shell prompt, but require an extra step to
reveal them. command ls –al used for view the hidden files in your
home directory,

– How to make hidden file or folder?


– Touch .extension Mkdir .extension

Linux Suse Enterprise Server


Using Spaces in File Names
• While Linux allows file names with spaces in them, manipulating
these files from a shell prompt can be quite cumbersome.

Linux Suse Enterprise Server


Using Symbols in File Names

• It is possible to use punctuation marks in your file names. However,


be aware that these special characters have special meaning to the
shell and may cause errors at a shell prompt. It is generally
recommended that you avoid using special characters in file names
for this reason. If you choose to use file names with special
characters, use quotes around the file names when manipulating
them from a shell prompt.
• You cannot use a "/" — this indicates a directory.

Linux Suse Enterprise Server


File Compression and Archiving
• It is useful to store a group of files in one file for easy backup, for transfer to
another directory, or for transfer to another computer. It is also useful to compress
large files; compressed files take up less disk space and download faster via the
Internet.
• It is important to understand the distinction between an archive file and a
compressed file. An archive file is a collection of files and directories stored in one
file. The archive file is not compressed — it uses the same amount of disk space
as all the individual files and directories combined. A compressed file is a collection
of files and directories that are stored in one file and stored in a way that uses less
disk space than all the individual files and directories combined. If disk space is a
concern, compress rarely-used files, or place all such files in a single archive file
and compress it.

Linux Suse Enterprise Server


• File Compression and Archiving with GUI
– Applications >> accessories >> archive manager
• File Compression and Archiving
– Shell prompt File Compression and Archiving
• Bzip2 and Bunzip2
• bzip2 filename. extinction bunzip2 filename.ext.bz2

Compression File Extension Decompression


Tool Tool
Bzip2 .bz2 Bunzip2
Gzip .gz Gunzip
Zip .zip Unzip

Linux Suse Enterprise Server


File Compression and Archiving
• Shell prompt Zip unzip

• To compress a file with zip, enter the following command: zip –r


filename.zip filesdir
• The -r option specifies that you want to include all files contained in
the filesdir directory recursively.
• Zip –r filename.zip collection items
• Zip –r z.zip a b s q.png

Linux Suse Enterprise Server


File Compression and Archiving
• Tar

– Tar –cvf coll.tar 1 2 3 4 5 6 dirA dirB dirC

Filename for archiving

Linux Suse Enterprise Server


File Compression and Archiving
• List Content of tar Archive File

• Tar –tvf coll.tar

• Add Files or Directories to tar Archive File


• Tar –rvf coll.tar 1 2 3 4 5 6

• Check the Size of the tar, tar.gz and tar.bz2 Archive File
• Tar –czf – coll.tar | wc -c

Linux Suse Enterprise Server


File Compression and Archiving
• Tar

• Compression and Archiving


– z.Tar >>>> z.tar.gz
– Gzip z.tar

Linux Suse Enterprise Server


Managing Files and Directories
• Creating Directories
• Creating Directories
• Deleting Directories
• Dot Directories .

• To create a new directory using a shell


prompt, use the command mkdir. Enter: mkdir

Linux Suse Enterprise Server


Managing Files and Directories
• Deleting Directories
– right click on it and choose Move to Trash, or click and drag the icon to the
Trash on the Desktop.

– To delete an empty directory from a shell prompt, enter the command rmdir.

– To delete a directory that may not be empty (and consequently everything


inside that directory), enter the command rm - rf
– <directory>.

Linux Suse Enterprise Server


Managing Files and Directories
• Dot Directories
– Mkdir .name

Linux Suse Enterprise Server


Linux Suse Enterprise Server

You might also like