1征峦、查找/var目錄下不屬于root、lp食铐、gdm的所有文件
find /var -not \( -user root -o -user lp -o -user gdm \) -ls
2、統(tǒng)計/etc/init.d/functions文件中每個單詞的出現(xiàn)次數(shù),并排序(用grep和sed兩種方法分別實(shí)現(xiàn))
cat /etc/init.d/functions | sed -r 's@[^[:alpha:]]+@\n@g' | sort | uniq -c | sort -n
grep-Eo"[[:alpha:]]+"/etc/init.d/functions |sort|uniq-c
3击纬、利用sed取出ifconfig命令中本機(jī)的IPv4地址
ifconfig ens33 | sed -n '2p' | sed 's@.*inet @@' | sed 's@ netmask.*$@@'?
ifconfig ens33 | sed -rn '2s/.*t (.*) net.*/\1/p'? ? ?
ifconfig | sed -rn "s/.*inet (.*)netmask.*/\1/p" | head -n1? ??
4、總結(jié)yum的配置和使用钾麸,包括yum倉庫的創(chuàng)建
客戶端配置文件指定對應(yīng)服務(wù)器訪問方式如下幾種
yum install 安裝
yum groupinstall 組安裝
yum remove 卸載
yum groupremove 組卸載
yum list 顯示所有包
yum clean all 清除緩存
yum makecache 建立緩存
建立yum服務(wù)器:
mkdir /mnt/cdrom
mount /dev/sr0 /mnt/cdrom
vim /etc/yum.repos.d/base.repo
[base]
name=centos
baseurl=file:///mnt/cdrom
gpgcheck=0
yum install httpd -y
systemctl start httpd
mkdir -pv centos/{6,7}/os/x86-64/
mount /dev/sr0 /var/www/html/cetos/7/os/x86-64/
mount /dev/sr0 /var/www/html/cetos/6/os/x86-64/
配置yum客戶端
cat /etc/yum.repos.d/base.repo
[base]
name=centos
baseurl=http://yum服務(wù)器ip/centos/releasever/os/releasever/os/releasever/os/basearch
gpgcheck=0
5更振、編寫協(xié)調(diào)初始化腳本reset.sh、包括別名饭尝、提示符顏色肯腕、yum倉庫配置文件
6、安裝tree钥平、lftp实撒、telnet等包
yum -y install tree lftp telnet
7、在Centos7上編譯安裝apache2.4源碼包涉瘾,并啟動此服務(wù)
yum groupinstall "Development tools"
yum -y install apr-devel apr-util-devel openssl-devel pcre-devel
useradd -r(系統(tǒng)賬號) -u(指定用戶ID賬號) 80 -d(指定家目錄) /data/www/ -s /sbin/nologin apache
tar xf httpd-2.4.23.tar.bz2
./configure --prefix=/usr/local/apache
make && make install
echo 'PATH=/app/httpd/bin:$PATH' > /etc/profile.d/httpd.sh (放入PATH變量)
. /etc/profile.d/httpd.sh? 使PATH變量生效
apachectl start
vim /etc/man_db.conf? ? ? 添加一個MANPATH? ? /app/httpd/man