Customizing Linux Environment Tutorial 4 ENGR 3950U / CSCI 3020U Operating Systems Instructor: Dr. Kamran Sartipi.

Slides:



Advertisements
Similar presentations
Bash startup files Linux/Unix files stty 1.  midterms  bash startup files  stty 2.
Advertisements

NETW-240 Shells Last Update Copyright Kenneth M. Chipps Ph.D. 1.
Chapter Seven Unix Shell Environments1 System Programming UNIX Shell Environments.
Linux+ Guide to Linux Certification, Second Edition
Linux+ Guide to Linux Certification, Second Edition
CS 497C – Introduction to UNIX Lecture 36: - Customizing the Environment Chin-Chih Chang
Guide To UNIX Using Linux Third Edition
Guide to Linux Installation and Administration, 2e1 Chapter 6 Using the Shell and Text Files.
Shell Programming, or Scripting Shirley Moore CPS 5401 Fall August 29,
Advanced Shell Programming. 2 Objectives Use techniques to ensure a script is employing the correct shell Set the default shell Configure Bash login and.
Introduction to Linux Operating System Tutorial 1
8 Shell Programming Mauro Jaskelioff. Introduction Environment variables –How to use and assign them –Your PATH variable Introduction to shell programming.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
Shell Features CSCI N321 – System and Network Administration Copyright © 2000, 2005 by Scott Orr and the Trustees of Indiana University.
Shells. A program that is an interface between a user at a terminal and the computers resouces ▫The terminal may be real or an emulator The shell is.
Linux Shell Programming Tutorial 3 ENGR 3950U / CSCI 3020U Operating Systems Instructor: Dr. Kamran Sartipi.
Linux+ Guide to Linux Certification, Second Edition
Introduction to Unix – CS 21 Lecture 9. Lecture Overview Shell description Shell choices History Aliases Topic review.
Bash startup files Linux/Unix files stty Todd Kelley CST8207 – Todd Kelley1.
Workbook 6 – Part 1 The Bash Shell
UNIX/LINUX Shells Shell is an UNIX/LINUX command interpreter. Shell command can be internal or external. The code to execute an internal command is part.
Linux+ Guide to Linux Certification, Third Edition
Linux Operations and Administration
Basic Shell Scripting - Part 1 Objective - Learn to: Read Start-up Files Edit Start-up Files Modify Your User Environment Communicate with Users Write.
CS465 - UNIX The Bourne Shell.
Workbook 6 – Part 2 The Bash Shell
Linux+ Guide to Linux Certification Chapter Eight Working with the BASH Shell.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
Introduction to Unix Shell & Scripting with csh/tcsh  Brief Unix History  Unix Shell & Flavor  CSH/TCSH Scripts.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Writing Scripts Hadi Otrok COEN 346.
Unix Shell Environments February 23rd, 2004 Class Meeting 6.
Chapter 4 LINUX Shells. Table 4.1 Shell Locations and Program Names.
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
UNIX shell environments CS 2204 Class meeting 6 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
User Environments Objectives –to provide appropriate environments for different types of users Contents –different login programs –user profiles –restricted.
UNIX shell environments CS 2204 Class meeting 4 Created by Doug Bowman, 2001 Modified by Mir Farooq Ali, 2002.
LING 408/508: Programming for Linguists Lecture 8 September 23 rd.
Customizing the Shell Environment. UNIX Shells Two characteristics of shells –Interactive: prompts ($) and waits for your response/requests –Noninteractive:
CSCI 330 UNIX and Network Programming Unit III Shell, Part 1.
Chapter 8: The Bourne Again Shell It’s a command interpreter, it’s a programming language, and it makes a mean martini.
Jozef Goetz, expanded by Jozef Goetz, 2006 Credits: Parts of the slides are based on slides created by textbook authors, Syed M. Sarwar, Robert.
Linux+ Guide to Linux Certification, Second Edition
Introduction to Bash Shell. What is Shell? The shell is a command interpreter. It is the layer between the operating system kernel and the user.
Agenda The Linux File System (chapter 4 in text) Setting Access Permissions Directory vs File Permissions chmod Utility Symbolic Method Absolute Method.
Configuration your environment Many user-configurable Unix programs (such as your shell) read configuration files when they start up. These configuration.
Lecture 1: Introduction, Basic UNIX Advanced Programming Techniques.
1 Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
Class Introduction. Agenda Syllabus Topics Text etc.
Linux Administration Working with the BASH Shell.
Agenda Customizing a Unix/Linux account Environment Introduction to Start-up Files (.bash_profile,.bashrc,.profile,.kshrc) Safe Methods for Changing Start-up.
LX0-104 Dumps PDF CompTIA Linux+ Powered by LPI 2
Shells.
SUSE Linux Enterprise Desktop Administration
Introduction to Shells
Shell Features CSCI N321 – System and Network Administration
CAP652 Lecture - Shell Programming
UNIX and Shell Programming (06CS36)
Download LX0-104 Exam Dumps Questions & Answers - LX0-104 Braindumps Dumps4download
LING 408/508: Computational Techniques for Linguists
CHAPTER 8 (skip , ) CHAPTER 10
John Carelli, Instructor Kutztown University
The Linux Command Line Chapter 11
Linux Shell Script Programming
CSE 303 Concepts and Tools for Software Development
Unix Shell Environments
Introduction to Bash Programming, part 3
The Linux Command Line Chapter 11
Presentation transcript:

