SlideShare ist ein Scribd-Unternehmen logo
1 von 26
Learning Linux – Part 2




        CentOS 6.2
Topics
• Command-Line Basics

• Permissions

• Using the man Command

• Hard and Soft Links

• Network settings

• Creating RPMs

• Repositories and working with YUM

• Kernel Modes

• Resizing Partitions
Command-line Interfaces
Ctrl + Alt + <F2 - F6> (multiple logins simultaneously)
Navigating Files and Directories

man <command>                manuals                   lists information about the command
ls                           list                      lists all non-hidden contents of a directory
cd <directory>               change directory          moves into a directory located within
                                                       current directory
cat <file>                   concatenate files         print file contents to screen
cp <file1> <file2>           copy                      creates a new file2 with file1 contents
rm <file name>               remove                    removes the file
mv <file1> <new filename>    move                      renames file1
mv <file1> <location>        move                      moves file1 to a new location
cd ..                        change directory          moves up a folder
mkdir <new directory name>   make directory            makes a new directory
pwd                          print working directory   lists pathname of the current directory
cd ~<username>               change directory          move into the home directory of user
cd <directory path>          change directory          moves into the directory
rm -r <directory name>       remove recursively        removes a directory and its contents
Tar Archiving and Gzip Compression
Archiving - grouping multiple files together in a single file to save space
and make it easier to transfer the files around

Compressing - replacing a single file with a smaller/compressed
version to save space

Tar - a type of archiver most common to Linux

Gzip - a type compressor most common to Linux

To extract .tar.gz files:
    tar -xvzf <filename>
        tar -xvzf example.tar.gz
To create a new .tar.gz file:    
    tar -cpzf <filename> <foldername>
                tar -cpzf newArchive.tar.gz images
Users and Groups

Command                         Definition    Purpose
su                              substitute    Similar to logging into your computer
                                user          as administrator
useradd  <username>             user add      adds a new user

passwd <username>               password      changes or creates new password

groupadd <groupname>            group add     creates new group

usermod  <options> <username>   user modify modifies the user
                                            Ex. adding user to group
userdel  <username>             user delete   deletes a user

groupdel  <groupname>           group delete deletes a group
Permissions Format

• A permission has a total of 10 characters.
• There are no empty spaces
                                       ugo
                                       Permission Format
                                       u - user/owner
                                       g - users of the owning
                                       group
                                       o - any other user
Permissions Characters
Identifier categories
 • -     file identifier
 • d directory identifier
  
rwx categories
 • r     read (able to open/view files as well as view contents of folders)
 • w write (able to edit/rename/save files and folders)
 • x execute (able to run a program)
 • -     place holder (does not have the privilege)
Permissions Commands
    • Changing permissions can be done with the command chmod in the terminal

        Command                              Definition    Purpose
        ls -lh                               list          lists a long humanly
                                                           readable list of all files
        chmod <u,g,o> <+,-,=> <r,w,x>        change mode   changes permissions of
                                                           files
 
    • chmod can be used with multiple modifiers

        Modifier     Purpose

          +          adds to current permissions

          -          takes away from current
                     permissions
          =          erases previous permissions and
                     sets new ones
Permissions
• You can set who can access specific files by changing user
  and group owner

• The superuser (root) has full access and can change any
  permission, even for files that don't belong to the root
  account.
                                 
Command                        Definition     Purpose

chown <username> <filename>    change owner   changes the owner of a file

chgrp <groupname> <filename>   change group   changes the group owner
                                              of a file
The man command
• The Linux man pages are the most helpful
  tool to the for the test.




• The above is a manual page for the ls
  command
Strategies and Use
• The manual pages are organized in the order:
   – Name, Synopsis, Description, and Options

• The options are organized into subcategories:
   – User Commands, System Calls, C Library Functions,
     Devices and Special Files, File Formats and
     Conventions, Games, Miscellanea, System
     Administration.

• If you know what you are looking for and where to look it
  saves a lot of time

• Syntax for the command is as follows:
   man <command> <options>
   man –k <something> | less    
Strategies and Use

• Once you are in a man page, there are other ways
  to help narrow down what you are looking for.




• By typing /<search parameter> and hitting Enter,
  you can search for key words within the manual.
  Sequentially typing / and hitting Enter bring up the
  next occurrences of your search.
