当前位置:网站首页>Shell Chapter 7 exercise
Shell Chapter 7 exercise
2022-07-25 11:23:00 【weixin_ fifty-one million eight hundred and eight thousand and 】
1、 Show /etc/rc.d/rc.sysinit File with size insensitive h Beginning line ;
[[email protected] zuoye]# grep -i ^[h] file
[[email protected] zuoye]# sed -n '/^[hH]/p' file
2、 Show /etc/passwd China and Israel sh The line at the end ;
[[email protected] zuoye]# grep sh$ /etc/passwd
3、 Show /etc/fstab China and Israel # start , One or more whitespace characters followed by , And then it's followed by any non whitespace line ;
[[email protected] zuoye]# grep ^#" "[^" "].* /etc/fstab
[[email protected] zuoye]# sed -n '/^# [^ ].*/p' /etc/fstab
4、 lookup /etc/rc.d/rc.local Contained in the “ With to Start with to ending ” Word serial of ;
[[email protected] zuoye]# grep ^to.*to$ /etc/rc.d/rc.local
[[email protected] zuoye]# sed -n '/^to.*to$/p' /etc/rc.d/rc.local
5、 lookup /etc/inittab contains “ With s start , And d Ending words ” Pattern line ;
[[email protected] zuoye]# grep -E "\<s[^ +*]+*d\>" /etc/inittab
6、 lookup ifconfig In the command result 1-255 Integer between ;
ifconfig |grep -w "`seq 255`"
7、 Show /var/log/secure The file contains “Failed” or “FAILED” The line of ;
[[email protected] zuoye]# grep -E "(Failed|FAILED)" /var/log/secure
8、 stay /etc/passwd Take out the default shell by bash The line of ;
[[email protected] zuoye]# grep bash$ /etc/passwd
9、 List... In long format /etc/ Directory to ns start 、.conf File information at the end ;
[[email protected] zuoye]# ll /etc/ |grep -E "\<ns[^ +*]+*.conf\>"
10、 Highlight passwd Colon in file , And the characters on both sides
[[email protected] zuoye]# grep -E ".?:.?" /etc/passwd
边栏推荐
猜你喜欢
![[flask advanced] combined with the source code, explain the operation mechanism of flask (in and out of the stack)](/img/a0/9110b83ff5c7965809bbc9f3948956.jpg)
[flask advanced] combined with the source code, explain the operation mechanism of flask (in and out of the stack)

推荐系统-协同过滤在Spark中的实现

HCIA experiment (07) comprehensive experiment
![TPS calculation in performance test [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]](/img/b2/7a6b99f0ec907b83ac58ed44b23062.png)
TPS calculation in performance test [Hangzhou multi tester] [Hangzhou multi tester _ Wang Sir]

100W!

Flame framework - Flame WTF form: file upload, verification code

PostgreSQL踩坑 | ERROR: operator does not exist: uuid = character varying

学习路之PHP--Phpstudy 提示 Mysqld.Exe: Error While Setting Value ‘NO_ENGINE_SUBSTITUTION 错误的解决办法

HCIP(12)

MLX90640 红外热成像仪测温模块开发笔记(五)
随机推荐
MLX90640 红外热成像仪测温模块开发笔记(五)
shell-第六章练习
The B2B2C multi merchant system has rich functions and is very easy to open!!!
Flame framework - Flame WTF form: file upload, verification code
Nowcodertop1-6 - continuous updating
SQL语言(三)
The most complete detailed tutorial on importing ad into lichuanyuan device packaging Library in history (always white and always cool)
PostgreSQL stepping on the pit | error: operator does not exist: UUID = character varying
Learn NLP with Transformer (Chapter 3)
Learning Weekly - total issue 63 - an open source local code snippet management tool
ESP8266 使用 DRV8833驱动板驱动N20电机
Learn PHP -- phpstudy tips mysqld Exe: Error While Setting Value ‘NO_ ENGINE_ Solution of substitution error
SQL语言(一)
The University of Gottingen proposed clipseg: a model that can perform three segmentation tasks simultaneously using text and image prompts
Hcip experiment (03)
Nowcodertop12-16 - continuous updating
[递归] 938. 二叉搜索树的范围和
Flask framework - session and cookies
Multiply Floyd "suggestions collection"
mysql事务是什么