Shell学习第一章:linux快速介绍

参考文献:https://bash.cyberciti.biz/guide/Main_Page   Linux Shell Scripting

第一章 Quick introduction to linux

1、输入下面指令,查看自己的系统中支持的shell

cat /etc/shell

2、linux下的帮助手册man命令和info命令

man date
info ls
info man
man info
info date

3、linux下的很多命令都接受--help 或者-h为参数,试着输入下面的指令

date --help

通过下面的指令形式来获得linux下某一个命令的帮助文档

man commandName
info commandName
commandName -h
commandName --help

4、unix的一些设计哲学理念

1、Do one thing and do it well - Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface.
2、Everything is file - Ease of use and security is offered by treating hardware as a file.
3、Small is beautiful.
4、Store data and configuration in flat text files - Text file is a universal interface. Easy to create, backup and move to another system.
5、Use shell scripts to increase leverage and portability - Use shell script to automate common tasks across various UNIX / Linux installations.
6、Chain programs together to complete complex task - Use shell pipes and filters to chain small utilities that perform one task at time.
7、Choose portability over efficiency.
8、Keep it Simple, Stupid (KISS).

5、shell Script 或shell scripting是什么?

通常来说,shell是交互式的,你输入一个命令和一些参数,然后shell开始执行;但当你将很多命令写入到一个文件中,然后告诉shell去执行这个文件,并不输入任何参数,这种方式就叫做shell script或者shell program。

6、shell script包含什么?

1、Shell keywords such as if..else, do..while.
2、Shell commands such as pwd, test, echo, continue, type.
3、Linux binary commands such as w, who, free etc..
4、Text processing utilities such as grep, awk, cut.
5、Functions - add frequent actions together via functions. For example, /etc/init.d/functions file contains functions to be used by most or all system shell scripts in the /etc/init.d directory.
6、Control flow statments such as if..then..else or shell loops to perform repeated actions.

7、每一个shell 都包含目的

Each script has purpose
1、Specific purpose - For example, backup file system and database to NAS server.
2、Act like a command - Each shell script is executed like any other command under Linux.
3、Script code usability - Shell scripts can be extended from existing scripts. Also, you can use functions files to package frequently used tasks.

8、为什么需要shell script?

shell脚本可以让你很方便地完成一些重复的工作,当你发现你一直在做一些重复的事情时,你应该写一个shell脚本,让它自动完成。






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值