Customizing Linux Environment Tutorial 4 ENGR 3950U / CSCI 3020U Operating Systems Instructor: Dr. Kamran Sartipi

Customizing Shell  Making it more user-friendly  Adjusting it to your specific needs  There are jobs you repeat everyday  Complicated tasks  Commands you always forget

Important files  BASH  /etc/bashrc System wide functions and aliases  /etc/profiles System wide environment and start-up programs  ~/.bash_profile  ~/.bash_login  ~/.profile  ~/.bashrc

BASH Invocation Order  We have: login shell and interactive shell  Login shells: On login: if /etc/profile exists, source it. if ~/.bash_profile exists, source it, else if ~/.bash_login exists, source it, else if ~/.profile exists, source it. On exit: if ~/.bash_logout exists, source it.  Non-login interactive shells: On startup: if ~/.bashrc exists, source it.

Alias  Create an alias, aliases allow a string to be substituted for a word when it is used as the first word of a simple command.  SYNTAX: alias [-p] [name[=value]...] unalias [-a] [name... ]  If arguments are supplied, an alias is defined for each name whose value is given. If no value is given, `alias' will print the current value of the alias.

Alias Examples  alias nic 'nice +12 emacs -i -r -geometry 80x &‘  alias gh 'ghostview &‘  alias mca='mc -a‘  alias fnd 'find. -name "\!*" -print‘  alias which='alias | /usr/bin/which --tty- only --read-alias --show-dot --show-tilde‘  alias l.='ls -d.* --color=tty'  alias ll='ls -l --color=tty'  alias ls='ls --color=tty'

Export  Export Set an environment variable. Mark each name to be passed to child processes in the environment. Set an environment variable. Mark each name to be passed to child processes in the environment.  SYNTAX export [-fn] [-p] [name[=value]] export [-fn] [-p] [name[=value]]  OPTIONS -f The names refer to shell functions; -f The names refer to shell functions; otherwise the names refer to shell variables otherwise the names refer to shell variables -n No longer mark each name for export. -n No longer mark each name for export. -p Display output in a form that may be reused as input. -p Display output in a form that may be reused as input.  If no names are supplied, or if the `-p' option is given, a list of exported names is displayed.

Export Example If we want to modify PATH inside a shell script and have the effect preserved when we return to the shell PATH=$PATH:$HOME/bin export PATH

Umask  umask User's file creation mask. Set the shell process's file creation mask to mode.  SYNTAX umask [-p] [-S] [mode] OPTIONS  mode File creation mask  -S Print the mask in symbolic format  -p Output in a form that may be reused as input  The current value of the mask will be printed if mode is omitted,  If mode begins with a digit, it is interpreted as an octal number; if not, it is interpreted as a symbolic mode mask similar to that accepted by the chmod command.

Umask Examples  umask 02# Full group access, deny write to others.  umask 66# Deny read and write to group and others.  umask 77# Deny everything to everyone.  umask 26# Deny group write, deny read and write to others.

Command Prompt  Similar to Dos prompt it can be customized  Examples: set prompt="[$USER] “ set prompt="[$USER] “  In Bash the $PS1 is used as the environment variable for the prompt syntax

Miscellaneous if ( -r ${HOME}/.aliases ) source ${HOME}/.aliases Sourcing.aliases file if it exists.