SlideShare a Scribd company logo
https://github.com/syaifulahdan/os­practice|Operating System Practice |1 to 52 
OPERATING SYSTEMS PRACTICE
Working With Bash Shell
Practice : 5A

History on Bash Shell

Creating a Bash Shell Script
https://github.com/syaifulahdan/os­practice|
https://github.com/syaifulahdan/os­practice|Operating System Practice |2 to 52 
A. Objectives
1. Understanding the shell on Linux operating system.
2. Using feature history in Bash Shell.
3. Change the history feature in Bash Shell.
4. the shell prompt.
5. Configure Bash Shell to run scripts automatically.
6. Create and execute simple shell scripts via vi editor.
7. Understand the job control.
8. Understand the stack.
9. Using aliases
https://github.com/syaifulahdan/os­practice|Operating System Practice |3 to 52 
B. Basic Theory
https://github.com/syaifulahdan/os­practice|Operating System Practice |4 to 52 
1. SHELL
Shell is a Command executive, meaning the program awaits
the user's instructions, checks the syntax of the given
instruction, then executes the command.
Shell is marked with a prompt. For user use prompt $ and
for superuser use promp #.
shell type:

/bin/sh
Developed by UNIX Berkeley known as C-Shell

/bin/csh
Bourne shell, designed by Steve Bourne of AT & T

/bin/bash
Compatible with Bourne Shell and also adapting Korn-Shell's ability.
The fundamental difference between Shell is resolved almost non-
existent, except in programming and editing facilities.
https://github.com/syaifulahdan/os­practice|Operating System Practice |5 to 52 
1. SHELL
Shell is a Command executive, meaning the program awaits
the user's instructions, checks the syntax of the given
instruction, then executes the command.
Shell is marked with a prompt. For user use prompt $ and
for superuser use promp #.
shell type:

/bin/sh
Developed by UNIX Berkeley known as C-Shell

/bin/csh
Bourne shell, designed by Steve Bourne of AT & T

