SlideShare a Scribd company logo
Shell Features
Section Overview

 I/O Substitution
 Pathname Substitution
 Parameter/Variable Substitution
 Command Substitution
UNIX Shell
 Enables users to enter commands
 Text based
 Similar to MSDOS Command
 Prompt (but are much more
 powerful)
 Common Shells
     Bourne: sh, ksh, bash
     C: csh, tcsh
Shell Features
 Environment variables and aliases
 History of commands used
 Programming constructs
 Added features in newer shells
     Command line editing
     Command line completion
 Shell configuration files
Command History/Editing
 Most shells maintain a history of
 previously entered commands
 history: View list of commands
 !#: Rerun command number #
 Command line editing
     Up/down arrow keys to cycle through list
     Left/right arrow keys to move within listed
      command
     <ctrl><a>: move to start of command line
     <ctrl><e>: move to end of command line
Command Aliases
 Shortcut for command line
 Set/view using the alias
 command
 Examples:
     alias ls='ls --color=tty'
     alias rm='rm –i'
Shell Variables
  Customize environment
  Shared settings for programs
  Assigning Variables: var=“value”
  Referencing Variables: $var
  Viewing variables: set, printenv
  Variables are case sensitive
Special Shell Variables
  HOME – User’s home directory path
  SHELL – Current shell
  UID – User’s UID number
  PATH – Program search path
  PS1/PS2 – Format for command
  prompt (prompt for csh/tcsh)

Must use “export” to set variables in shell
Parsing the Command Line
 Breaks the command line into
 components
 Special Characters modify
 operation
     How command runs
     Filename Expansion
     I/O redirection
     Quotes
Command Run Modifiers
 Write Space – Separate arguments
 Newline (<cr>) – End of line
 Special Characters
   Character                       Meaning
       ;       Separate multiple command on same line
      &        Run command in the background
              At end of line, continue on next line
    || &&      Logical operators based on exit status
Filename Expansion
 Special characters representing
 multiple filenames
 Also referred to as globbing
   Character                       Matches
      *        0 or more characters
      ?        1 character
     [ ]       Matches any 1 character in [ ]
               (including ranges)
     [^ ]      Matches any 1 character not in [ ]
               (including ranges)
I/O Redirection
  Modifies how input and output is
  used
  Chain command to solve bigger
      Characters                    Result
  tasks < file Use file as input for command
    command
    command > file    Store command output in file
   command >> file    Append command output to file
   command << label   Input from standard input until label
      `command`       Execute command then replace command
                      name with its output
     cmd1 | cmd2      Use output from cmd1 as input to cmd2
Standard File Descriptors
  Special file pointers for input and
  output
  Extension from C language
            Name            Descriptor   Default Device
 Standard input (stdin)         0          Keyboard
 Standard output (stdout)       1           Screen
 Standard error (stderr)        2           Screen
Using File Descriptors
  Finer control over input/output
  redirection
  stdout and stderr can be
  redirected to same file
        Characters                             Result
     command 2> file        stderr output stored in file
 cmd >& <file-descriptor>   Output redirected to <file-descriptor>
    Cmd > file 2>&1         Stderr & stdout redirected to file
Quote Characters
 Prevent special characters from
 being interpreted by the shell
  Character         Name                 Action
     ‘        Single Quote   Shell ignores all special
                             characters enclosed ‘ ’
     “        Double Quote   Shell ignores all special
                             characters enclosed “ ”
                             except for $ ‘ 
             Backslash      Shell ignores character
                             immediately following

More Related Content

What's hot

Linux shell env
Linux shell envLinux shell env
Linux shell env
Rahul Pola
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
Bhavesh Padharia
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
Artefactual Systems - AtoM
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
Anu Chaudhry
 
1 4 sp
1 4 sp1 4 sp
1 4 sp
Bhargavi Bbv
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
VIKAS TIWARI
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
Narendra Sisodiya
 
Introduction to shell
Introduction to shellIntroduction to shell
Introduction to shell
Arash Haghighat
 
BASH Shell Script Training in Noida- Rexton It Solution
BASH Shell Script Training  in Noida- Rexton It SolutionBASH Shell Script Training  in Noida- Rexton It Solution
BASH Shell Script Training in Noida- Rexton It Solution
CCNA Training Institute In Noida Rextion IT Solutions
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
Kalkey
 
