linux命令学习-首篇
来源:互联网 发布:sql2005数据修复 编辑:程序博客网 时间:2024/06/05 08:01
在home目录的.bashrc 添加了如下逻辑,目的是可以"每日"学习或复习linux命令
# 学习linux命令# echo "Did you know that:"; whatis $(ls /bin | shuf -n 1)cowsay -f $(ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1) $(whatis $(ls /bin) 2>/dev/null | shuf -n 1)
效果图:
上面逻辑的解读:
前置基础知识点:
$(xxx) : 即运行bash脚本且得到脚本的输出信息(字符串)
2>/dev/null : 错误输出重定向到黑洞(垃圾箱),支除噪音 注: /dev/null是linux的空设备
cowsay: 是生成ASCII图像的程序,显示一头牛在说话;
whatis : 输出某个linux命令的功能简介;
shuf: 将内容随机输出;
具体逻辑分析:
echo "Did you know that:"; whatis $(ls /bin | shuf -n 1)
1.ls /bin 列出/bin目录下的linux命令;
2.shuf -n 1 随机选择一条linux命令;
3.输出命令的功能简介
cowsay -f $(ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1) $(whatis $(ls /bin) 2>/dev/null | shuf -n 1)
1.如上 $(whatis $(ls /bin) 2>/dev/null | shuf -n 1) 获取命令功能简介;
2.随机选一个图片主角,说话的小动物 ls /usr/share/cowsay/cows | shuf -n 1 | cut -d. -f1
3.输出内容(ASCII 图)
0 0
- linux命令学习-首篇
- Linux学习-Linux命令
- Linux 命令学习 -wc命令
- linux学习命令--sed命令
- LINUX命令学习笔记
- linux命令学习
- Linux命令学习 DD
- linux命令学习
- Linux 命令学习笔记
- linux命令学习
- linux命令学习一
- linux学习命令
- linux终端命令学习
- Linux 命令学习
- Linux 基础命令学习
- linux 命令学习
- linux学习笔记--命令
- linux命令学习
- Data References and Anonymous St…
- perl hash数组(转)
- IOS基础:声音调用
- How to pass a hash to a subrouti…
- 9GAG客户端,五一3天尽心之作,Just Android Design!(开源)+毛玻璃效果
- linux命令学习-首篇
- 女码农献丑-企业智能机器人客服(图灵机器人)
- References....
- 如果不能打开plus.google.com,需…
- Coursera Machine Learning 8.2: Principal Component Analysis
- changefonts.ini
- Subversion快速入门教程
- Kindle KDK Publishing
- subversion 命令