Strategies and Use

• When searching, pressing the space bar will take
  you down one page and help ensure you don’t
  miss anything
• To close a manual page, type q or hit ctrl-c which
  is the stop current command hot key

• One other method for finding the correct command
  is through /sbin where all the executable
  commands are stored. Scrolling through the list
  with | less can help jog a person’s memory
Hard and Soft Links

• Every file has two parts, a data structure and file
  name structure.
• The data structure is associated with an inode.
• The file structure is the name and the associated
  inode number that references where the data is
  stored.

• A hard link refers to more than one file with the
  same inode number.
• A soft link is a reference to another file or directory
  with a different inode number than the original file.
Hard and Soft Links




• ls –lia    Shows inode numbers of files
Create hard links
• ln <source-filename> <link-filename>
Create soft Links
• ln –s <source-filename> <link-filename>
Network Settings
To display the current network settings, use the command:
       ifconfig

This will list all the different interfaces. Choose the one you want and
use the command:
       ifconfig <interface> <ip address> netmask <netmask> up

To set the default connection, use the command
       route add default gw <default gateway>

To set the DNS, modify the /etc/resolv.conf with the vi or grep text
editor.

It should resemble nameserver <DNS Address>

To configure network with DHCP, run the command dhclient –r which
will release the current client. After run dhclient to obtain a new IP.
Creating RPMs
RPM is the package management system used by Red Hat
  Enterprise Linux and many other Linux distributions.

Basic Usage:
   $ rpm -ivh demofile-1.0.0-i386.rpm
   i for install, v for verbose, h for process hash

   $ rpm -ql demofile
   q for query, l for list files

   $ rpm -e demofile
   e for erase
Setup:
$ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
$ mkdir -p ~/rpmbuild/RPMS/{noarch,i386,i686}
YUM Repositories

Yellowdog Updater Modified
Package manager for .rpm files that allows the installation of new packages, removal of old packages, and
automatic system updates

yum install <application>
    yum install nano
yum update <application>
    yum update flash-plugin
yum update (no other parameters)
yum remove <application>
    yum remove vim
yum list
Kernel Modes
• Within every Linux operating system there are the
  six basic runlevels.




• The runlevel is the state of the machine after boot.
• A typical computer boots into runlevel 5. This
  usually contains a GUI and networking.
Kernel Modes
• These runlevels can be accessed in three main
  ways
   – With the init command
   – Modifying the /etc/inittab file that controls what
     the computer boots into
   – Changing command sent by the GRUB
     Bootloader

**Note when running init command or modifying
  innitab file, you need root privileges.**
Kernel Modes
• When you start up a computer, press any key to
  load the grub menu when the loading screen
  appears




• It will then take you to the GRUB menu
• Once in the menu, you can scroll up and down to
  chose which version of Linux you would like to
  load.
Kernel Modes
• You also have the option to open the grub
  command line when you press c.
• To modify boot command, press e.
• To change the runlevel the computer boots into,
  add a space at the end of the command and type
  the runlevel code (1-6) and hit Enter
• Once loaded into one of the runlevels you can
  modify the root password with passwd
• To change runlevels after loading into a runlevel,
  use init <runlevel id #> (Root only).
Kernel Modes
• How is this secure?
• You can establish a GRUB menu password with
  the command grub-md5-crypt, but this has its
  drawbacks.
   – If you forget GRUB password, you may need to
     backup your computer and reinstall the
     operating system through the BIOS and wipe the
     hard drive.
Summary
• Command-Line Basics

• Permissions

• Using the man Command

• Hard and Soft Links

• Network settings

• Creating RPMs

• Repositories and working with YUM

• Kernel Modes

• Resizing Partitions
Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileKenny (netman)
 
Linux files and file permission
Linux files and file permissionLinux files and file permission
Linux files and file permissionU.P Police
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3Gourav Varma
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheetWe Ihaveapc
 
Access control list acl - permissions in linux
Access control list acl  - permissions in linuxAccess control list acl  - permissions in linux
Access control list acl - permissions in linuxSreenatha Reddy K R
 
File systems and inodes
File systems and inodesFile systems and inodes
File systems and inodesDr. Girish GS
 
Hadoop Interacting with HDFS
Hadoop Interacting with HDFSHadoop Interacting with HDFS
Hadoop Interacting with HDFSApache Apex
 
