Linux学习day4

1.本地yum仓库配置

①挂载centos镜像到/mnt/cdrom目录
②安装httpd(yum install -y httpd)并启动httpd服务(service httpd start)
③配置yum源到httpd中
④备份本机yum源并进行配置将源指向自己`

[root@node1 /]# cd /etc/yum.repos.d/
[root@node1 yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak
[root@node1 yum.repos.d]# vim CentOS-Base.repo
[base]
name=CentOS-Local
baseurl=file:///var/www/html/Packages
gpgcheck=0
enabled=1 #增加改行,使能
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7`

2.shell脚本编程

①脚本以#!/bin/bash开头
②脚本需要可执行权限
③helloworld代码

[root@hadoop102 datas]$ touch helloworld.sh
[root@hadoop102 datas]$ vim helloworld.sh
[root@hadoop102 datas]$ chmod u+x helloworld.sh
在helloworld.sh中输入如下内容
#!/bin/bash   
echo "helloworld"

④执行方式:
(1)赋予脚本权限:chmod 777 helloworld.sh
(2)执行脚本/root/helloWorld.sh.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值