101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4
Acácio Oliveira
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scripting
Akshay Siwal
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
Simon Su
 
3.1 gnu and unix commands v4
3.1 gnu and unix commands v43.1 gnu and unix commands v4
3.1 gnu and unix commands v4
Acácio Oliveira
 
Shell programming
Shell programmingShell programming
Shell programming
Moayad Moawiah
 
PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2
Bryan Cafferky
 
Intro commandline
Intro commandlineIntro commandline
Intro commandline
codeembedded
 
Powershell alias
Powershell aliasPowershell alias
Powershell alias
LearningTech
 
Enable https (1) Tibco document
Enable https (1) Tibco document Enable https (1) Tibco document
Enable https (1) Tibco document
Eodishaorg Paribaar
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 

What's hot (20)

Linux shell env
Linux shell envLinux shell env
Linux shell env
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Command-Line 101
Command-Line 101Command-Line 101
Command-Line 101
 
Shell Scripting in Linux
Shell Scripting in LinuxShell Scripting in Linux
Shell Scripting in Linux
 
1 4 sp
1 4 sp1 4 sp
1 4 sp
 
Bash shell scripting
Bash shell scriptingBash shell scripting
Bash shell scripting
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
Introduction to shell
Introduction to shellIntroduction to shell
Introduction to shell
 
BASH Shell Script Training in Noida- Rexton It Solution
BASH Shell Script Training  in Noida- Rexton It SolutionBASH Shell Script Training  in Noida- Rexton It Solution
BASH Shell Script Training in Noida- Rexton It Solution
 
Shell programming 1.ppt
Shell programming  1.pptShell programming  1.ppt
Shell programming 1.ppt
 
101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4101 3.1 gnu and unix commands v4
101 3.1 gnu and unix commands v4
 
Easiest way to start with Shell scripting
Easiest way to start with Shell scriptingEasiest way to start with Shell scripting
Easiest way to start with Shell scripting
 
Quick start bash script
Quick start   bash scriptQuick start   bash script
Quick start bash script
 
3.1 gnu and unix commands v4
3.1 gnu and unix commands v43.1 gnu and unix commands v4
3.1 gnu and unix commands v4
 
Shell programming
Shell programmingShell programming
Shell programming
 
PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2PowerShell Workshop Series: Session 2
PowerShell Workshop Series: Session 2
 
Intro commandline
Intro commandlineIntro commandline
Intro commandline
 
Powershell alias
Powershell aliasPowershell alias
Powershell alias
 
Enable https (1) Tibco document
Enable https (1) Tibco document Enable https (1) Tibco document
Enable https (1) Tibco document
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 

Similar to Lecture1 3 shells

Unix
UnixUnix
Unix
akaash08
 
Unix
UnixUnix
Unix
UnixUnix
Unix
yarmuqam
 
Using Unix
Using UnixUsing Unix
Using Unix
Dr.Ravi
 
COMELEC III - Bash unit 1
COMELEC III - Bash unit 1COMELEC III - Bash unit 1
COMELEC III - Bash unit 1
Binsent Ribera
 
Spsl by sasidhar 3 unit
Spsl by sasidhar  3 unitSpsl by sasidhar  3 unit
Spsl by sasidhar 3 unit
Sasidhar Kothuru
 
Linux
LinuxLinux
Linux
LinuxLinux
Linux
LinuxLinux
Linux
LinuxLinux
Linux com
Linux comLinux com
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent card
Bui Van Cuong
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
root_fibo
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
Manav Prasad
 
Formation sh
Formation shFormation sh
Formation sh
Nicolas Ledez
 
Mastering unix
Mastering unixMastering unix
Mastering unix
Raghu nath
 
intro unix/linux 08
intro unix/linux 08intro unix/linux 08
intro unix/linux 08
duquoi
 
Unix
UnixUnix
Ch03
Ch03Ch03
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1
Nihar Ranjan Paital
 

Similar to Lecture1 3 shells (20)

Unix
UnixUnix
Unix
 
Unix
UnixUnix
Unix
 
Unix
UnixUnix
Unix
 
