安裝Apache https://blog.csdn.net/qq_33440246/article/details/79436858
2019-01-27
我學過c,c++{忘完了),學過一年的嵌入式開發,也就是單片機,總之代碼還是寫了很多的,編程思想也還是有一點的,老師一直擔心同學們在這里只記了語法而沒有學到編程思想,其實我想說來學Linux的至少也學過c語言啊。其實不用太擔心的,只要c夠扎實,shell編程很好學的。
2018-11-10
#!/bin/bash
2
3 test=$(df -h|grep -i "^/dev"|awk '{printf $5"\n"}'|cut -d "%" -f 1)
4
5 for num in $test
6 do
7 if [ "$num" -ge 90 ];then
8 echo -e "\e[0;31m 硬盤空間已不足,請及時清理 \e[1m"
9 fi
10 done
2
3 test=$(df -h|grep -i "^/dev"|awk '{printf $5"\n"}'|cut -d "%" -f 1)
4
5 for num in $test
6 do
7 if [ "$num" -ge 90 ];then
8 echo -e "\e[0;31m 硬盤空間已不足,請及時清理 \e[1m"
9 fi
10 done
2018-10-15
#!/bin/bash
test=$(env|grep "USER"| cut -d "=" -f 2)
#首先從系統變量中找到USER用戶當前是誰
if [ "$test"=="root" ]
#判斷是否為root
then
if [ -x /root ]
#判斷是否擁有root權限
then
echo "該用戶是"$test
fi
fi
test=$(env|grep "USER"| cut -d "=" -f 2)
#首先從系統變量中找到USER用戶當前是誰
if [ "$test"=="root" ]
#判斷是否為root
then
if [ -x /root ]
#判斷是否擁有root權限
then
echo "該用戶是"$test
fi
fi
2018-10-15
env | grep USER | awk 'BEGIN{FS="="} {print $2}'
2018-08-26