当前位置:网站首页>[日常办公][shell]常用代码段
[日常办公][shell]常用代码段
2022-08-04 05:31:00 【xcy6666】
数组, 字符串匹配
arr=("1995" "1995x" "1995ee" "1995ss" "199")
for i in ${arr[*]}; do
if [[ "${i}" =~ "1995".* ]]; then
echo "matched $i"
if [[ $i = "1995ee" ]]; then
echo -e "\tgot $i"
fi
else
echo -e "\t\t\tnot matched $i"
fi
done
查找并kill进程
$ ps -aux | grep name_of_process | grep -v grep | awk '{print $2}' | while read pid; do sudo kill -9 $pid; done
边栏推荐
猜你喜欢
随机推荐
MNIST handwritten digit recognition, sorted by from two to ten
fuser 使用—— YOLOV5内存溢出——kill nvidai-smi 无pid 的 GPU 进程
Deep Learning Theory - Overfitting, Underfitting, Regularization, Optimizers
arm-2-基础阶段
bind()系统调用的用处
Amazon Cloud Technology Build On 2022 - AIot Season 2 IoT Special Experiment Experience
卷积神经网络入门详解
【Copy攻城狮日志】飞浆学院强化学习7日打卡营-学习笔记
腾讯、网易纷纷出手,火到出圈的元宇宙到底是个啥?
【代码学习】
Android foundation [Super detailed android storage method analysis (SharedPreferences, SQLite database storage)]
投稿相关
makefile基础学习
动手学深度学习__数据操作
LeetCode_Dec_1st_Week
PostgreSQL schema (Schema)
典型CCN网络——efficientNet(2019-Google-已开源)
Qt日常学习
周志华机器学习
AWS uses EC2 to reduce the training cost of DeepRacer: DeepRacer-for-cloud practical operation