Using Unix
Using UnixUsing Unix
Using Unix
 
COMELEC III - Bash unit 1
COMELEC III - Bash unit 1COMELEC III - Bash unit 1
COMELEC III - Bash unit 1
 
Spsl by sasidhar 3 unit
Spsl by sasidhar  3 unitSpsl by sasidhar  3 unit
Spsl by sasidhar 3 unit
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux com
Linux comLinux com
Linux com
 
Basic basic solaris quick referent card
Basic basic solaris quick referent cardBasic basic solaris quick referent card
Basic basic solaris quick referent card
 
Unit 6 bash shell
Unit 6 bash shellUnit 6 bash shell
Unit 6 bash shell
 
Shell scripting
Shell scriptingShell scripting
Shell scripting
 
Formation sh
Formation shFormation sh
Formation sh
 
Mastering unix
Mastering unixMastering unix
Mastering unix
 
intro unix/linux 08
intro unix/linux 08intro unix/linux 08
intro unix/linux 08
 
Unix
UnixUnix
Unix
 
Ch03
Ch03Ch03
Ch03
 
UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1UNIX - Class4 - Advance Shell Scripting-P1
UNIX - Class4 - Advance Shell Scripting-P1
 

More from nghoanganh

Tom tat lenh ubuntu
Tom tat lenh ubuntuTom tat lenh ubuntu
Tom tat lenh ubuntu
nghoanganh
 
Thi xa vung bien hoan thanh 04042013
Thi xa vung bien   hoan thanh 04042013Thi xa vung bien   hoan thanh 04042013
Thi xa vung bien hoan thanh 04042013
nghoanganh
 
Oxford thuong-yeu-truyen368-com-html
Oxford thuong-yeu-truyen368-com-htmlOxford thuong-yeu-truyen368-com-html
Oxford thuong-yeu-truyen368-com-html
nghoanganh
 
Mis11e ch06
Mis11e ch06Mis11e ch06
Mis11e ch06
nghoanganh
 
Mis11e ch03
Mis11e ch03Mis11e ch03
Mis11e ch03
nghoanganh
 
Mis11e ch02
Mis11e ch02Mis11e ch02
Mis11e ch02
nghoanganh
 
Mis11e ch01
Mis11e ch01Mis11e ch01
Mis11e ch01
nghoanganh
 
Mis11e ch05
Mis11e ch05Mis11e ch05
Mis11e ch05
nghoanganh
 
Chap14
Chap14Chap14
Chap14
nghoanganh
 
Chap13
Chap13Chap13
Chap13
nghoanganh
 
Chap11
Chap11Chap11
Chap11
nghoanganh
 
Chap8
Chap8Chap8
Chap8
nghoanganh
 
Chap7
Chap7Chap7
Chap7
nghoanganh
 
Chap6
Chap6Chap6
Chap6
nghoanganh
 
Chap5
Chap5Chap5
Chap5
nghoanganh
 
Chap4
Chap4Chap4
Chap4
nghoanganh
 
Chap3
Chap3Chap3
Chap3
nghoanganh
 
Chap2
Chap2Chap2
Chap2
nghoanganh
 
Chap1
Chap1Chap1
Chap1
nghoanganh
 
Chap17
Chap17Chap17
Chap17
nghoanganh
 

More from nghoanganh (20)

Tom tat lenh ubuntu
Tom tat lenh ubuntuTom tat lenh ubuntu
Tom tat lenh ubuntu
 
Thi xa vung bien hoan thanh 04042013
Thi xa vung bien   hoan thanh 04042013Thi xa vung bien   hoan thanh 04042013
Thi xa vung bien hoan thanh 04042013
 
Oxford thuong-yeu-truyen368-com-html
Oxford thuong-yeu-truyen368-com-htmlOxford thuong-yeu-truyen368-com-html
Oxford thuong-yeu-truyen368-com-html
 
Mis11e ch06
Mis11e ch06Mis11e ch06
Mis11e ch06
 
Mis11e ch03
Mis11e ch03Mis11e ch03
Mis11e ch03
 
Mis11e ch02
Mis11e ch02Mis11e ch02
Mis11e ch02
 
Mis11e ch01
Mis11e ch01Mis11e ch01
Mis11e ch01
 