/bin/bash
Compatible with Bourne Shell and also adapting Korn-Shell's ability.
The fundamental difference between Shell is resolved almost non-
existent, except in programming and editing facilities.
https://github.com/syaifulahdan/os­practice|Operating System Practice |6 to 52 
2. PROFILE
At login time, the program will run some program that is:
1. /etc/profile
It contains a shell script that applies to all Linux users.
2. Profile for each user
In the home directory, the login will first check the .bash_profile file.
If no, then the .bash_login file will be searched. If .bash_login does not
exist, then look for file named .profile
3. .bashrc
This file will be executed for switching from one shell to another through
su.
4. .bash_logout
At logout, bash will search for file .bash_logout. When present, the file
will be executed before logout
https://github.com/syaifulahdan/os­practice|Operating System Practice |7 to 52 
The contents of / etc / profile:
# System wide environment and startup programs
# Functions and aliases go in /etc/bashrc
PATH=”$PATH:/usr/X11R6/bin”
PS1=”[u@h W]$ “
umask 022
USER=’id –un’
LOGNAME=$USER
MAIL=”/var/spool/mail/$USER”
HOSTNAME=’/bi n/hostname’
HISTSIZE=1000
HISTFILESIZE=1000
Export  PATH  PS1  HOSTNAME  HISTSIZE  HISTFILESIZE  USER 
LOGNAME MAIL
https://github.com/syaifulahdan/os­practice|Operating System Practice |8 to 52 
PATH merupakan daftar nama direktori. Bila sebuah instruksi
diberikan dari prompt shell, maka instruksi tersebut akan
dicari pada daftar tersebut.
PS1 adalah prompt dimana
u = Nama User
h = Nama Host
W = Nama working direktory
https://github.com/syaifulahdan/os­practice|Operating System Practice |9 to 52 
3. HISTORY
History is adapted from C-Shell, which is a record of all
the instructions that have so far been done. These
records can be viewed as history, then can be re-
selected, edited and executed. History allows the user to
re-edit complex and lengthy instructions, especially
when errors occur in the writing of instructions and
parameters.
^P (Ctrl-P) see previous instructions
^N (Ctrl-N see the next instruction
!! execution of previous instructions
!! –3 3 previous instructions will be repeated
!!88 repeat instruction no 88
https://github.com/syaifulahdan/os­practice|Operating System Practice |10 to 52 
4. BASH-SCRIPT
Bash-script is a file that contains a collection of executable
programs. For bash script execution use .
before the bash-script file which means shell and sign
execution ./ means the bash-script file is in the actual
directory.
https://github.com/syaifulahdan/os­practice|Operating System Practice |11 to 52 
5. JOB CONTROL
Job is a program execution given to the kernel. A Job is
deemed complete, when the execution of the program ends.
Execution Job is the same as the execution of the program,
both Background process and Foreground process.
https://github.com/syaifulahdan/os­practice|Operating System Practice |12 to 52 
5. EDITOR vi
Vi is a full screen editor, meaning the editor can take
advantage of the full-screen facility. Vi has 2 pieces mode,
namely:

Command line
The vi editor interprets the input as an instruction to be
executed by the editor, examples such as searching text,
changing text automatically and others.

Editing
The vi editor interprets the output as text to be inserted into
the buffer editor. At the bottom of the screen will display the
text "INSERTING".
https://github.com/syaifulahdan/os­practice|Operating System Practice |13 to 52 
At the beginning of vi run, the program enters command mode. With
pressing the "i" button will then enter editing. To return to
command mode, press the Esc key.
The keys of the vi editor text can be seen in the table as follows:
H Move cursor to left one character
J Move the cursor to the right of one character
K Pinda h kursor ke atas
L Move the cursor down
O Insert text (one line after cursor position) To exit the 5 insert lock
models next to this and
activate other keys, then we
must press the Esc key first
I Insert text (to the left of the cursor position)
A Insert text (to the right of the cursor position)
I (Shift i) Insert text (in the starting position of the line)
A (Shift a) Insert text (at the end of the line)
https://github.com/syaifulahdan/os­practice|Operating System Practice |14 to 52 
X Deleting 1 letter (to the right of the cursor position)
Dw Delete 1 word (to the right of the cursor position)
Dd Removing 1 row (to the right of cursor position)
Yy Copying 1 line
2yy Copying 2 lines
P (Paste) Displays a sentence line that has been copied with yy key.
Cw Replace 1 word that has been written to the right of the cursor position with another word
Cc Replace 1 sentence line that has been written to the right of the cursor position with
another sentence
ctrl- b Reverse one screen
ctrl- f Forward one screen
ctrl- d Forward half screen
B Move the cursor to the left of one word
W Move the cursor to the right of one word
^ Go to the beginning of the line
$ Go to the end of the line
U Cancel the last command
U Undoes all text changes on the line where the cursor is located
:! Quit temporarily from vi editor and execute another command
https://github.com/syaifulahdan/os­practice|Operating System Practice |15 to 52 
:wq Write and quite, save the file and exit
:q! Exit vi without saving
:se all Displays all set status options
:se nu Displays the line number on the left of the screen
/string Looking for strings forward
?string Looking for strings toward the back
N Forward the search for the same direction
N Continue searching for different directions
https://github.com/syaifulahdan/os­practice|Operating System Practice |16 to 52 
C. Step by Step
https://github.com/syaifulahdan/os­practice|Operating System Practice |17 to 52 
1 Login as user.
2 Open the Console Terminal and do the experiments
below and then analyze the results of the
experiment.
3 Conduct the experiments below and then analyze
the experimental results.
4 Complete the practice questions.
https://github.com/syaifulahdan/os­practice|Operating System Practice |18 to 52 
D. Experiment
https://github.com/syaifulahdan/os­practice|Operating System Practice |19 to 52 
Experiment 1 : Profile
1. The .bash_profile file runs on the user's home directory
login. The .bash_profile file is a hidden file, so to see it use
option a on the ls instruction.
$ ls –a
$ more .bash_profile
2. The .bash_logout file will be executed shortly before
logout, functioning as a house clearing job, which means to
clear everything, for example deleting temporary file or
other job. View the .bash_logout file with instructions
$ cat .bash_logout
https://github.com/syaifulahdan/os­practice|Operating System Practice |20 to 52 
Experiment 2 : Using Feature History Bash
1. Bash shell keeps the "history" command used before.
You can do history in some way. The easiest way is to use
the Up Arrow, then the previous command will be
displayed.
2. Next, give the Bash shell some commands to remember.
Enter the following command and press Enter on each line.
$ cd
$ ls –l /etc
$ ls –l
$ whoami
$ who
https://github.com/syaifulahdan/os­practice|Operating System Practice |21 to 52 
3. To check if this command is added to the history, it can
use the history command to see all the commands ever
inserted..
$ history
4. You can select the previous command by using Up
Arrow, but this is not efficient for increasing orders.
A simple way of using numbers in history commands or
searching for them. To select and execute commands by
number, enter the key! followed by the command number..
$ !<Nomor Perintah>      Contoh : !780
https://github.com/syaifulahdan/os­practice|Operating System Practice |22 to 52 
3. To check if this command is added to the history, it can
use the history command to see all the commands ever
inserted..
$ history
4. You can select the previous command by using Up
Arrow, but this is not efficient for increasing orders.
A simple way of using numbers in history commands or
searching for them. To select and execute commands by
number, enter the key! followed by the command number..
$ !<Nomor Perintah>      Contoh : !780
https://github.com/syaifulahdan/os­practice|Operating System Practice |23 to 52 
5. You can search for commands by including the desired
commands. For example !? Etc ?! will execute the
previously used ls ­l /etc command.
$ !?etc?
6. Then use the history command, it will show the ls 
­l /etc command instead of !? Etc?.
$ history
7. If the string is not found in the history command there
will be an error message.
$ !?wombat99?
https://github.com/syaifulahdan/os­practice|Operating System Practice |24 to 52 
8. If typed !Who then it is executed is the who command.
But if you type !Whoa then the whoami command is
executed.
$ !who
$ !whoa
9. You can replace string in history command, especially on long
command.
- For example type cat /bin /bash | strings | grep shell | less and
press Enter. It will show all the strings in the /bin  /bash file
containing the word "shell". To exit press q.
- If you want to display the word "alias", then you do not have to
type long command again, but just type ^shell^alias^ and press
Enter it will replace the word "shell" with "alias".
$ cat /bin/bash | strings | grep shell | less
$ ^shell^alias^
https://github.com/syaifulahdan/os­practice|Operating System Practice |25 to 52 
Experiment 3 : Change Feature
History Bash
1. Bash shell will keep the history command even
after logging out and logging in again.
The .bash_history file stores the history file
contained in the home directory.
$ cd
https://github.com/syaifulahdan/os­practice|Operating System Practice |26 to 52 
2. View a few lines in the .bash_history file by typing
"tail .bash_history" and press Enter.
$ tail .bash_history
3. Type history and press Enter. Then it will be seen
that the last line is history command and the previous
line is tail .bash_history.
The history command is up to date, as it is stored on
system memory.
$ history
https://github.com/syaifulahdan/os­practice|Operating System Practice |27 to 52 
4. Type the following command
$ echo ‘Ini perintah saya’
5. Type the following command
https://github.com/syaifulahdan/os­practice|Operating System Practice |28 to 52 
4. Type the following command.
5. Log out and log in again as the same user.
Type history and press Enter, Then the command
echo 'This my command' will be on the last line.
See the .bash_history file, then the command will be
in the .bash_history file.
$ echo 'This is my command'
$ history
$ tail .bash_history
https://github.com/syaifulahdan/os­practice|Operating System Practice |29 to 52 
7. To see how many of the history commands that
exist in the following file and output that comes out
similar below
$ history|less
6. Type history  |  less to see the last history
command on screen, Press spacebar to see more files.
To exit press q
$ wc –l .bash_history
1000 .bash_history
https://github.com/syaifulahdan/os­practice|Operating System Practice |30 to 52 
8. The output shows that 1000 history commands are
stored in the history file.
To see the range (limit) history command used
HISTSIZE variable. To see the history range type as
follows
$ set|grep HISTSIZE
9. If you want to enlarge the file history range, change
the variable
HISTSIZE on a startup script called .bashrc in the
home directory.
$ echo ‘HISTSIZE=5000’ >> .bashrc
https://github.com/syaifulahdan/os­practice|Operating System Practice |31 to 52 
10. Log out and log in again as the same user. View
HISTSIZE variable changes.
$ set|grep HISTSIZE
11. Type a history command several times, then this
command will be stored in BASH history even though
the command is typed the same.
12. You can configure BASH to not add commands to
history if the commands you type are the same as
before.
This is done by adding the HISTCONTROL variable
and given the value of ignoredups in the .bashrc file
$ echo ‘HISTCONTROL=ignoredups’ >> .bashrc
https://github.com/syaifulahdan/os­practice|Operating System Practice |32 to 52 
13. Log out and log in again as the same user. Type
history a few times and notice how many times the
history appears.
https://github.com/syaifulahdan/os­practice|Operating System Practice |33 to 52 
Experiment 4 : Change Shell Prompt
1. The Bash shell prompt is configured by setting the
PS1 variable value.
In addition to displaying static strings as prompts, you
can display to be dynamic.
For example, if you want to show current directory or
current time. Type PS1='t:' and press Enter to display
system time in 24 hour format as Bash prompt.
Format in HH: MM: SS
$ PS1=”t:”
https://github.com/syaifulahdan/os­practice|Operating System Practice |34 to 52 
3. Log out and log in again as the same user. Type
history a few times and notice how many times the
history appears.
$ PS1=”t:”
4. Most people want the Bash prompt to display the
current working directory.

The directory can be displayed in the form of an
entire path or just a directory name.

The  w character displays only the directory name.
If current directory is the home directory, then the
prompt appears ~:.
$ PS1=”t:”
https://github.com/syaifulahdan/os­practice|Operating System Practice |35 to 52 
5. Type cd /usr/sbin to see the /usr/sbin prompt:
$ cd /usr/sbin
6. Type PS1 = ' W:' to see the sbin prompt:
$ PS1=’W:’
https://github.com/syaifulahdan/os­practice|Operating System Practice |36 to 52 
7. There are several other BASH prompts that can be
changed, ie PS2, PS3 and PS4.

Prompt PS2 is used as a secondary prompt. To see how it's
used, type echo 'Hello (without ending the quote) and
press Enter.
A symbol larger than (>) will appear. This tells us that
BASH is waiting for you to complete the order.
$ echo ’Hello
>’

Type in quote cover (') and press Enter. This
command will complete the PS2 prompt, the word
"Hello," appears followed by the PS1 prompt on the
new line.
https://github.com/syaifulahdan/os­practice|Operating System Practice |37 to 52 
8. You can change the PS2 prompt like changing the
PS1 prompt. Type the following command:
$ PS2 = “Done entering your command:'”
>’
9. Then type echo 'Hello (without ending the quote)
and press Enter.

On the next line will appear. Done entering your
command :. Then type quote cover (') and press
Enter.

If the command is complete, then the word Hello will
appear followed by the PS1 prompt on the new line.
$ echo “Hello
Done entering your command:’
https://github.com/syaifulahdan/os­practice|Operating System Practice |38 to 52 
10. The BASH prompt can be displayed in sequence
by setting the color-setting string. For example, the
BASH prompt is set with w$, will displays the
current working directory followed by $ (or # if you
login as root).
For setting the color to blue type the following:
$ PS1=”033[0;34mw$ 033[0;37m”
11. To get a red prompt type the following:
$ PS1=”033[0;31mw$ 033[0;37m”
https://github.com/syaifulahdan/os­practice|Operating System Practice |39 to 52 
10. The BASH prompt can be displayed in sequence
by setting the color-setting string. For example, the
BASH prompt is set with w$, will displays the
current working directory followed by $ (or # if you
login as root).
For setting the color to blue type the following:
$ PS1=”033[0;34mw$ 033[0;37m”
11. To get a red prompt type the following:
$ PS1=”033[0;31mw$ 033[0;37m”
30 = black, 31 = red, 32 = green, 34 = blue, 35 = purple, 36 = cyan, 37 = white.
https://github.com/syaifulahdan/os­practice|Operating System Practice |40 to 52 
12. If you want multiple colors, type the following
command:
$ PS1=”033[0;31mw033[0;32m$ 033[0;37m”
13. You can display visual attributes such as brighter,
blinking and the opposite color. To display a brighter
prompt, the control attribute is replaced by 1, like
the following command:
$ PS1=”033[1;34mw033[1;32m$ 033[0;37m”
https://github.com/syaifulahdan/os­practice|Operating System Practice |41 to 52 
14. To display a prompt with the opposite color, the
control attribute is replaced by 7, like the following
command:
15. To display a flashing prompt, the control attribute
is replaced by 5, like the following command:
$ PS1=”033[7;34mw033[7;32m$ 033[0;37m”
$ PS1=”033[7;34mw033[7;32m$ 033[0;37m”
https://github.com/syaifulahdan/os­practice|Operating System Practice |42 to 52 
Experiment 5 : Adding automation to
Prompt Shell
1. Make sure you are in the home directory
$ cd ~
2. Create a simple script to sort the file list. You can
use the text editor, but since it is only one line, use the
echo command to create the file.
$ echo ’sort ~/list > ~/r13; mv ~/r13 ~/list’ > ~/sorter
3. Make the script file above to be an executable file
$ chmod +x sorter
https://github.com/syaifulahdan/os­practice|Operating System Practice |43 to 52 
4. Run the sorter program above each Bash shell
displaying the PS1 prompt. To do this, create a
PROMPT_COMMAND variable where the value is
the name of the sorter program.
PROMPT_COMMAND=~/sorter
5. Type echo 'John Smith: 13001' >> list and press
Enter. If the list file does not exist, it will be created
automatically, but if it exists, the string 'John Smith:
13001' will be added.
$ echo ’John Smith:13001’>>list
https://github.com/syaifulahdan/os­practice|Operating System Practice |44 to 52 
6. Type cat list and press Enter. Then you will see the
contents of the file list. At this time, the file may have
only one line so it can not be seen whether the file has
been sorted.
$ cat list
7. Enter some command similar to point 5 but with
different names and numbers. Then type cat list and press
Enter.
$ echo ’debian:13002’>>list
$ echo ’suse:13003’>>list
$ echo ’xandros:13004’>>list
$ echo ’centos Bob:13005’>>list
$ echo ’mint:13006’>>list
$ echo ’Squid:13007’>>list
https://github.com/syaifulahdan/os­practice|Operating System Practice |45 to 52 
8. If you do not want Shell Bash to show the file all the
time, you do not need to add the PROMPT_COMMAND =~/ 
sorter variable in the configuration file like .bashrc.
If you want BASH to stop running the sorter program, then
type the PROMPT_COMMAND = variable and press
Enter or log out and login again.
$ PROMPT_COMMAND=
https://github.com/syaifulahdan/os­practice|Operating System Practice |46 to 52 
E. Exercise
https://github.com/syaifulahdan/os­practice|Operating System Practice |47 to 52 

Exercise : Practice 5A
Try the following command:
 $ history
   $ tail .bash_history
   $ history|less
   $ wc –l .bash_history
   $ set|grep HISTSIZE
   $ echo ‘HISTCONTROL=ignoredups’ >> .bashrc
   $ chmod +x sorter
   $ PS1=”033[7;34mw033[7;32m$ 033[0;37m”
   $ PS2=”welcome to the jungle:”
   $ PS1=’W:’
https://github.com/syaifulahdan/os­practice|Operating System Practice |48 to 52 

Practice Report : Practice 5A
1 Analyze your experimental results.
2 Do the above exercises and analyze the results.
3 Give a conclusion from this lab.
https://github.com/syaifulahdan/os­practice|Operating System Practice |49 to 52 

“Pleasure in a job makes perfection on the results 
achieved”. Aristoteles

“Believe you can. You're halfway”. Theodore Roosevelt

“You might be able to delay, but time will not wait”. 
Benjamin Franklin 

“The effort will work if someone does not give up”. 
Napoleon Hill

“Opportunity to find a better strength in us arises 
when life seems to be very challenging”. Joseph 
Campbell

More Related Content

What's hot

Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsDr.Ravi
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90minsLarry Cai
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer packageLattapon Yodsuwan
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyNikhil Mungel
 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the AutotoolsScott Garman
 
Composer the right way - SunshinePHP
Composer the right way - SunshinePHPComposer the right way - SunshinePHP
Composer the right way - SunshinePHPRafael Dohms
 
Mastering unix
Mastering unixMastering unix
Mastering unixRaghu nath
 
Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18Brian Vermeer
 
Building robust and friendly command line applications in go
Building robust and friendly command line applications in goBuilding robust and friendly command line applications in go
Building robust and friendly command line applications in goAndrii Soldatenko
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpen Gurukul
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Rafael Dohms
 
Common mistakes functional java vjug
Common mistakes functional java vjugCommon mistakes functional java vjug
Common mistakes functional java vjugBrian Vermeer
 
Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Brian Vermeer
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting BasicsSudharsan S
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 

What's hot (20)

Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
Learn flask in 90mins
Learn flask in 90minsLearn flask in 90mins
Learn flask in 90mins
 
Create your own composer package
Create your own composer packageCreate your own composer package
Create your own composer package
 
Bash 4
Bash 4Bash 4
Bash 4
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
Don't Fear the Autotools
Don't Fear the AutotoolsDon't Fear the Autotools
Don't Fear the Autotools
 
bash
bashbash
bash
 
Composer the right way - SunshinePHP
Composer the right way - SunshinePHPComposer the right way - SunshinePHP
Composer the right way - SunshinePHP
 
Git::Hooks
Git::HooksGit::Hooks
Git::Hooks
 
Mastering unix
Mastering unixMastering unix
Mastering unix
 
Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18Ten common mistakes made with Functional Java JBCNConf18
Ten common mistakes made with Functional Java JBCNConf18
 
Building robust and friendly command line applications in go
Building robust and friendly command line applications in goBuilding robust and friendly command line applications in go
Building robust and friendly command line applications in go
 
OpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell ScriptingOpenGurukul : Language : Shell Scripting
OpenGurukul : Language : Shell Scripting
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13Composer for Busy Developers - php|tek13
Composer for Busy Developers - php|tek13
 
Common mistakes functional java vjug
Common mistakes functional java vjugCommon mistakes functional java vjug
Common mistakes functional java vjug
 
Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018Common mistakes functional java | Oracle Code One 2018
Common mistakes functional java | Oracle Code One 2018
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Unix Shell Scripting Basics
Unix Shell Scripting BasicsUnix Shell Scripting Basics
Unix Shell Scripting Basics
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 

Similar to Operating System Practice : Meeting 7- working with bash shell-a-slide

Linuxppt
LinuxpptLinuxppt
LinuxpptReka
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
Licão 02 shell basics bash intro
Licão 02 shell basics bash introLicão 02 shell basics bash intro
Licão 02 shell basics bash introAcácio Oliveira
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxwilcockiris
 
OverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxOverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxalfred4lewis58146
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008guestd9065
 
1 of 9 CSCE 3600 Systems Programming Major Assignm.docx
  1 of 9 CSCE 3600 Systems Programming  Major Assignm.docx  1 of 9 CSCE 3600 Systems Programming  Major Assignm.docx
1 of 9 CSCE 3600 Systems Programming Major Assignm.docxShiraPrater50
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHDavid Stockton
 
Lab 7 - Bash Script.pptx
Lab 7 - Bash Script.pptxLab 7 - Bash Script.pptx
Lab 7 - Bash Script.pptxNourhanTarek23
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptxHarsha Patel
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptxHarsha Patel
 
Generating keyboard in raspberry pi
Generating keyboard in raspberry piGenerating keyboard in raspberry pi
Generating keyboard in raspberry piPrabhanda Prabha
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25Techvilla
 
Operating System Practice : Meeting 9 pemrograman shell - a -slide
Operating System Practice : Meeting 9   pemrograman shell - a -slideOperating System Practice : Meeting 9   pemrograman shell - a -slide
Operating System Practice : Meeting 9 pemrograman shell - a -slideSyaiful Ahdan
 

Similar to Operating System Practice : Meeting 7- working with bash shell-a-slide (20)

Licão 05 scripts exemple
Licão 05 scripts exempleLicão 05 scripts exemple
Licão 05 scripts exemple
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Licão 02 shell basics bash intro
Licão 02 shell basics bash introLicão 02 shell basics bash intro
Licão 02 shell basics bash intro
 
BACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docxBACKGROUND A shell provides a command-line interface for users. I.docx
BACKGROUND A shell provides a command-line interface for users. I.docx
 
OverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docxOverviewIn this assignment you will write your own shell i.docx
OverviewIn this assignment you will write your own shell i.docx
 
Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008Purdue CS354 Operating Systems 2008
Purdue CS354 Operating Systems 2008
 
Shellscripting
ShellscriptingShellscripting
Shellscripting
 
1 of 9 CSCE 3600 Systems Programming Major Assignm.docx
  1 of 9 CSCE 3600 Systems Programming  Major Assignm.docx  1 of 9 CSCE 3600 Systems Programming  Major Assignm.docx
1 of 9 CSCE 3600 Systems Programming Major Assignm.docx
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
 
Lab 7 - Bash Script.pptx
Lab 7 - Bash Script.pptxLab 7 - Bash Script.pptx
Lab 7 - Bash Script.pptx
 
Unix commands
Unix commandsUnix commands
Unix commands
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
 
Using Vi Editor.pptx
Using Vi Editor.pptxUsing Vi Editor.pptx
Using Vi Editor.pptx
 
Generating keyboard in raspberry pi
Generating keyboard in raspberry piGenerating keyboard in raspberry pi
Generating keyboard in raspberry pi
 
Raspberry pi Part 25
Raspberry pi Part 25Raspberry pi Part 25
Raspberry pi Part 25
 
Operating System Practice : Meeting 9 pemrograman shell - a -slide
Operating System Practice : Meeting 9   pemrograman shell - a -slideOperating System Practice : Meeting 9   pemrograman shell - a -slide
Operating System Practice : Meeting 9 pemrograman shell - a -slide
 

More from Syaiful Ahdan

Sertifikat EC00202128391
 Sertifikat EC00202128391 Sertifikat EC00202128391
Sertifikat EC00202128391Syaiful Ahdan
 
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...Syaiful Ahdan
 
Sertifikat ec00202059774
Sertifikat ec00202059774Sertifikat ec00202059774
Sertifikat ec00202059774Syaiful Ahdan
 
Sertifikat ec00202059775
Sertifikat ec00202059775Sertifikat ec00202059775
Sertifikat ec00202059775Syaiful Ahdan
 
Sertifikat EC00202045078
Sertifikat EC00202045078Sertifikat EC00202045078
Sertifikat EC00202045078Syaiful Ahdan
 
Sertifikat EC00202044723
 Sertifikat EC00202044723 Sertifikat EC00202044723
Sertifikat EC00202044723Syaiful Ahdan
 
Sertifikat EC00202023523
Sertifikat EC00202023523Sertifikat EC00202023523
Sertifikat EC00202023523Syaiful Ahdan
 
Sertifikat EC00201826309
Sertifikat EC00201826309Sertifikat EC00201826309
Sertifikat EC00201826309Syaiful Ahdan
 
Sertifikat EC00202023149
Sertifikat EC00202023149Sertifikat EC00202023149
Sertifikat EC00202023149Syaiful Ahdan
 
Sertifikat EC00202022868
Sertifikat EC00202022868Sertifikat EC00202022868
Sertifikat EC00202022868Syaiful Ahdan
 
Sertifikat EC00202021343
Sertifikat EC00202021343Sertifikat EC00202021343
Sertifikat EC00202021343Syaiful Ahdan
 
Sertifikat EC00202022755
Sertifikat EC00202022755Sertifikat EC00202022755
Sertifikat EC00202022755Syaiful Ahdan
 
Sertifikat EC00201987196
Sertifikat EC00201987196Sertifikat EC00201987196
Sertifikat EC00201987196Syaiful Ahdan
 
Sertifikat EC00201856484
Sertifikat EC00201856484Sertifikat EC00201856484
Sertifikat EC00201856484Syaiful Ahdan
 
Sertifikat EC00201856352
Sertifikat EC00201856352Sertifikat EC00201856352
Sertifikat EC00201856352Syaiful Ahdan
 
Sertifikat EC00201856994
Sertifikat EC00201856994Sertifikat EC00201856994
Sertifikat EC00201856994Syaiful Ahdan
 
Sertifikat EC00201856895
Sertifikat EC00201856895Sertifikat EC00201856895
Sertifikat EC00201856895Syaiful Ahdan
 
Meeting 2 introdcution network administrator
Meeting 2   introdcution network administratorMeeting 2   introdcution network administrator
Meeting 2 introdcution network administratorSyaiful Ahdan
 

More from Syaiful Ahdan (20)

Sertifikat EC00202128391
 Sertifikat EC00202128391 Sertifikat EC00202128391
Sertifikat EC00202128391
 
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
 
Sertifikat ec00202059774
Sertifikat ec00202059774Sertifikat ec00202059774
Sertifikat ec00202059774
 
Sertifikat ec00202059775
Sertifikat ec00202059775Sertifikat ec00202059775
Sertifikat ec00202059775
 
Sertifikat EC00202045078
Sertifikat EC00202045078Sertifikat EC00202045078
Sertifikat EC00202045078
 
Sertifikat EC00202044723
 Sertifikat EC00202044723 Sertifikat EC00202044723
Sertifikat EC00202044723
 
Sertifikat EC00202023523
Sertifikat EC00202023523Sertifikat EC00202023523
Sertifikat EC00202023523
 
Sertifikat EC00201826309
Sertifikat EC00201826309Sertifikat EC00201826309
Sertifikat EC00201826309
 
Sertifikat EC00202023149
Sertifikat EC00202023149Sertifikat EC00202023149
Sertifikat EC00202023149
 
Sertifikat EC00202022868
Sertifikat EC00202022868Sertifikat EC00202022868
Sertifikat EC00202022868
 
Sertifikat EC00202021343
Sertifikat EC00202021343Sertifikat EC00202021343
Sertifikat EC00202021343
 
Sertifikat EC00202022755
Sertifikat EC00202022755Sertifikat EC00202022755
Sertifikat EC00202022755
 
Sertifikat EC00201987196
Sertifikat EC00201987196Sertifikat EC00201987196
Sertifikat EC00201987196
 
Sertifikat EC00201856484
Sertifikat EC00201856484Sertifikat EC00201856484
Sertifikat EC00201856484
 
Sertifikat EC00201856352
Sertifikat EC00201856352Sertifikat EC00201856352
Sertifikat EC00201856352
 
Sertifikat EC00201856994
Sertifikat EC00201856994Sertifikat EC00201856994
Sertifikat EC00201856994
 
Sertifikat EC00201856895
Sertifikat EC00201856895Sertifikat EC00201856895
Sertifikat EC00201856895
 
Meeting 2 introdcution network administrator
Meeting 2   introdcution network administratorMeeting 2   introdcution network administrator
Meeting 2 introdcution network administrator
 
Pertemuan 5
Pertemuan 5Pertemuan 5
Pertemuan 5
 
Pertemuan 4
Pertemuan 4Pertemuan 4
Pertemuan 4
 

Recently uploaded

Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...Denish Jangid
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online PresentationGDSCYCCE
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfQucHHunhnh
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxDenish Jangid
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxbennyroshan06
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfTamralipta Mahavidyalaya
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxShibin Azad
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePedroFerreira53928
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resourcesdimpy50
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfPo-Chuan Chen
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxricssacare
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPCeline George
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345beazzy04
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsCol Mukteshwar Prasad
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 

Recently uploaded (20)

Operations Management - Book1.p - Dr. Abdulfatah A. Salem
Operations Management - Book1.p  - Dr. Abdulfatah A. SalemOperations Management - Book1.p  - Dr. Abdulfatah A. Salem
Operations Management - Book1.p - Dr. Abdulfatah A. Salem
 
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...Basic Civil Engineering Notes of Chapter-6,  Topic- Ecosystem, Biodiversity G...
Basic Civil Engineering Notes of Chapter-6, Topic- Ecosystem, Biodiversity G...
 
[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation[GDSC YCCE] Build with AI Online Presentation
[GDSC YCCE] Build with AI Online Presentation
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Gyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptxGyanartha SciBizTech Quiz slideshare.pptx
Gyanartha SciBizTech Quiz slideshare.pptx
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdfAdversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
Adversarial Attention Modeling for Multi-dimensional Emotion Regression.pdf
 
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptxJose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
Jose-Rizal-and-Philippine-Nationalism-National-Symbol-2.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 

Operating System Practice : Meeting 7- working with bash shell-a-slide

  • 1. https://github.com/syaifulahdan/os­practice|Operating System Practice |1 to 52  OPERATING SYSTEMS PRACTICE Working With Bash Shell Practice : 5A  History on Bash Shell  Creating a Bash Shell Script https://github.com/syaifulahdan/os­practice|
  • 2. https://github.com/syaifulahdan/os­practice|Operating System Practice |2 to 52  A. Objectives 1. Understanding the shell on Linux operating system. 2. Using feature history in Bash Shell. 3. Change the history feature in Bash Shell. 4. the shell prompt. 5. Configure Bash Shell to run scripts automatically. 6. Create and execute simple shell scripts via vi editor. 7. Understand the job control. 8. Understand the stack. 9. Using aliases
  • 4. https://github.com/syaifulahdan/os­practice|Operating System Practice |4 to 52  1. SHELL Shell is a Command executive, meaning the program awaits the user's instructions, checks the syntax of the given instruction, then executes the command. Shell is marked with a prompt. For user use prompt $ and for superuser use promp #. shell type:  /bin/sh Developed by UNIX Berkeley known as C-Shell  /bin/csh Bourne shell, designed by Steve Bourne of AT & T  /bin/bash Compatible with Bourne Shell and also adapting Korn-Shell's ability. The fundamental difference between Shell is resolved almost non- existent, except in programming and editing facilities.
  • 5. https://github.com/syaifulahdan/os­practice|Operating System Practice |5 to 52  1. SHELL Shell is a Command executive, meaning the program awaits the user's instructions, checks the syntax of the given instruction, then executes the command. Shell is marked with a prompt. For user use prompt $ and for superuser use promp #. shell type:  /bin/sh Developed by UNIX Berkeley known as C-Shell  /bin/csh Bourne shell, designed by Steve Bourne of AT & T  /bin/bash Compatible with Bourne Shell and also adapting Korn-Shell's ability. The fundamental difference between Shell is resolved almost non- existent, except in programming and editing facilities.
  • 6. https://github.com/syaifulahdan/os­practice|Operating System Practice |6 to 52  2. PROFILE At login time, the program will run some program that is: 1. /etc/profile It contains a shell script that applies to all Linux users. 2. Profile for each user In the home directory, the login will first check the .bash_profile file. If no, then the .bash_login file will be searched. If .bash_login does not exist, then look for file named .profile 3. .bashrc This file will be executed for switching from one shell to another through su. 4. .bash_logout At logout, bash will search for file .bash_logout. When present, the file will be executed before logout
  • 7. https://github.com/syaifulahdan/os­practice|Operating System Practice |7 to 52  The contents of / etc / profile: # System wide environment and startup programs # Functions and aliases go in /etc/bashrc PATH=”$PATH:/usr/X11R6/bin” PS1=”[u@h W]$ “ umask 022 USER=’id –un’ LOGNAME=$USER MAIL=”/var/spool/mail/$USER” HOSTNAME=’/bi n/hostname’ HISTSIZE=1000 HISTFILESIZE=1000 Export  PATH  PS1  HOSTNAME  HISTSIZE  HISTFILESIZE  USER  LOGNAME MAIL
  • 8. https://github.com/syaifulahdan/os­practice|Operating System Practice |8 to 52  PATH merupakan daftar nama direktori. Bila sebuah instruksi diberikan dari prompt shell, maka instruksi tersebut akan dicari pada daftar tersebut. PS1 adalah prompt dimana u = Nama User h = Nama Host W = Nama working direktory
  • 9. https://github.com/syaifulahdan/os­practice|Operating System Practice |9 to 52  3. HISTORY History is adapted from C-Shell, which is a record of all the instructions that have so far been done. These records can be viewed as history, then can be re- selected, edited and executed. History allows the user to re-edit complex and lengthy instructions, especially when errors occur in the writing of instructions and parameters. ^P (Ctrl-P) see previous instructions ^N (Ctrl-N see the next instruction !! execution of previous instructions !! –3 3 previous instructions will be repeated !!88 repeat instruction no 88
  • 10. https://github.com/syaifulahdan/os­practice|Operating System Practice |10 to 52  4. BASH-SCRIPT Bash-script is a file that contains a collection of executable programs. For bash script execution use . before the bash-script file which means shell and sign execution ./ means the bash-script file is in the actual directory.
  • 11. https://github.com/syaifulahdan/os­practice|Operating System Practice |11 to 52  5. JOB CONTROL Job is a program execution given to the kernel. A Job is deemed complete, when the execution of the program ends. Execution Job is the same as the execution of the program, both Background process and Foreground process.
  • 12. https://github.com/syaifulahdan/os­practice|Operating System Practice |12 to 52  5. EDITOR vi Vi is a full screen editor, meaning the editor can take advantage of the full-screen facility. Vi has 2 pieces mode, namely:  Command line The vi editor interprets the input as an instruction to be executed by the editor, examples such as searching text, changing text automatically and others.  Editing The vi editor interprets the output as text to be inserted into the buffer editor. At the bottom of the screen will display the text "INSERTING".
  • 13. https://github.com/syaifulahdan/os­practice|Operating System Practice |13 to 52  At the beginning of vi run, the program enters command mode. With pressing the "i" button will then enter editing. To return to command mode, press the Esc key. The keys of the vi editor text can be seen in the table as follows: H Move cursor to left one character J Move the cursor to the right of one character K Pinda h kursor ke atas L Move the cursor down O Insert text (one line after cursor position) To exit the 5 insert lock models next to this and activate other keys, then we must press the Esc key first I Insert text (to the left of the cursor position) A Insert text (to the right of the cursor position) I (Shift i) Insert text (in the starting position of the line) A (Shift a) Insert text (at the end of the line)
  • 14. https://github.com/syaifulahdan/os­practice|Operating System Practice |14 to 52  X Deleting 1 letter (to the right of the cursor position) Dw Delete 1 word (to the right of the cursor position) Dd Removing 1 row (to the right of cursor position) Yy Copying 1 line 2yy Copying 2 lines P (Paste) Displays a sentence line that has been copied with yy key. Cw Replace 1 word that has been written to the right of the cursor position with another word Cc Replace 1 sentence line that has been written to the right of the cursor position with another sentence ctrl- b Reverse one screen ctrl- f Forward one screen ctrl- d Forward half screen B Move the cursor to the left of one word W Move the cursor to the right of one word ^ Go to the beginning of the line $ Go to the end of the line U Cancel the last command U Undoes all text changes on the line where the cursor is located :! Quit temporarily from vi editor and execute another command
  • 15. https://github.com/syaifulahdan/os­practice|Operating System Practice |15 to 52  :wq Write and quite, save the file and exit :q! Exit vi without saving :se all Displays all set status options :se nu Displays the line number on the left of the screen /string Looking for strings forward ?string Looking for strings toward the back N Forward the search for the same direction N Continue searching for different directions
  • 17. https://github.com/syaifulahdan/os­practice|Operating System Practice |17 to 52  1 Login as user. 2 Open the Console Terminal and do the experiments below and then analyze the results of the experiment. 3 Conduct the experiments below and then analyze the experimental results. 4 Complete the practice questions.
  • 19. https://github.com/syaifulahdan/os­practice|Operating System Practice |19 to 52  Experiment 1 : Profile 1. The .bash_profile file runs on the user's home directory login. The .bash_profile file is a hidden file, so to see it use option a on the ls instruction. $ ls –a $ more .bash_profile 2. The .bash_logout file will be executed shortly before logout, functioning as a house clearing job, which means to clear everything, for example deleting temporary file or other job. View the .bash_logout file with instructions $ cat .bash_logout
  • 20. https://github.com/syaifulahdan/os­practice|Operating System Practice |20 to 52  Experiment 2 : Using Feature History Bash 1. Bash shell keeps the "history" command used before. You can do history in some way. The easiest way is to use the Up Arrow, then the previous command will be displayed. 2. Next, give the Bash shell some commands to remember. Enter the following command and press Enter on each line. $ cd $ ls –l /etc $ ls –l $ whoami $ who
  • 21. https://github.com/syaifulahdan/os­practice|Operating System Practice |21 to 52  3. To check if this command is added to the history, it can use the history command to see all the commands ever inserted.. $ history 4. You can select the previous command by using Up Arrow, but this is not efficient for increasing orders. A simple way of using numbers in history commands or searching for them. To select and execute commands by number, enter the key! followed by the command number.. $ !<Nomor Perintah>      Contoh : !780
  • 22. https://github.com/syaifulahdan/os­practice|Operating System Practice |22 to 52  3. To check if this command is added to the history, it can use the history command to see all the commands ever inserted.. $ history 4. You can select the previous command by using Up Arrow, but this is not efficient for increasing orders. A simple way of using numbers in history commands or searching for them. To select and execute commands by number, enter the key! followed by the command number.. $ !<Nomor Perintah>      Contoh : !780
  • 23. https://github.com/syaifulahdan/os­practice|Operating System Practice |23 to 52  5. You can search for commands by including the desired commands. For example !? Etc ?! will execute the previously used ls ­l /etc command. $ !?etc? 6. Then use the history command, it will show the ls  ­l /etc command instead of !? Etc?. $ history 7. If the string is not found in the history command there will be an error message. $ !?wombat99?
  • 24. https://github.com/syaifulahdan/os­practice|Operating System Practice |24 to 52  8. If typed !Who then it is executed is the who command. But if you type !Whoa then the whoami command is executed. $ !who $ !whoa 9. You can replace string in history command, especially on long command. - For example type cat /bin /bash | strings | grep shell | less and press Enter. It will show all the strings in the /bin  /bash file containing the word "shell". To exit press q. - If you want to display the word "alias", then you do not have to type long command again, but just type ^shell^alias^ and press Enter it will replace the word "shell" with "alias". $ cat /bin/bash | strings | grep shell | less $ ^shell^alias^
  • 25. https://github.com/syaifulahdan/os­practice|Operating System Practice |25 to 52  Experiment 3 : Change Feature History Bash 1. Bash shell will keep the history command even after logging out and logging in again. The .bash_history file stores the history file contained in the home directory. $ cd
  • 26. https://github.com/syaifulahdan/os­practice|Operating System Practice |26 to 52  2. View a few lines in the .bash_history file by typing "tail .bash_history" and press Enter. $ tail .bash_history 3. Type history and press Enter. Then it will be seen that the last line is history command and the previous line is tail .bash_history. The history command is up to date, as it is stored on system memory. $ history
  • 27. https://github.com/syaifulahdan/os­practice|Operating System Practice |27 to 52  4. Type the following command $ echo ‘Ini perintah saya’ 5. Type the following command
  • 28. https://github.com/syaifulahdan/os­practice|Operating System Practice |28 to 52  4. Type the following command. 5. Log out and log in again as the same user. Type history and press Enter, Then the command echo 'This my command' will be on the last line. See the .bash_history file, then the command will be in the .bash_history file. $ echo 'This is my command' $ history $ tail .bash_history
  • 29. https://github.com/syaifulahdan/os­practice|Operating System Practice |29 to 52  7. To see how many of the history commands that exist in the following file and output that comes out similar below $ history|less 6. Type history  |  less to see the last history command on screen, Press spacebar to see more files. To exit press q $ wc –l .bash_history 1000 .bash_history
  • 30. https://github.com/syaifulahdan/os­practice|Operating System Practice |30 to 52  8. The output shows that 1000 history commands are stored in the history file. To see the range (limit) history command used HISTSIZE variable. To see the history range type as follows $ set|grep HISTSIZE 9. If you want to enlarge the file history range, change the variable HISTSIZE on a startup script called .bashrc in the home directory. $ echo ‘HISTSIZE=5000’ >> .bashrc
  • 31. https://github.com/syaifulahdan/os­practice|Operating System Practice |31 to 52  10. Log out and log in again as the same user. View HISTSIZE variable changes. $ set|grep HISTSIZE 11. Type a history command several times, then this command will be stored in BASH history even though the command is typed the same. 12. You can configure BASH to not add commands to history if the commands you type are the same as before. This is done by adding the HISTCONTROL variable and given the value of ignoredups in the .bashrc file $ echo ‘HISTCONTROL=ignoredups’ >> .bashrc
  • 32. https://github.com/syaifulahdan/os­practice|Operating System Practice |32 to 52  13. Log out and log in again as the same user. Type history a few times and notice how many times the history appears.
  • 33. https://github.com/syaifulahdan/os­practice|Operating System Practice |33 to 52  Experiment 4 : Change Shell Prompt 1. The Bash shell prompt is configured by setting the PS1 variable value. In addition to displaying static strings as prompts, you can display to be dynamic. For example, if you want to show current directory or current time. Type PS1='t:' and press Enter to display system time in 24 hour format as Bash prompt. Format in HH: MM: SS $ PS1=”t:”
  • 34. https://github.com/syaifulahdan/os­practice|Operating System Practice |34 to 52  3. Log out and log in again as the same user. Type history a few times and notice how many times the history appears. $ PS1=”t:” 4. Most people want the Bash prompt to display the current working directory.  The directory can be displayed in the form of an entire path or just a directory name.  The w character displays only the directory name. If current directory is the home directory, then the prompt appears ~:. $ PS1=”t:”
  • 35. https://github.com/syaifulahdan/os­practice|Operating System Practice |35 to 52  5. Type cd /usr/sbin to see the /usr/sbin prompt: $ cd /usr/sbin 6. Type PS1 = ' W:' to see the sbin prompt: $ PS1=’W:’
  • 36. https://github.com/syaifulahdan/os­practice|Operating System Practice |36 to 52  7. There are several other BASH prompts that can be changed, ie PS2, PS3 and PS4.  Prompt PS2 is used as a secondary prompt. To see how it's used, type echo 'Hello (without ending the quote) and press Enter. A symbol larger than (>) will appear. This tells us that BASH is waiting for you to complete the order. $ echo ’Hello >’  Type in quote cover (') and press Enter. This command will complete the PS2 prompt, the word "Hello," appears followed by the PS1 prompt on the new line.
  • 37. https://github.com/syaifulahdan/os­practice|Operating System Practice |37 to 52  8. You can change the PS2 prompt like changing the PS1 prompt. Type the following command: $ PS2 = “Done entering your command:'” >’ 9. Then type echo 'Hello (without ending the quote) and press Enter.  On the next line will appear. Done entering your command :. Then type quote cover (') and press Enter.  If the command is complete, then the word Hello will appear followed by the PS1 prompt on the new line. $ echo “Hello Done entering your command:’
  • 38. https://github.com/syaifulahdan/os­practice|Operating System Practice |38 to 52  10. The BASH prompt can be displayed in sequence by setting the color-setting string. For example, the BASH prompt is set with w$, will displays the current working directory followed by $ (or # if you login as root). For setting the color to blue type the following: $ PS1=”033[0;34mw$ 033[0;37m” 11. To get a red prompt type the following: $ PS1=”033[0;31mw$ 033[0;37m”
  • 39. https://github.com/syaifulahdan/os­practice|Operating System Practice |39 to 52  10. The BASH prompt can be displayed in sequence by setting the color-setting string. For example, the BASH prompt is set with w$, will displays the current working directory followed by $ (or # if you login as root). For setting the color to blue type the following: $ PS1=”033[0;34mw$ 033[0;37m” 11. To get a red prompt type the following: $ PS1=”033[0;31mw$ 033[0;37m” 30 = black, 31 = red, 32 = green, 34 = blue, 35 = purple, 36 = cyan, 37 = white.
  • 40. https://github.com/syaifulahdan/os­practice|Operating System Practice |40 to 52  12. If you want multiple colors, type the following command: $ PS1=”033[0;31mw033[0;32m$ 033[0;37m” 13. You can display visual attributes such as brighter, blinking and the opposite color. To display a brighter prompt, the control attribute is replaced by 1, like the following command: $ PS1=”033[1;34mw033[1;32m$ 033[0;37m”
  • 41. https://github.com/syaifulahdan/os­practice|Operating System Practice |41 to 52  14. To display a prompt with the opposite color, the control attribute is replaced by 7, like the following command: 15. To display a flashing prompt, the control attribute is replaced by 5, like the following command: $ PS1=”033[7;34mw033[7;32m$ 033[0;37m” $ PS1=”033[7;34mw033[7;32m$ 033[0;37m”
  • 42. https://github.com/syaifulahdan/os­practice|Operating System Practice |42 to 52  Experiment 5 : Adding automation to Prompt Shell 1. Make sure you are in the home directory $ cd ~ 2. Create a simple script to sort the file list. You can use the text editor, but since it is only one line, use the echo command to create the file. $ echo ’sort ~/list > ~/r13; mv ~/r13 ~/list’ > ~/sorter 3. Make the script file above to be an executable file $ chmod +x sorter
  • 43. https://github.com/syaifulahdan/os­practice|Operating System Practice |43 to 52  4. Run the sorter program above each Bash shell displaying the PS1 prompt. To do this, create a PROMPT_COMMAND variable where the value is the name of the sorter program. PROMPT_COMMAND=~/sorter 5. Type echo 'John Smith: 13001' >> list and press Enter. If the list file does not exist, it will be created automatically, but if it exists, the string 'John Smith: 13001' will be added. $ echo ’John Smith:13001’>>list
  • 44. https://github.com/syaifulahdan/os­practice|Operating System Practice |44 to 52  6. Type cat list and press Enter. Then you will see the contents of the file list. At this time, the file may have only one line so it can not be seen whether the file has been sorted. $ cat list 7. Enter some command similar to point 5 but with different names and numbers. Then type cat list and press Enter. $ echo ’debian:13002’>>list $ echo ’suse:13003’>>list $ echo ’xandros:13004’>>list $ echo ’centos Bob:13005’>>list $ echo ’mint:13006’>>list $ echo ’Squid:13007’>>list
  • 45. https://github.com/syaifulahdan/os­practice|Operating System Practice |45 to 52  8. If you do not want Shell Bash to show the file all the time, you do not need to add the PROMPT_COMMAND =~/  sorter variable in the configuration file like .bashrc. If you want BASH to stop running the sorter program, then type the PROMPT_COMMAND = variable and press Enter or log out and login again. $ PROMPT_COMMAND=
  • 47. https://github.com/syaifulahdan/os­practice|Operating System Practice |47 to 52   Exercise : Practice 5A Try the following command:  $ history    $ tail .bash_history    $ history|less    $ wc –l .bash_history    $ set|grep HISTSIZE    $ echo ‘HISTCONTROL=ignoredups’ >> .bashrc    $ chmod +x sorter    $ PS1=”033[7;34mw033[7;32m$ 033[0;37m”    $ PS2=”welcome to the jungle:”    $ PS1=’W:’
  • 48. https://github.com/syaifulahdan/os­practice|Operating System Practice |48 to 52   Practice Report : Practice 5A 1 Analyze your experimental results. 2 Do the above exercises and analyze the results. 3 Give a conclusion from this lab.
  • 49. https://github.com/syaifulahdan/os­practice|Operating System Practice |49 to 52   “Pleasure in a job makes perfection on the results  achieved”. Aristoteles  “Believe you can. You're halfway”. Theodore Roosevelt  “You might be able to delay, but time will not wait”.  Benjamin Franklin   “The effort will work if someone does not give up”.  Napoleon Hill  “Opportunity to find a better strength in us arises  when life seems to be very challenging”. Joseph  Campbell