一、思维导图
二、练习
#!/bin/bash
mkdir ~/dir
mkdir ~/dir/dir1
mkdir ~/dir/dir2
cp -r * ~/dir/dir1/
cp -r *.sh ~/dir/dir2/
cd ~/dir/dir2/
tar -cvJf dir2.tar.xz dir2
mv dir2.tar.xz ~/dir/dir1/
cd ~/dir/dir1
tar -xvJf dir2.tar.xz
#!/bin/bash
head -5 /etc/group|tail -1
mkdir /home/ubuntu/copy
cd /home/ubuntu/copy
sudo cp /etc/shadow test
sudo chown root test
sudo chmod 700 test
#!/bin/bash
str="www.hqyj.com"
expr substr "$str" 1 3
expr substr "$str" 5 4
expr substr "$str" 10 3
#!/bin/bash
read -p "请输入数组元素,用空格分隔:" arrecho "数组元素为:${arr[@]}"echo "数组元素的个数为:${#arr[@]}"