linux—shell

更新时间:2023-05-15 09:54:15 阅读: 评论:0

Linux Shell Scripting Tutorial Ver. 1.0
Written by Vivek G Gite
I N D E X
Introduction
q
Kernel
r
Shell
r瘦的英语怎么读
How to u Shell
r
Common Linux Command Introduction
r
Process
q
Why Process required
r
Linux commands related with process
r
Redirection of Standard output/input
q
Redirectors
r
Pipes
r
Filtersfuck away
r
Shell Programming
q
Variables in Linux
r
How to define Ur defined variables
r
Rules for Naming variable name
工作经历英文r
How to print or access value of UDV (Ur defined variables) r
How to write shell script
r
How to Run Shell Scripts
r
Quotes in Shell Scripts
r
Shell Arithmetic
r
Command Line Processing (Command Line Arguments) r
Why Command Line arguments required
r
Exit Status
r
Filename Shorthand or meta Characters (i.e. wild cards) r
Programming Commands
q
echo command
r
Decision making in shell script ( i.e. if command) r
test command or [ expr ]
r
Loop in shell scripts
r
The ca Statement
r
The read Statement
r
More Advanced Shell Script Commands
q
/dev/null - U to nd unwanted output of program r
Local and Global Shell variable (export command) r虚拟语气语法
Conditional && and ||
r
I/O Redirection and file descriptors
r
Functions
r
Ur Interface and dialog utility
r
trap command
r
getopts command
r
More examples of Shell Script (Exerci for You :-) r
© (I) Pvt. Ltd. All rights rerved.
Introduction
好好学习天天向上英文This tutorial is designed for beginners only and This tutorial explains the basics of shell programming by showing some examples of shell programs. Its not help or manual for the shell. While reading this tutorial you can find manual quite uful ( type man bash at $ prompt to e manual pages). Manual
contains all necessary information you need, but it won't have that much examples, which makes idea more clear. For that reason, this tutorial contains examples rather than all the features of shell. I assumes you have at least working knowledge of basic commands like how to create, copy, remove files/directories etc or how to u editor like vi or mcedit and login to your system. Before Starting Linux Shell Script Programming you must know
Kernel
q
Shell
brush是什么意思q
Process
q
conflictRedirectors, Pipes, Filters etc.
q
What's Kernel
Kernel is hart of Linux O/S. It manages resource of Linux O/S. Resources means facilities available in Linux. For eg. Facility to store data, print data on printer, memory, file management etc . Kernel decides who will u this resource, for how long and when. It runs your programs (or t up to execute binary files) It's Memory resident portion of Linux. It performance following task :-
I/O management
q
Process management
q
Device management
q
File management
q
Memory management
q
pasngerWhat's Linux Shell
Computer understand the language of 0's and 1's called binary language, In early days of computing, instruction are provided using binary language, which is difficult for all of us, to read and write. So in O/s there is special program called Shell. Shell accepts your instruction or commands in English and translate it into computers native binary language.
This is what Shell Does for US
hanshuang
You type Your command and shell convert it as
It's environment provided for ur interaction. Shell is an command language interpreter that executes commands read from the standard input device (keyboard) or from a file. Linux may u one of the following most popular shells (In MS-DOS, Shell name is COMMAND which is also ud for same purpo, but it's not as powerful as our Linux Shells are!)
Shell Name Developed by Where Remark
BASH ( Bourne-Again SHell )Brian Fox and Chet
Ramey
Free Software
Foundation
Most common shell in
Linux. It's Freeware
shell.
CSH (C SHell)Bill Joy University of California
(For BSD)
The C shell's syntax and
usage are very similar to
the C programming
language.
KSH (Korn SHell)David Korn AT & T Bell Labs
Any of the above shell reads command from ur (via Keyboard or Mou) and tells Linux O/s what urs want. If we are giving commands from keyboard it is called command line interface ( Usually in-front of $ prompt, This prompt is depend upon your shell and Environment that you t or by your System Administrator, therefore you may get different prompt ).
NOTE: To find your shell type following command
$ echo $SHELL
How to u Shell
To u shell (You start to u your shell as soon as you log into your system) you have to simply type commands. Following is the list of common commands. Linux Common Commands
NOTE that following commands are for New urs or for Beginners only. The purpo is if you u this command you will be more familiar with your shell and condly, you need some of the command in your Shell script. If you want to get more information or help for this command try following commands To e help or options related with date command try
$ date --help
or To e help or options related with ls command (Here you will screen by screen help, since help of ls command is quite big that can't fit on single screen )
$ ls --help | more
Syntax:    command-name  --help
Syntax:    man  command-name
Syntax:    info  command-name
See what happened when you type following
$ man ls
$ info bash
NOTE: In MS-DOS, you get help by using /? clue or by typing help command as C:\> dir /?
C:\> date /?
C:\> help time
C:\> help date
C:\> help
Linux Command
For this Purpo U this Command Syntax Example ( In front of $ Prompt)
To e date date$ date To e who's using
system.
who$ who Print working directory pwd$ pwd List name of files in
current directory
ls  or  dirs$ ls
To create text file
NOTE: Press and hold CTRL key and press D to stop or to end file  (CTRL+D)cat    > { file name }
$ cat  > myfile
type your text
when done press
^D
To text e files cat        {file name }$ cat  myfile To display file one full
screen at a time
more    {file name }$ more  myfile
To move or rename
file/directory mv        {file1}        {file2} $ mv  sales  sales.99
To create multiple file
copies with various link.
After this both oldfile
newfile refers to same
name天真少女
ln          {oldfile}      {newfile}$  ln    Page1    Book1 To remove file rm  file1$ rm    myfile

本文发布于:2023-05-15 09:54:15,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/90/109215.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:经历   语法   工作   虚拟语气
相关文章
留言与评论(共有 0 条评论)
   
验证码:
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图