Unix command
Unix commandUnix command
Unix commandAtul Pant
 

Was ist angesagt? (20)

Linux fundamental - Chap 03 file
Linux fundamental - Chap 03 fileLinux fundamental - Chap 03 file
Linux fundamental - Chap 03 file
 
Linux files and file permission
Linux files and file permissionLinux files and file permission
Linux files and file permission
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Marwan al suwaidi
Marwan al suwaidiMarwan al suwaidi
Marwan al suwaidi
 
Hadoop Introduction
Hadoop IntroductionHadoop Introduction
Hadoop Introduction
 
Basic
BasicBasic
Basic
 
Raj linux
Raj linux Raj linux
Raj linux
 
Linux commands
Linux commandsLinux commands
Linux commands
 
File permissions
File permissionsFile permissions
File permissions
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux command line cheatsheet
Linux command line cheatsheetLinux command line cheatsheet
Linux command line cheatsheet
 
Unix Basics For Testers
Unix Basics For TestersUnix Basics For Testers
Unix Basics For Testers
 
Linux cheat-sheet
Linux cheat-sheetLinux cheat-sheet
Linux cheat-sheet
 
Access control list acl - permissions in linux
Access control list acl  - permissions in linuxAccess control list acl  - permissions in linux
Access control list acl - permissions in linux
 
Basic linux day 5
Basic linux day 5Basic linux day 5
Basic linux day 5
 
Linux commands
Linux commandsLinux commands
Linux commands
 
File systems and inodes
File systems and inodesFile systems and inodes
File systems and inodes
 
Hadoop Interacting with HDFS
Hadoop Interacting with HDFSHadoop Interacting with HDFS
Hadoop Interacting with HDFS
 
Unix command
Unix commandUnix command
Unix command
 

Andere mochten auch

Andere mochten auch (6)

Cent OS-book
Cent OS-bookCent OS-book
Cent OS-book
 
Calculator 2
Calculator 2Calculator 2
Calculator 2
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux File System
Linux File SystemLinux File System
Linux File System
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 

Ähnlich wie Learning Linux v2.1

File handling and permisions.pptx
File handling and permisions.pptxFile handling and permisions.pptx
File handling and permisions.pptxAkampaPhilomena
 
Topic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxTopic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxdulala3
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxRajesh Kumar
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1Lilesh Pathe
 
05. Ubuntu Terminal Commands.pptx
05. Ubuntu Terminal Commands.pptx05. Ubuntu Terminal Commands.pptx
05. Ubuntu Terminal Commands.pptxDIVKAGAMESTERBAIK
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptxPriyadarshini648418
 
Linux week 2
Linux week 2Linux week 2
Linux week 2Vinoth Sn
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Chander Pandey
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to LinuxDimas Prasetyo
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unixsouthees
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsDima Gomaa
 

Ähnlich wie Learning Linux v2.1 (20)

File handling and permisions.pptx
File handling and permisions.pptxFile handling and permisions.pptx
File handling and permisions.pptx
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Topic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptxTopic 3-1_More_Linux_Commands.pptx
Topic 3-1_More_Linux_Commands.pptx
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
05. Ubuntu Terminal Commands.pptx
05. Ubuntu Terminal Commands.pptx05. Ubuntu Terminal Commands.pptx
05. Ubuntu Terminal Commands.pptx
 
CSA-lecture 6.pptx
CSA-lecture 6.pptxCSA-lecture 6.pptx
CSA-lecture 6.pptx
 
2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx2. UNIX OS System Architecture easy.pptx
2. UNIX OS System Architecture easy.pptx
 
Group13
Group13Group13
Group13
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
Unix cmc
Unix cmcUnix cmc
Unix cmc
 
Linux Presentation
Linux PresentationLinux Presentation
Linux Presentation
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Linux Fundamentals
Linux FundamentalsLinux Fundamentals
Linux Fundamentals
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 

Kürzlich hochgeladen

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 

