Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

BASH Erick, David © Sekolah Tinggi Teknik Surabaya 1.

Presentasi serupa


Presentasi berjudul: "BASH Erick, David © Sekolah Tinggi Teknik Surabaya 1."— Transcript presentasi:

1 BASH Erick, David © Sekolah Tinggi Teknik Surabaya 1

2 2 Shell Kernel User Input

3 » Bourne-Again Shell » Primary Shell for GNU/Linux and MAC OS X » Also available in Solaris and various BSD Systems » Can also be compiled in other Unix system 3 © Sekolah Tinggi Teknik Surabaya

4 Bourne Shell (sh) C Shell (csh) Korn Shell (ksh) Bourne- Again Shell (bash) 4 © Sekolah Tinggi Teknik Surabaya

5 » Input/output redirection » Wildcard characters for filename abbreviation » Shell variables and options for customizing the environment » A built-in command set for writing shell programs » Shell functions, for modularizing tasks within a shell program » Job control » Command-line editing (using the command syntax of either vi or Emacs) 5 © Sekolah Tinggi Teknik Surabaya

6 » Access to previous commands (command history) » Integer arithmetic » Arrays and arithmetic expressions » Command-name abbreviation (aliasing) » Upwards compliance with POSIX » Internationalization facilities » An arithmetic for loop 6 © Sekolah Tinggi Teknik Surabaya

7 » Special files » Filename Metacharacters » Brace Expansion » Quoting » Command Forms » Redirection Forms 7 © Sekolah Tinggi Teknik Surabaya

8 » Startup Files ˃ /etc/profile. Executed automatically at login ˃ The first file found from this list: ~/.bash_profile, ~/.bash_login, or ~/.profile. Executed automatically at login. 8 © Sekolah Tinggi Teknik Surabaya

9 9

10 10 © Sekolah Tinggi Teknik Surabaya

11 11 © Sekolah Tinggi Teknik Surabaya

12 12 © Sekolah Tinggi Teknik Surabaya

13 13 © Sekolah Tinggi Teknik Surabaya

14 14 © Sekolah Tinggi Teknik Surabaya

15 » Everything between " and " is taken literally, except for the following characters that keep their special meaning: ˃$ -- Variable substitution ˃` -- command substitution » Everything between ' and ' is taken literally » The character following a \ is taken literally. Use within " " to escape ", $, and `. Often used to escape itself, spaces, or newlines 15 © Sekolah Tinggi Teknik Surabaya

16 16 © Sekolah Tinggi Teknik Surabaya

17 » cmd & ˃Execute cmd in background » cmd1 ; cmd2 ˃Command sequence; execute multiple cmds on the same line » cmd1 | cmd2 ˃Pipe; use output from cmd1 as input to cmd2 » cmd1 `cmd2` ˃Command substitution; use cmd2 output as arguments to cmd1 17 © Sekolah Tinggi Teknik Surabaya

18 » cmd1 && cmd2 ˃AND; execute cmd1 and then (if cmd1 succeeds) cmd2. This is a “short circuit” operation: cmd2 is never executed if cmd1 fails. » cmd1 || cmd2 ˃OR; execute either cmd1 or (if cmd1 fails) cmd2. This is a “short circuit” operation; cmd2 is never executed if cmd1 succeeds. 18 © Sekolah Tinggi Teknik Surabaya

19 19 © Sekolah Tinggi Teknik Surabaya

20 CommandExplanation cdChange directory echoPrint command-line arguments to standard output exitExit the shell script historyPrint command-line history pwdPrint working directory lsList files catList file content to standard output revReverse each line of a file and output to standard output 20 © Sekolah Tinggi Teknik Surabaya

21 CommandExplanation cpCopy a file mvMove a file rmRemove a file rmdirRemove a directory mkdirMake a directory chmodChange the attributes of an existing file manManual pages 21 © Sekolah Tinggi Teknik Surabaya

22 » Arnold Robbins, Bash Pocket Reference, O’Reilly, 2010 » Basic Commands, http://www.tldp.org/LDP/abs/html/basi c.html http://www.tldp.org/LDP/abs/html/basi c.html 22 © Sekolah Tinggi Teknik Surabaya


Download ppt "BASH Erick, David © Sekolah Tinggi Teknik Surabaya 1."

Presentasi serupa


Iklan oleh Google