Your SlideShare is downloading. ×
0
Created by<br />
Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
Summary of shell features
Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
Redirect usage</li></li></ul><li>1<br />2<br />Different types of shell<br />Shell<br />Path<br />Description<br />OS<br /...
Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
Summary of shell features
Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
Redirect usage</li></li></ul><li>1<br />2<br />Summary of shell features <br />Bourne<br />C<br />TC<br />Korn<br />Bash<b...
Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
Summary of shell features
Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
Upcoming SlideShare
Loading in...5
×

Redirection of output and input in unix/linux

1,333

Published on

It will guide you how to use redirection in unix/linux and comparison of shell type

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,333
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Redirection of output and input in unix/linux"

  1. 1. Created by<br />
  2. 2. Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
  3. 3. Summary of shell features
  4. 4. Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
  5. 5. Redirect usage</li></li></ul><li>1<br />2<br />Different types of shell<br />Shell<br />Path<br />Description<br />OS<br />Bourne<br />/bin/sh<br />This is the original Unix shell written by Steve Bourne of Bell Labs. It is available on all UNIX systems.<br />All unix<br />Korn<br />/bin/ksh<br />This shell was written by David Korn of Bell labs. It is now provided as the standard shell on Unix systems.<br />AIX<br />C<br />/bin/csh<br />This shell was written at the University of California, Berkeley. <br />It provides a C-like language with which to write shell script.<br />BSD<br />TC<br />/bin/tcsh<br />This shell is available in the public domain. <br />It provides all the features of the C shell together with emacs style editing of the command line.<br />MAC OSX<br />Bash<br />/bin/bash<br />This is a public domain shell written by the Free Software Foundation under their GNU initiative.<br />Ubuntu, Centos<br />Reference: http://unixhelp.ed.ac.uk/shell/oview2.html<br />
  6. 6. Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
  7. 7. Summary of shell features
  8. 8. Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
  9. 9. Redirect usage</li></li></ul><li>1<br />2<br />Summary of shell features <br />Bourne<br />C<br />TC<br />Korn<br />Bash<br />Command history<br />no<br />yes<br />yes<br />yes<br />yes<br />Command alias<br />no<br />yes<br />yes<br />yes<br />yes<br />Shell scripts <br />yes<br />yes<br />yes<br />yes<br />yes<br />Filename completion <br />no<br />yes*<br />yes<br />yes*<br />yes<br />Command line editing <br />no<br />no<br />yes<br />yes*<br />yes<br />Job control <br />no<br />yes<br />yes<br />yes<br />yes<br />* Not the default setting for this shell.<br />Reference: http://unixhelp.ed.ac.uk/shell/oview1.1.html<br />
  10. 10. Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
  11. 11. Summary of shell features
  12. 12. Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
  13. 13. Redirect usage</li></li></ul><li>1<br />2<br />Configuration files for shells<br />sh<br />ksh<br />csh<br />tcsh<br />bash<br />/etc/.login<br />login<br />login<br />/etc/csh.cshrc<br />yes<br />yes<br />/etc/csh.login<br />login<br />login<br />~/.tcshrc<br />yes<br />~/.cshrc<br />yes<br />yes<br />~/.login<br />login<br />login<br />~/.logout<br />login<br />login<br />/etc/profile<br />login<br />login<br />login<br />~/.profile<br />login<br />login<br />login<br />~/.bash_profile<br />login<br />~/.bash_login<br />login<br />~/.bash_logout<br />login<br />~/.bashrc<br />int. + n/login <br />blank means a file is not read by a shell at all.<br />"yes" means a file is always read by a shell upon startup.<br />"login" means a file is read if the shell is a login shell.<br />"n/login" means a file is read if the shell is not a login shell.<br />"int." means a file is read if the shell is interactive.<br />Reference: http://en.wikipedia.org/wiki/Unix_shell<br />
  14. 14. Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
  15. 15. Summary of shell features
  16. 16. Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
  17. 17. Redirect usage</li></li></ul><li>1<br />2<br />Redirect descriptor<br />Descriptor<br />Description<br />0<br />Standard Input (Generally Keyboard)<br />1<br />Standard output (Generally Display/Screen)<br />2<br />Standard Error Ouput (Generally Display/Screen)<br />><br />Redirect standard output<br />2><br />Redirect standard error<br />2>&1<br />Redirect standard error to standard output<br /><<br />Redirect standard input from<br />>><br />Append to standard output<br />&<br />Run as background process<br />
  18. 18. Topics<br />SHELL<br />1<br /><ul><li>Different types of shell
  19. 19. Summary of shell features
  20. 20. Configuration files for shells</li></ul>REDIRECTION OF INPUT AND OUTPUT <br />2<br /><ul><li>Redirect descriptor
  21. 21. Redirect usage</li></li></ul><li>1<br />2<br />Redirect usage<br />Let me write the example about how to use redirection in various purpose.<br />Redirect standard output to a file <br />#!/bin/bash<br />/home/panu/start-application1.sh > file<br />Append standard output to a file <br />#!/bin/bash<br />/home/panu/start-application1.sh >> file<br />Redirect standard input from file<br />#!/bin/bash<br />/home/panu/start-application1.sh < file<br />Redirect standard output to “std_out.log” and redirect standard error to “std_error.log”<br />#!/bin/bash<br />/home/panu/start-application1.sh > std_out.log  2> std_err.log<br />Redirect standard error to standard output “std_out_err.log”<br />#!/bin/bash<br />/home/panu/start-application1.sh > std_out_err.log  2>&1 <br />
  22. 22. Thank you for watching<br />my presentation<br />Created by<br />panuausavasereelert<br />blog: http://panu.in.th<br />email: panu@panu.in.th<br />twitter: @panuinth<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×