Kürzlich hochgeladen (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 

Learning Linux v2.1

  • 1. Learning Linux – Part 2 CentOS 6.2
  • 2. Topics • Command-Line Basics • Permissions • Using the man Command • Hard and Soft Links • Network settings • Creating RPMs • Repositories and working with YUM • Kernel Modes • Resizing Partitions
  • 3. Command-line Interfaces Ctrl + Alt + <F2 - F6> (multiple logins simultaneously)
  • 4. Navigating Files and Directories man <command> manuals lists information about the command ls list lists all non-hidden contents of a directory cd <directory> change directory moves into a directory located within current directory cat <file> concatenate files print file contents to screen cp <file1> <file2> copy creates a new file2 with file1 contents rm <file name> remove removes the file mv <file1> <new filename> move renames file1 mv <file1> <location> move moves file1 to a new location cd .. change directory moves up a folder mkdir <new directory name> make directory makes a new directory pwd print working directory lists pathname of the current directory cd ~<username> change directory move into the home directory of user cd <directory path> change directory moves into the directory rm -r <directory name> remove recursively removes a directory and its contents
  • 5. Tar Archiving and Gzip Compression Archiving - grouping multiple files together in a single file to save space and make it easier to transfer the files around Compressing - replacing a single file with a smaller/compressed version to save space Tar - a type of archiver most common to Linux Gzip - a type compressor most common to Linux To extract .tar.gz files:     tar -xvzf <filename>         tar -xvzf example.tar.gz To create a new .tar.gz file:         tar -cpzf <filename> <foldername>               tar -cpzf newArchive.tar.gz images
  • 6. Users and Groups Command Definition Purpose su substitute Similar to logging into your computer user as administrator useradd  <username> user add adds a new user passwd <username> password changes or creates new password groupadd <groupname> group add creates new group usermod  <options> <username> user modify modifies the user Ex. adding user to group userdel  <username> user delete deletes a user groupdel  <groupname> group delete deletes a group
  • 7. Permissions Format • A permission has a total of 10 characters. • There are no empty spaces ugo Permission Format u - user/owner g - users of the owning group o - any other user
  • 8. Permissions Characters Identifier categories • -     file identifier • d directory identifier   rwx categories • r     read (able to open/view files as well as view contents of folders) • w write (able to edit/rename/save files and folders) • x execute (able to run a program) • -     place holder (does not have the privilege)
  • 9. Permissions Commands • Changing permissions can be done with the command chmod in the terminal   Command Definition Purpose ls -lh list lists a long humanly readable list of all files chmod <u,g,o> <+,-,=> <r,w,x> change mode changes permissions of files   • chmod can be used with multiple modifiers Modifier Purpose + adds to current permissions - takes away from current permissions = erases previous permissions and sets new ones
  • 10. Permissions • You can set who can access specific files by changing user and group owner • The superuser (root) has full access and can change any permission, even for files that don't belong to the root account.   Command Definition Purpose chown <username> <filename> change owner changes the owner of a file chgrp <groupname> <filename> change group changes the group owner of a file
  • 11. The man command • The Linux man pages are the most helpful tool to the for the test. • The above is a manual page for the ls command
  • 12. Strategies and Use • The manual pages are organized in the order: – Name, Synopsis, Description, and Options • The options are organized into subcategories: – User Commands, System Calls, C Library Functions, Devices and Special Files, File Formats and Conventions, Games, Miscellanea, System Administration. • If you know what you are looking for and where to look it saves a lot of time • Syntax for the command is as follows: man <command> <options> man –k <something> | less    
  • 13. Strategies and Use • Once you are in a man page, there are other ways to help narrow down what you are looking for. • By typing /<search parameter> and hitting Enter, you can search for key words within the manual. Sequentially typing / and hitting Enter bring up the next occurrences of your search.
  • 14. Strategies and Use • When searching, pressing the space bar will take you down one page and help ensure you don’t miss anything • To close a manual page, type q or hit ctrl-c which is the stop current command hot key • One other method for finding the correct command is through /sbin where all the executable commands are stored. Scrolling through the list with | less can help jog a person’s memory
  • 15. Hard and Soft Links • Every file has two parts, a data structure and file name structure. • The data structure is associated with an inode. • The file structure is the name and the associated inode number that references where the data is stored. • A hard link refers to more than one file with the same inode number. • A soft link is a reference to another file or directory with a different inode number than the original file.
  • 16. Hard and Soft Links • ls –lia Shows inode numbers of files Create hard links • ln <source-filename> <link-filename> Create soft Links • ln –s <source-filename> <link-filename>
  • 17. Network Settings To display the current network settings, use the command: ifconfig This will list all the different interfaces. Choose the one you want and use the command: ifconfig <interface> <ip address> netmask <netmask> up To set the default connection, use the command route add default gw <default gateway> To set the DNS, modify the /etc/resolv.conf with the vi or grep text editor. It should resemble nameserver <DNS Address> To configure network with DHCP, run the command dhclient –r which will release the current client. After run dhclient to obtain a new IP.
  • 18. Creating RPMs RPM is the package management system used by Red Hat Enterprise Linux and many other Linux distributions. Basic Usage: $ rpm -ivh demofile-1.0.0-i386.rpm i for install, v for verbose, h for process hash $ rpm -ql demofile q for query, l for list files $ rpm -e demofile e for erase Setup: $ mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS} $ mkdir -p ~/rpmbuild/RPMS/{noarch,i386,i686}
  • 19. YUM Repositories Yellowdog Updater Modified Package manager for .rpm files that allows the installation of new packages, removal of old packages, and automatic system updates yum install <application>     yum install nano yum update <application>     yum update flash-plugin yum update (no other parameters) yum remove <application>     yum remove vim yum list
  • 20. Kernel Modes • Within every Linux operating system there are the six basic runlevels. • The runlevel is the state of the machine after boot. • A typical computer boots into runlevel 5. This usually contains a GUI and networking.
  • 21. Kernel Modes • These runlevels can be accessed in three main ways – With the init command – Modifying the /etc/inittab file that controls what the computer boots into – Changing command sent by the GRUB Bootloader **Note when running init command or modifying innitab file, you need root privileges.**
  • 22. Kernel Modes • When you start up a computer, press any key to load the grub menu when the loading screen appears • It will then take you to the GRUB menu • Once in the menu, you can scroll up and down to chose which version of Linux you would like to load.
  • 23. Kernel Modes • You also have the option to open the grub command line when you press c. • To modify boot command, press e. • To change the runlevel the computer boots into, add a space at the end of the command and type the runlevel code (1-6) and hit Enter • Once loaded into one of the runlevels you can modify the root password with passwd • To change runlevels after loading into a runlevel, use init <runlevel id #> (Root only).
  • 24. Kernel Modes • How is this secure? • You can establish a GRUB menu password with the command grub-md5-crypt, but this has its drawbacks. – If you forget GRUB password, you may need to backup your computer and reinstall the operating system through the BIOS and wipe the hard drive.
  • 25. Summary • Command-Line Basics • Permissions • Using the man Command • Hard and Soft Links • Network settings • Creating RPMs • Repositories and working with YUM • Kernel Modes • Resizing Partitions

