常用linux 命令
ls -lt 时间倒序
ls -ltr 时间正序
ls -lS 大小倒序
ls -li 显示inode
cat smb_quicktest.py| grep -E 'form_re|my_sa|isi_simple'
-i 忽略大小写
[root@centos7 temp]# grep -i abcd file
ABCD
function abcd() {
[root@centos7 temp]#
选项-o表示只输出匹配的字符,而不是整行:
[root@centos7 temp]# grep -oi abcd file
ABCD
abcd
[root@centos7 temp]#
选项-c统计匹配的行数:
[root@centos7 temp]# grep -oic abcd file
2
[root@centos7 temp]#
选项-v表示取反匹配,如输出/etc/passwd中不以/sbin/nologin结尾的行:
[root@centos7 temp]# grep -v "/sbin/nologin$" /etc/passwd
root❌0:0:root:/root:/bin/bash
sync❌5:0:sync:/sbin:/bin/sync
shutdown❌6:0:shutdown:/sbin:/sbin/shutdown
halt❌7:0:halt:/sbin:/sbin/halt
learner❌1000:1000::/home/learner:/bin/bash
root@DTRDUCLI439077:/usr/local/ds_stress [master *%] # grep -v "rmdir" 111.txt
FAIL:: 4244:Sun 05/26/2019 14:02:42.747: create: \proto-g6-efsp01-t23.lorg.west.isilon.com\ifs\agefs_test_b2ee17c2-802d-11e9-99b2-005056900298\XPRO006-02\proto-g6-efsp01\smb_user_81\00000140\data\PSVZf7Qf4xO9EpiN6tcyZv\s.dip, expected=943616, actual=1014160, bs=235904, cnt=4, validated=0, coheren
选项-w表示匹配整个单词:
[root@centos7 temp]# grep here file
here
there
[root@centos7 temp]# grep -w here file
here
[root@centos7 temp]#
选项-n表示显示行号:
[root@centos7 temp]# grep -n "[1]" /etc/passwd
1:root❌0:0:root:/root:/bin/bash
5:lp❌4:7:lp:/var/spool/lpd:/sbin/nologin
24:learner❌1000:1000::/home/learner:/bin/bash
选项-A N、-B N、-C N表示输出匹配行和其'周围行'
-A N 表示输出匹配行和其之后(after)的N行
-B N 表示输出匹配行和其之前(before)的N行
-C N 表示输出匹配行和其之前之后各N行
统计出现success的次数
ali1-x0jjn6l-1# cat smb_quicktest.signing.log | grep -o success | grep -c success
367
文件夹下 文件夹的个数 recursive:
ls -lR|grep "^d"|wc -l
rl ↩︎
常用linux 命令的更多相关文章
- 十五个最常用Linux命令行 - imsoft.cnblogs
众多Linux管理员在使用Linux的时候会经常使用到很多Linux命令行,其中有绝大部分不是经常使用到的.在本文中主要为大家总结了经常使用的十五个最常用Linux命令行,希望对刚刚接触Linux命令 ...
- 常用Linux命令小结
常用Linux命令小结 Linux下有很多常用的很有用的命令,这种命令用的多了就熟了,对于我来说,如果长时间没有用的话,就容易忘记.当然,可以到时候用man命令查看帮助,但是,到时候查找的话未免有些临 ...
- 77个常用Linux命令和工具
77个常用Linux命令和工具 Linux管理员不能单靠GUI图形界面吃饭.这就是我们编辑这篇最实用Linux命令手册的原因.这个指南是特别为Linux管理员和系统管理员 设计的,汇集了最有用的一些工 ...
- 常用Linux命令笔记
任何脱离业务的架构都是耍流氓 只记录实际常用的Linux命令 常用Linux命令 查找安装路径: whereis nginx 查询nginx进程: ps aux|grep nginx 查看 CentO ...
- 常用 Linux 命令的基本使用
常用 Linux 命令的基本使用 操作系统 作用:管理好硬件设备,让软件可以和硬件发生交互类型 桌面操作系统 Windows macos linux 服务器操作系统 linux Windows ser ...
- 【Linux基础】常用Linux命令: cd, cp, ls, mkdir, mv, rm, su, uname
常用Linux命令:cd, cp, ls, mkdir, mv, rm, su, uname cd命令:切换当前工作目录至 dirName(目录参数) 其中 dirName 可为绝对路径或相对路径.若 ...
- # 常用linux 命令和相关问题解决
最近试着自己部署了服务器,在unbantu的环境下 学习了很多新知识 也遇到了很多问题,现在腾出手了,总结一下 常用Linux命令 目录操作 pwd: 查看当前路径 cd: 移动 cd .. : 返回 ...
- Linux - 常用 Linux 命令的基本使用
常用 Linux 命令的基本使用 目标 理解学习 Linux 终端命令的原因 常用 Linux 命令体验 01. 学习 Linux 终端命令的原因 Linux 刚面世时并没有图形界面,所有的操作全靠命 ...
- 几个常用linux命令语句
几个常用linux命令 英文原文:What are the most useful "Swiss army knife" one-liners on Unix? 下面的这些内容是 ...
- 06_常用 Linux 命令的基本使用
常用 Linux 命令的基本使用 目标 理解学习 Linux 终端命令的原因 常用 Linux 命令体验 01. 学习 Linux 终端命令的原因 Linux 刚面世时并没有图形界面,所有的操作全靠命 ...
随机推荐
- Effective C++: 01让自己习惯C++
01:视C++为一个语言联邦 1:今天的C++已经是个多重范型编程语言(multiparadigm programming language),一个同时支持过程形式(procedural).面向对象形 ...
- F4NNIU 的常用 Linux 命令(2019-08-24)
目录 F4NNIU 的常用 Linux 命令 停止防火墙 查看 IP 址 启动 deepin 的桌面 查看当前时区 查看 CPU 和内存信息 用户相关 日志 F4NNIU 的常用 Linux 命令 记 ...
- SDUT-2088_数据结构实验之栈与队列十一:refresh的停车场
数据结构实验之栈与队列十一:refresh的停车场 Time Limit: 1000 ms Memory Limit: 65536 KiB Problem Description refresh最近发 ...
- 2018-2-13-win10-uwp-如何让WebView标识win10手机
title author date CreateTime categories win10 uwp 如何让WebView标识win10手机 lindexi 2018-2-13 17:23:3 +080 ...
- 2018-8-10-WPF-如何在绑定失败异常
title author date CreateTime categories WPF 如何在绑定失败异常 lindexi 2018-08-10 19:16:53 +0800 2018-05-17 1 ...
- H3C 星型以太网拓扑扩展
- SuperSocket获取会话的连接和断开事件
关键字: 连接事件, 断开事件, OnSessionStarted,OnSessionClosed, NewSessionConnected, SessionClosed AppSession 的虚方 ...
- html5 canvas 3d屏保 源码
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <met ...
- Attention is all your need 谷歌的超强特征提取网络——Transformer
过年放了七天假,每年第一件事就是立一个flag——希望今年除了能够将技术学扎实之外,还希望能够将所学能够用来造福社会,好像flag立得有点大了.没关系,套用一句电影台词为自己开脱一下——人没有梦想,和 ...
- Python--day62--什么时候用GET请求和POST请求
1,GET请求和POST请求 都数据HTTP协议规定的请求方法 2,什么时候用GET请求? 1,浏览器想要得到一个HTML页面的时候 2,搜索引擎查询关键字的时候 3,什么时候用POST? 1,像后端 ...