当前位置:网站首页>正则表达式练习
正则表达式练习
2022-07-15 13:53:00 【51CTO】
1、显示/proc/meminfo文件中以大小s开头的行(要求,使用两种方法)

2、显示/etc/passwd文件中不宜/bin/bash结尾的行

3、显示用户root默认的shell程序

4、找出/etc/passwd中的两位或三位数

5、显示/etc/grub2.cfg文件中,至少以一个空白字符开头的且后面有非空白字符的行

6、找出netstat -tan命令结果中以listen后跟任意多个空白字符结尾的行

7、添加用户bash、tesbash、basher、sh、nologin(shell为/sbin/nologin),找出shell和用户同名的行

8、利用df 和grep,取出磁盘各分区利用率,并进行排序

9、显示三个用户root、lgw、admin的uid和默认shell(扩展正则)

10、找出/etc/rc.d/init.d/functions文件中行首为某单词(包括下划线)后面跟一个小括号的行


11、使用egrep 取出/etc/rc.d/init.d/functions中基名

11、使用egrep 取出/etc/rc.d/init.d/functions中目录名

12、统计last命令中以root登录的每个主机ip地址登录次数

13、利用正则表达式分别表示0-9、10-99、100-99、200-249、250-255;





14、显示ifconfig命令结果中所有的ipv4地址

15、将此字符串 welcome to lgw company 中的每个字符去重并排序,重复次数最多的排在最前面。

边栏推荐
- P4 可编程网卡 — In-Network Computing(在网计算)
- 在 Polkadot 中进行创建的三种方式 —— 平行链、平行线程、智能合约
- Machine learning - matrix derivation basic formula + common formula
- 技术分享 | 使用postman发送请求
- 从源码学习线程池的使用原理及核心思想解析
- OSPF experiment in mGRE environment
- Is it safe to open an account online now? Want to know how to open a stock account in a preferential way?
- What is the difference between statements and expressions
- ReentranLock及源码解析(学思想,一步一步点进源码)
- 响应式用户登录表单
猜你喜欢
随机推荐
非常全面的IReport的使用
强化学习(Q-Learning)与路径搜索(A*)的联系
Flock's yarn clustering mode (1)
启牛商学院股票开户安全吗靠谱吗,启牛怎么还能开户呢
Low EMI, high performance 4-channel LED driver tps61194pwprq1
Tab plus swiper long list scrolling
There are three ways to create in Polkadot - parallel chain, parallel thread, and smart contract
JVM memory model -- Characteristics and functions of runtime data area
怎么学习Object.defineProperty | 一篇文章带你们快速学会
Blue Bridge Cup VIP question bank
备忘录模式 - Unity
ORACLE中各个进程
The relationship between reinforcement learning (Q-learning) and path search (a*)
JS image editor plug-in filerobot
Responsive user login form
js图片编辑器插件Filerobot
On the difference and use of hash and history
mysql 传入List<String>进行查询的方法
Neural network loss and ACC drawing method plot
MySQL8.0学习记录18 - Tablespaces









