前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Linux命令行与shell脚本编程大全(shell基础)

Linux命令行与shell脚本编程大全(shell基础)

作者头像
用户5760343
发布2022-05-18 15:41:35
8210
发布2022-05-18 15:41:35
举报
文章被收录于专栏:sktjsktj

1、if ;then xxx;fi if ;then elif xx;then xx;else xx;fi test condition -eq ge gt le lt ne str1 = str2 -z -n 长度非0 -d -e -f -r -s 非空 -w -x -o -G file1 -nt file2 -ot []&&[] []||[] case

read -t 5 -p "please input your name in 5 seconds" yourname 隐藏输入 read -s -p "Enter your password:" password 从文件中读取 cat file1| while read line do echo $line done STDIN STDOUT STDERR 2>file1 1>file2 &>file1 列出进程的文件描述符: lsof -a -p 1 -d 0,1,2 -p 指定PID -d 指定文件描述符 /dev/null 创建临时文件:mktemp testing.XXXXXX mktemp -t testing.XXXXXX mktemp -d testing.XXXXXX date|tee file date|tee -a file

捕获ctrl+c信号:trap "hehehe" SIGINT

image.png

捕获EXIT信号

image.png

nohup bash a.sh & && pid

nice -n 10 调整优先级

image.png

at -f a.sh now at atrm atq at now + 1 hour date ctrl+D

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022-05-13,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档