C114门户论坛百科APPEN| 举报 切换到宽版

亚星游戏官网

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索
查看: 2298|回复: 1

[技术讨论] [原创]shell实践中总结 [复制链接]

军衔等级:

亚星游戏官网-yaxin222  中士

注册:2009-4-23
发表于 2012-5-8 09:57:37 |显示全部楼层
1. 在shell中无意中按了ctrl+s,系统怎么也登录不上去了,网上搜到解决方法Key        Function
Ctrl-c        Kill foreground process
Ctrl-z        Suspend foreground process
Ctrl-d        Terminate input, or exit shell
Ctrl-s        Suspend output
Ctrl-q        Resume output
Ctrl-o        Discard output
Ctrl-l        Clear screen
但是控制字符都是可以用(stty命令)更改的。
楼主可以用stty -a看看终端配置。



2. 想连续实行某条命令的脚本
{
while TRUE
do
brctl show ===> your command here
sleep 1
done
}


3. grep 替换后
grep 'xxx|yyy'  ====>注意是单引号,否则当成字符串了


4. 打包特定代码的脚本
find . -name "xyz*."[ch] -exec cp {} ./mycode \;
==>在当前目录下查找包含xyz的C和H文件,然后拷贝到当前目录的mycode下面。


。。。

举报本楼

本帖有 1 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

手机版|C114 ( 沪ICP备12002291号-1 )|联系大家 |网站地图  

GMT+8, 2024-9-26 03:24 , Processed in 0.102872 second(s), 15 queries , Gzip On.

Copyright © 1999-2023 C114 All Rights Reserved

Discuz Licensed

回顶部
XML 地图 | Sitemap 地图