Mis11e ch05
Mis11e ch05Mis11e ch05
Mis11e ch05
 
Chap14
Chap14Chap14
Chap14
 
Chap13
Chap13Chap13
Chap13
 
Chap11
Chap11Chap11
Chap11
 
Chap8
Chap8Chap8
Chap8
 
Chap7
Chap7Chap7
Chap7
 
Chap6
Chap6Chap6
Chap6
 
Chap5
Chap5Chap5
Chap5
 
Chap4
Chap4Chap4
Chap4
 
Chap3
Chap3Chap3
Chap3
 
Chap2
Chap2Chap2
Chap2
 
Chap1
Chap1Chap1
Chap1
 
Chap17
Chap17Chap17
Chap17
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
PECB
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
Colégio Santa Teresinha
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
ISO/IEC 27001, ISO/IEC 42001, and GDPR: Best Practices for Implementation and...
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
MARY JANE WILSON, A “BOA MÃE” .
MARY JANE WILSON, A “BOA MÃE”           .MARY JANE WILSON, A “BOA MÃE”           .
MARY JANE WILSON, A “BOA MÃE” .
 

Lecture1 3 shells

  • 2. Section Overview I/O Substitution Pathname Substitution Parameter/Variable Substitution Command Substitution
  • 3. UNIX Shell Enables users to enter commands Text based Similar to MSDOS Command Prompt (but are much more powerful) Common Shells  Bourne: sh, ksh, bash  C: csh, tcsh
  • 4. Shell Features Environment variables and aliases History of commands used Programming constructs Added features in newer shells  Command line editing  Command line completion Shell configuration files
  • 5. Command History/Editing Most shells maintain a history of previously entered commands history: View list of commands !#: Rerun command number # Command line editing  Up/down arrow keys to cycle through list  Left/right arrow keys to move within listed command  <ctrl><a>: move to start of command line  <ctrl><e>: move to end of command line
  • 6. Command Aliases Shortcut for command line Set/view using the alias command Examples:  alias ls='ls --color=tty'  alias rm='rm –i'
  • 7. Shell Variables Customize environment Shared settings for programs Assigning Variables: var=“value” Referencing Variables: $var Viewing variables: set, printenv Variables are case sensitive
  • 8. Special Shell Variables HOME – User’s home directory path SHELL – Current shell UID – User’s UID number PATH – Program search path PS1/PS2 – Format for command prompt (prompt for csh/tcsh) Must use “export” to set variables in shell
  • 9. Parsing the Command Line Breaks the command line into components Special Characters modify operation  How command runs  Filename Expansion  I/O redirection  Quotes
  • 10. Command Run Modifiers Write Space – Separate arguments Newline (<cr>) – End of line Special Characters Character Meaning ; Separate multiple command on same line & Run command in the background At end of line, continue on next line || && Logical operators based on exit status
  • 11. Filename Expansion Special characters representing multiple filenames Also referred to as globbing Character Matches * 0 or more characters ? 1 character [ ] Matches any 1 character in [ ] (including ranges) [^ ] Matches any 1 character not in [ ] (including ranges)
  • 12. I/O Redirection Modifies how input and output is used Chain command to solve bigger Characters Result tasks < file Use file as input for command command command > file Store command output in file command >> file Append command output to file command << label Input from standard input until label `command` Execute command then replace command name with its output cmd1 | cmd2 Use output from cmd1 as input to cmd2
  • 13. Standard File Descriptors Special file pointers for input and output Extension from C language Name Descriptor Default Device Standard input (stdin) 0 Keyboard Standard output (stdout) 1 Screen Standard error (stderr) 2 Screen
  • 14. Using File Descriptors Finer control over input/output redirection stdout and stderr can be redirected to same file Characters Result command 2> file stderr output stored in file cmd >& <file-descriptor> Output redirected to <file-descriptor> Cmd > file 2>&1 Stderr & stdout redirected to file
  • 15. Quote Characters Prevent special characters from being interpreted by the shell Character Name Action ‘ Single Quote Shell ignores all special characters enclosed ‘ ’ “ Double Quote Shell ignores all special characters enclosed “ ” except for $ ‘ Backslash Shell ignores character immediately following