Bash shell的初步认识

Bash shell的初步认识

一、什么是Bash shell

Bash shell 是一个命令解释器,主要负责用户程序与内核进行交互操作的一种接口,将用户输入的命令翻译后传递给内核,内核驱动硬件去处理,最终输出结果到Bash shell控制台。

在这里插入图片描述
二、shell对linux系统的管理

文件管理、权限管理、用户管理、磁盘管理、网络管理、软件管理、服务管理等等。

三、shell的基本使用

  1. 基本语法:
命令选项参数
commandoptionsparameters

命令:整条shell命令的主体功能
选项:以 - 短格式选项(单个字节),-a ; 以 – 长格式选项(多个字节),–all
参数:命令的操作对象,文件、目录

实例:

[root@zpedu01 /opt/shell]#ls
123  2021-04-21  2021-04-23  2021-04-25  test  write.txt
[root@zpedu01 /opt/shell]#ls -a
.  ..  123  2021-04-21  2021-04-23  2021-04-25  test  write.txt
[root@zpedu01 /opt/shell]#ls -lh
total 164K
drwxr-xr-x.  2 root root   70 Apr 25 18:11 123
drwxr-xr-x.  2 root root   42 Apr 21 10:04 2021-04-21
drwxr-xr-x. 12 root root  139 Apr 25 11:58 2021-04-23
drwxr-xr-x.  2 root root   24 Apr 25 20:29 2021-04-25
drwxrwx---.  2 root root   19 Apr 26 17:20 test
-rw-r--r--.  1 root root 161K Apr 27 09:37 write.txt
  1. tabs命令补全功能

实例:

[root@zpedu01 /opt/shell]#ipta
#此时敲一下键盘的tabs,结果如下
[root@zpedu01 /opt/shell]#iptables
  1. alias别名的使用

临时定义别名:

#定义
[root@zpedu01 ~]#alias yy='yum install -y'
[root@zpedu01 ~]#yy vim
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.tuna.tsinghua.edu.cn
 * updates: mirrors.tuna.tsinghua.edu.cn
base                                                                                                                                                | 3.6 kB  00:00:00     
docker-ce-stable                                                                                                                                    | 3.5 kB  00:00:00     
extras                                                                                                                                              | 2.9 kB  00:00:00     
updates                                                                                                                                             | 2.9 kB  00:00:00     
Package 2:vim-enhanced-7.4.629-8.el7_9.x86_64 already installed and latest version
Nothing to do

临时取消别名:

[root@zpedu01 ~]#unalias yy

别名永久生效:

[root@zpedu01 ~]#echo "alias yy='yum install -y'" >> /etc/bashrc
[root@zpedu01 ~]#source /etc/bashrc

linux命令大全
linux命令手册

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

辛勤汗水@

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值