Hinweis der Redaktion

  1. Linux is an open source operating system that developed from UNIX. Open source means that the source code of it is available for anyone to view unlike Windows or other operating systems where the source code is kept a secret. We will be focusing on the Fedora 15 distribution (formally known as Fedora Core) and its GNOME 3 GUI (which is the stuff you can actually see when you are clicking around on the desktop) that it comes with. GNOME isn&apos;t a standalone operating system itself. Fedora has a new release about every 6 months or so. Fedora 16 is scheduled for release for sometime this October. Each release includes a variety of new features and improvements.
  2. Remove white from icons and touch up left and right feet for white outlines on john’s penguin. Find or create images for hard and soft links and kernel modes (run levels)
  3. You can run your computer at different access levels at the same time. This is beneficial in the event that you yourself do not have the root password and you need access to another directory By using  su to substitute the user after login, you can run multiple levels in terminal. Also, running underneath of the GUI, hidden from view are a set of consoles. You can use these to log into multiple accounts at one time. The hot key to access them is Ctrl + Alt + F2 - F6. ensure you have more than just root account before starting this process **live demo procedure** - Ctrl + Alt + F2 - log into pooleuser account - Ctrl + Alt + F3 - log into root account Control + Alt + F7 takes you back to the GUI view.  You can switch back to the terminal windows at any time. - Ctrl + Alt + F7 There is also a terminal available in the GUI. *open terminal* To work in a terminal, you must know how to use commands. Commands are simply instructions given by the user, telling the computer to do something. The format of a command is command -options &lt;arguments&gt; . Commands normally have many options. This makes the command more flexible and allows you to better tell the computer what exaclty you want done. An argument is a filename or some other data given by the user to be used as an input with the command. To learn more about a command and its options, use the command man &lt;command&gt; to see the manual. Everthing done in the GUI can be done by commands in a terminal.
  4. These are a few basic commands to navigate through your files in a terminal. You have these and more commands listed on your handout.    cd &lt;new directory&gt; Moves you into that folder if it is inside of the folder where you are currently located. cd &lt;full file path&gt; Moves you to the path you specify. (can be anywhere as long as the path is correct) cd .. Moves you to the directory above the one you are currently located in.  If you are inside of /home/pooleuser/Downloads, it would move you into /home/pooleuser.  cd ~&lt;username&gt; Takes you directly to the home directory for the specified username. pwd Prints out the path of the directory you are currently located in. ls Lists all non-hidden files and folders that are inside of the directory you are located in. mkdir Creates a new directory with the name you provide. cp Copies a file and names the copy anything you want. rm Removes a file. rm - r Used to delete directories instead of files.  The -r tells rm to recursively remove directories and their contents. mv Moves or renames a file or folder. note: folder and file names are case sensitive  ensure that file named &amp;quot;stuff&amp;quot; is inside Documents folder before you begin the process **live demo procedure** - switch to terminal - ls command - cd Documents - ls - cp stuff stuff2 - rm stuff - ls - mv stuff2 stuff3 - ls - pwd - mv stuff3 /home/sdiviney - ls - cd .. - ls - mkdir Games - ls - cd Games - cd ~sdiviney - ls - rm -rf Games - ls - keep terminal open but open up add/remove software
  5. When a directory is not going to be used for a while, or is being moved, people often change them into compressed archives to save space. An archive is a single file composed of many files. A compressed file is a smaller version of its original file. This archive file, in this case a .tar file, is essentially just a bundle of a group of files. It may come in handy if you need to, for example, submit a bunch of files. With an archive file, you only have to submit one rather than each and every file it contains. One way of creating an archive file is with the tar command. Tar was originally used to write to tapes and so its name comes from tape archive. Taring something will not effect your original files. Gzip is the most common way to compress files in Linux.  Files archived with tar end in .tar, files compressed with gzip end in .gz, and compressed archives use both (.tar.gz). The tar command can compress/decompress gzip files with the -z option.    -z used when you are performing an operation with gzip (either compressing or decompressing a archive)   Tar also takes many other options. The most common are: -c create an archive file -x extract an archive file -t list the contents of an archive file -v (Verbose) prints out information to the screen as files and archives are processed -f allows you to specify the filename -p preserve file permissions when you compress them into the new archive To extract a .tar archive that hasn&apos;t been compressed with gzip,  tar -xvf &lt;.tar filename&gt; . To extract a .tar.gz file that has been compressed with gzip,  tar - xvzf &lt;tar.gz filename&gt; . To create a .tar archive from certain files or folders, tar - cvf &lt;newarchivename &lt;foldername/location&gt; To list all of the contents of a .tar archive, tar -tvf &lt;.tar filename&gt; To create a .tar.gz (compressed) file from certain files or folders tar -pczf &lt;newarchivename&gt; &lt;foldername/location&gt;  Tar is commonly used when installing new software. **live demo procedure** - 
  6. **live demo procedure** - make terminal active - su root - useradd guest - passwd guest - refresh user manager - switch back to terminal - groupadd pooleInterns - usermod -g pooleInterns guest - refresh user manager - close user manager (leave terminal open)
  7. The format of the permission information looks like this. The first character is where the type (-,d,l) will be specified. After this are three spaces for the permissions of the user owner, the group owner, and finally for everyone else or others. If the user, group, or others possesses the permission to read, write, or execute, the letter will appear in its place. If not, a dash will appear as a place holder.
  8. When you type the command ls -l, you will see a detailed list of everything in the current directory. The permissions information includes a dash, d, or l. This is to specify if it is a file, directory, or link. Also there will be a series of r, w, x and dashes. Every user and group has three permission options for a file. These are read, write, and execute. accomplished by using the terminal. *leave user manager open but push to back*
  9. The permissions of a file can be changed using the command chmod. Permissions can be added (+), taken away (-), or set to (=).   check to make sure that  you have completed the live demo for file navigation and that stuff3 is located inside of the home folder before you begin **live demo procedure** - open terminal window - ls -l - chgrp pooleInterns stuff3 - chown guest stuff3 - ls -l - chmod ugo+rwx sutff3 - ls -l - chmod o-rwx stuff3 - ls -l
  10. All files and directories have a user owner and a group owner. By default, this is the user who created it and the group that use is in. A file&apos;s user owner can be changed with the chown command and their group owner can be changed with the chgrp command.
  11. They are your own personal cheat sheet. Learning how to use the command is by far one of the most crucial parts of the test because if you forget how to do something, the manual pages may jog your memory and make the difference between a pass and a fail. So how do they work? Just about every shell command has a man page of varying degrees of length.
  12. The man command may seem like a very simple command; however, it is much more intuitive than one may think which makes it very useful. All the organization is visible if you man the man command. The syntax can be as simple or complicated as you want.
  13. Because they both reference the same data, modifying anythign about one file will change the hard link as well. If you delete the original file, the hard link will still work. Hard links cannot link directories. A soft link does not share change like a hard link, adapting new permissions when the original file or directory is modified. It is helpful because you can associate many file names with one file. If the original file is deleted, the soft links will not longer work.
  14. If you do not have a GUI, your IP can also be configured in a text based GUI (TUI) through the terminal. Once it is up, navigate through, choosing your ethernet card and IP address.   Interface statuses can be checked with the ifconfig command. If no arguement is given, the current working interface information will be output. **Live Demo Open up terminal run ifconfig   talk about all the information that is displays run through the GUI  
  15. RPM stands for RPM Package Manager. This package manager allows the installation of .rpm files.    YUM is a package manager based on rpm that allows the installation of new packages, removal, and automatic system updates. YUM is very powerful in that it automatically searches for and installs all dependencies needed for a program. RPM will not do this. Many people prefer YUM to RPM simply because of the dependencies issue. If a program has many dependencies, you will have to manually install each one with RPM and it could take you a very long time.   yum install &lt;application&gt; searches for, downloads, and installs the package you specify yum update &lt;application&gt; finds the package on your computer and downloads/installs updates for just that package yum update (no parameters) updates all packages you have installed on your computer that are not up to date. yum remove &lt;application&gt; uninstalls a specific package that you have on your computer yum list displays a list of all packages you currently have installed rpm -Uvih &lt;package name&gt; installs a .rpm file that is stored on your hard drive U - upgrade: checks to make sure the package you are about to install is the most recent version v - verbose: prints out useful information about the installation as it is progressing i - install: tells rpm that you are installing a new package h - hash: makes the display easier to read by separating out things with dashed lines
  16. RPM stands for RPM Package Manager. This package manager allows the installation of .rpm files.    YUM is a package manager based on rpm that allows the installation of new packages, removal, and automatic system updates. YUM is very powerful in that it automatically searches for and installs all dependencies needed for a program. RPM will not do this. Many people prefer YUM to RPM simply because of the dependencies issue. If a program has many dependencies, you will have to manually install each one with RPM and it could take you a very long time.   yum install &lt;application&gt; searches for, downloads, and installs the package you specify yum update &lt;application&gt; finds the package on your computer and downloads/installs updates for just that package yum update (no parameters) updates all packages you have installed on your computer that are not up to date. yum remove &lt;application&gt; uninstalls a specific package that you have on your computer yum list displays a list of all packages you currently have installed rpm -Uvih &lt;package name&gt; installs a .rpm file that is stored on your hard drive U - upgrade: checks to make sure the package you are about to install is the most recent version v - verbose: prints out useful information about the installation as it is progressing i - install: tells rpm that you are installing a new package h - hash: makes the display easier to read by separating out things with dashed lines
  17. Each runlevel has a specific purpose. 0 shuts down the machinem, 2 and 3 are like windows safe mode, with and without networking. 4 is not typically used. 5 is the normal run level and 6 will reboot the machine. Run level 1 is, however, very significantly different from the other runlevels because unlike the rest, it gives complete access to root user privileges. What this means is you can do anything, including change the root password. The general purpose for the other runlevels is for troubleshooting when the system is having problems, or you forgot your root password.
  18. Conclusion: Switching to Linux has advantages and disadvantages. This free, secure system has many distributions to chose from, though it may be annoying for you to switch over.    This concludes our presentation. We hope that it was informative and helped open your eyes to other options when choosing an operating system. Questions?