当前位置: 首页 > 编程日记 > 正文

【转】sed 简明教程

本文转自:http://coolshell.cn/articles/9104.html

awk于1977年出生,今年36岁本命年,sed比awk大2-3岁,awk就像林妹妹,sed就是宝玉哥哥了。所以 林妹妹跳了个Topless,他的哥哥sed坐不住了,也一定要出来抖一抖。

sed全名叫stream editor,流编辑器,用程序的方式来编辑文本,相当的hacker啊。sed基本上就是玩正则模式匹配,所以,玩sed的人,正则表达式一般都比较强。

同样,本篇文章不会说sed的全部东西,你可以参看sed的手册,我这里主要还是想和大家竞争一下那些从手机指缝间或马桶里流走的时间,用这些时间来学习一些东西。当然,接下来的还是要靠大家自己双手。

用s命令替换

我使用下面的这段文本做演示:

1
2
3
4
5
6
7
8
9
$ cat pets.txt
This is my cat
  my cat's name is betty
This is my dog
  my dog's name is frank
This is my fish
  my fish's name is george
This is my goat
  my goat's name is adam

把其中的my字符串替换成Hao Chen’s,下面的语句应该很好理解(s表示替换命令,/my/表示匹配my,/Hao Chen’s/表示把匹配替换成Hao Chen’s,/g 表示一行上的替换所有的匹配):

1
2
3
4
5
6
7
8
9
$ sed "s/my/Hao Chen's/g" pets.txt
This is Hao Chen's cat
  Hao Chen's cat's name is betty
This is Hao Chen's dog
  Hao Chen's dog's name is frank
This is Hao Chen's fish
  Hao Chen's fish's name is george
This is Hao Chen's goat
  Hao Chen's goat's name is adam

注意:如果你要使用单引号,那么你没办法通过\’这样来转义,就有双引号就可以了,在双引号内可以用\”来转义。

再注意:上面的sed并没有对文件的内容改变,只是把处理过后的内容输出,如果你要写回文件,你可以使用重定向,如:

1
$ sed "s/my/Hao Chen's/g" pets.txt > hao_pets.txt

或使用 -i 参数直接修改文件内容:

1
$ sed -i "s/my/Hao Chen's/g" pets.txt

在每一行最前面加点东西:

1
2
3
4
5
6
7
8
9
$ sed 's/^/#/g' pets.txt
#This is my cat
#  my cat's name is betty
#This is my dog
#  my dog's name is frank
#This is my fish
#  my fish's name is george
#This is my goat
#  my goat's name is adam

在每一行最后面加点东西:

1
2
3
4
5
6
7
8
9
$ sed 's/$/ --- /g' pets.txt
This is my cat ---
  my cat's name is betty ---
This is my dog ---
  my dog's name is frank ---
This is my fish ---
  my fish's name is george ---
This is my goat ---
  my goat's name is adam ---

顺手介绍一下正则表达式的一些最基本的东西:

  • ^ 表示一行的开头。如:/^#/ 以#开头的匹配。
  • $ 表示一行的结尾。如:/}$/ 以}结尾的匹配。
  • \< 表示词首。 如 \<abc 表示以 abc 为首的詞。
  • \> 表示词尾。 如 abc\> 表示以 abc 結尾的詞。
  • . 表示任何单个字符。
  • * 表示某个字符出现了0次或多次。
  • [ ] 字符集合。 如:[abc]表示匹配a或b或c,还有[a-zA-Z]表示匹配所有的26个字符。如果其中有^表示反,如[^a]表示非a的字符

正规则表达式是一些很牛的事,比如我们要去掉某html中的tags:

html.txt
1
<b>This</b> is what <span style="text-decoration: underline;">I</span> meant. Understand?

看看我们的sed命令

1
2
3
4
5
6
7
8
# 如果你这样搞的话,就会有问题
$ sed 's/<.*>//g' html.txt
 Understand?
# 要解决上面的那个问题,就得像下面这样。
# 其中的'[^>]' 指定了除了>的字符重复0次或多次。
$ sed 's/<[^>]*>//g' html.txt
This is what I meant. Understand?

我们再来看看指定需要替换的内容:

1
2
3
4
5
6
7
8
9
$ sed "3s/my/your/g" pets.txt
This is my cat
  my cat's name is betty
This is your dog
  my dog's name is frank
This is my fish
  my fish's name is george
This is my goat
  my goat's name is adam

下面的命令只替换第3到第6行的文本。

1
2
3
4
5
6
7
8
9
$ sed "3,6s/my/your/g" pets.txt
This is my cat
  my cat's name is betty
This is your dog
  your dog's name is frank
This is your fish
  your fish's name is george
This is my goat
  my goat's name is adam

1
2
3
4
5
$ cat my.txt
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my fish, my fish's name is george
This is my goat, my goat's name is adam

只替换每一行的第一个s:

1
2
3
4
5
$ sed 's/s/S/1' my.txt
ThiS is my cat, my cat's name is betty
ThiS is my dog, my dog's name is frank
ThiS is my fish, my fish's name is george
ThiS is my goat, my goat's name is adam

只替换每一行的第二个s:

1
2
3
4
5
$ sed 's/s/S/2' my.txt
This iS my cat, my cat's name is betty
This iS my dog, my dog's name is frank
This iS my fish, my fish's name is george
This iS my goat, my goat's name is adam

只替换第一行的第3个以后的s:

1
2
3
4
5
$ sed 's/s/S/3g' my.txt
This is my cat, my cat'S name iS betty
This is my dog, my dog'S name iS frank
This is my fiSh, my fiSh'S name iS george
This is my goat, my goat'S name iS adam

多个匹配

如果我们需要一次替换多个模式,可参看下面的示例:(第一个模式把第一行到第三行的my替换成your,第二个则把第3行以后的This替换成了That)

1
2
3
4
5
$ sed '1,3s/my/your/g; 3,$s/This/That/g' my.txt
This is your cat, your cat's name is betty
This is your dog, your dog's name is frank
That is your fish, your fish's name is george
That is my goat, my goat's name is adam

上面的命令等价于:(注:下面使用的是sed的-e命令行参数)

1
sed -e '1,3s/my/your/g' -e '3,$s/This/That/g' my.txt

我们可以使用&来当做被匹配的变量,然后可以在基本左右加点东西。如下所示:

1
2
3
4
5
$ sed 's/my/[&]/g' my.txt
This is [my] cat, [my] cat's name is betty
This is [my] dog, [my] dog's name is frank
This is [my] fish, [my] fish's name is george
This is [my] goat, [my] goat's name is adam

圆括号匹配

使用圆括号匹配的示例:(圆括号括起来的正则表达式所匹配的字符串会可以当成变量来使用,sed中使用的是\1,\2…)

1
2
3
4
5
$ sed 's/This is my \([^,]*\),.*is \(.*\)/\1:\2/g' my.txt
cat:betty
dog:frank
fish:george
goat:adam

上面这个例子中的正则表达式有点复杂,解开如下(去掉转义字符):

正则为:This is my ([^,]*),.*is (.*)
匹配为:This is my (cat),……….is (betty)

然后:\1就是cat,\2就是betty

sed的命令

让我们回到最一开始的例子pets.txt,让我们来看几个命令:

N命令

先来看N命令 —— 把下一行的内容纳入当成缓冲区做匹配。

下面的的示例会把原文本中的偶数行纳入奇数行匹配,而s只匹配并替换一次,所以,就成了下面的结果:

1
2
3
4
5
6
7
8
9
$ sed 'N;s/my/your/' pets.txt
This is your cat
  my cat's name is betty
This is your dog
  my dog's name is frank
This is your fish
  my fish's name is george
This is your goat
  my goat's name is adam

也就是说,原来的文件成了:

1
2
3
4
This is my cat\n  my cat's name is betty
This is my dog\n  my dog's name is frank
This is my fish\n  my fish's name is george
This is my goat\n  my goat's name is adam

这样一来,下面的例子你就明白了,

1
2
3
4
5
$ sed 'N;s/\n/,/' pets.txt
This is my cat,  my cat's name is betty
This is my dog,  my dog's name is frank
This is my fish,  my fish's name is george
This is my goat,  my goat's name is adam
a命令和i命令

a命令就是append, i命令就是insert,它们是用来添加行的。如:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 其中的1i表明,其要在第1行前插入一行(insert)
$ sed "1 i This is my monkey, my monkey's name is wukong" my.txt
This is my monkey, my monkey's name is wukong
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my fish, my fish's name is george
This is my goat, my goat's name is adam
# 其中的1a表明,其要在最后一行后追加一行(append)
$ sed "$ a This is my monkey, my monkey's name is wukong" my.txt
This is my cat, my cat's name is betty
This is my monkey, my monkey's name is wukong
This is my dog, my dog's name is frank
This is my fish, my fish's name is george
This is my goat, my goat's name is adam

我们可以运用匹配来添加文本:

1
2
3
4
5
6
7
# 注意其中的/fish/a,这意思是匹配到/fish/后就追加一行
$ sed "/fish/a This is my monkey, my monkey's name is wukong" my.txt
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my fish, my fish's name is george
This is my monkey, my monkey's name is wukong
This is my goat, my goat's name is adam

下面这个例子是对每一行都挺插入:

1
2
3
4
5
6
7
8
9
$ sed "/my/a ----" my.txt
This is my cat, my cat's name is betty
----
This is my dog, my dog's name is frank
----
This is my fish, my fish's name is george
----
This is my goat, my goat's name is adam
----
c命令

c 命令是替换匹配行

1
2
3
4
5
6
7
8
9
10
11
$ sed "2 c This is my monkey, my monkey's name is wukong" my.txt
This is my cat, my cat's name is betty
This is my monkey, my monkey's name is wukong
This is my fish, my fish's name is george
This is my goat, my goat's name is adam
$ sed "/fish/c This is my monkey, my monkey's name is wukong" my.txt
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my monkey, my monkey's name is wukong
This is my goat, my goat's name is adam
d命令

删除匹配行

1
2
3
4
5
6
7
8
9
10
11
12
$ sed '/fish/d' my.txt
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my goat, my goat's name is adam
$ sed '2d' my.txt
This is my cat, my cat's name is betty
This is my fish, my fish's name is george
This is my goat, my goat's name is adam
$ sed '2,$d' my.txt
This is my cat, my cat's name is betty
p命令

打印命令

你可以把这个命令当成grep式的命令

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# 匹配fish并输出,可以看到fish的那一行被打了两遍,
# 这是因为sed处理时会把处理的信息输出
$ sed '/fish/p' my.txt
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my fish, my fish's name is george
This is my fish, my fish's name is george
This is my goat, my goat's name is adam
# 使用n参数就好了
$ sed -n '/fish/p' my.txt
This is my fish, my fish's name is george
# 从一个模式到另一个模式
$ sed -n '/dog/,/fish/p' my.txt
This is my dog, my dog's name is frank
This is my fish, my fish's name is george
#从第一行打印到匹配fish成功的那一行
$ sed -n '1,/fish/p' my.txt
This is my cat, my cat's name is betty
This is my dog, my dog's name is frank
This is my fish, my fish's name is george

几个知识点

好了,下面我们要介绍四个sed的基本知识点:

Pattern Space

第零个是关于-n参数的,大家也许没看懂,没关系,我们来看一下sed处理文本的伪代码,并了解一下Pattern Space的概念:

1
2
3
4
5
6
7
8
9
10
11
12
foreach line in file {
    //放入把行Pattern_Space
    Pattern_Space <= line;
    // 对每个pattern space执行sed命令
    Pattern_Space <= EXEC(sed_cmd, Pattern_Space);
    // 如果没有指定 -n 则输出处理后的Pattern_Space
    if (sed option hasn't "-n")  {
       print Pattern_Space
    }
}
Address

第一个是关于address,几乎上述所有的命令都是这样的(注:其中的!表示匹配成功后是否执行命令)

[address[,address]][!]{cmd}

address可以是一个数字,也可以是一个模式,你可以通过逗号要分隔两个address 表示两个address的区间,参执行命令cmd,伪代码如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
bool bexec = false
foreach line in file {
    if ( match(address1) ){
        bexec = true;
    }
    if ( bexec == true) {
        EXEC(sed_cmd);
    }
    if ( match (address2) ) {
        bexec = false;
    }
}

关于address可以使用相对位置,如:

1
2
3
4
5
6
7
8
9
10
# 其中的+3表示后面连续3行
$ sed '/dog/,+3s/^/# /g' pets.txt
This is my cat
  my cat's name is betty
# This is my dog
#   my dog's name is frank
# This is my fish
#   my fish's name is george
This is my goat
  my goat's name is adam
命令打包

第二个是cmd可以是多个,它们可以用分号分开,可以用大括号括起来作为嵌套命令。下面是几个例子:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$ cat pets.txt
This is my cat
  my cat's name is betty
This is my dog
  my dog's name is frank
This is my fish
  my fish's name is george
This is my goat
  my goat's name is adam
# 对3行到第6行,执行命令/This/d
$ sed '3,6 {/This/d}' pets.txt
This is my cat
  my cat's name is betty
  my dog's name is frank
  my fish's name is george
This is my goat
  my goat's name is adam
# 对3行到第6行,匹配/This/成功后,再匹配/fish/,成功后执行d命令
$ sed '3,6 {/This/{/fish/d}}' pets.txt
This is my cat
  my cat's name is betty
This is my dog
  my dog's name is frank
  my fish's name is george
This is my goat
  my goat's name is adam
# 从第一行到最后一行,如果匹配到This,则删除之;如果前面有空格,则去除空格
$ sed '1,${/This/d;s/^ *//g}' pets.txt
my cat's name is betty
my dog's name is frank
my fish's name is george
my goat's name is adam
Hold Space

第三个我们再来看一下 Hold Space

接下来,我们需要了解一下Hold Space的概念,我们先来看四个命令:

g: 将hold space中的内容拷贝到pattern space中,原来pattern space里的内容清除
G: 将hold space中的内容append到pattern space\n后
h: 将pattern space中的内容拷贝到hold space中,原来的hold space里的内容被清除
H: 将pattern space中的内容append到hold space\n后
x: 交换pattern space和hold space的内容

这些命令有什么用?我们来看两个示例吧,用到的示例文件是:

1
2
3
4
$ cat t.txt
one
two
three

第一个示例:

1
2
3
4
5
6
7
8
9
$ sed 'H;g' t.txt
one
one
two
one
two
three

是不是有点没看懂,我作个图你就看懂了。

第二个示例,反序了一个文件的行:

1
2
3
4
$ sed '1!G;h;$!d' t.txt
three
two
one

其中的 ‘1!G;h;$!d’ 可拆解为三个命令

  • 1!G —— 只有第一行不执行G命令,将hold space中的内容append回到pattern space
  • h —— 第一行都执行h命令,将pattern space中的内容拷贝到hold space中
  • $!d —— 除了最后一行不执行d命令,其它行都执行d命令,删除当前行

这个执行序列很难理解,做个图如下大家就明白了:

就先说这么多吧,希望对大家有用。

(全文完)

转载于:https://www.cnblogs.com/rwxwsblog/p/4501599.html

相关文章:

帕斯卡三角形(Pascal's triangle)

// The following code is compiled on VC2005 // #include "stdafx.h" /*-----------------------------------------------下面数值模式称为帕斯卡三角形(Pascals triangle)11 11 2 11 3 3 11 4 6 4 1 ...三角形边界上的数都是1&#xff0c;内部的每个数数是位…

Java项目:高校学生社团活动管理系统(java+springboot+freemark+jpa+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 前台&#xff1a; 1、社团信息浏览搜索、社团活动风采、新闻信息浏览搜索。 2、学生注册登录。 3、登录后可自己申请创建社团&#xff0c;也可申请加入其他社团活动。 4、管理自己社团的申请人员。 5个…

linux nfs共享文件

linux文件共享可以有多种方式&#xff1a;samba,nfs,ftp等等 nfs在linux之间效率高些&#xff1a; function nfs(){share_folder"/data1 192.168.0.239(rw,sync,no_root_squash)"yum install nfs-utils rpcbindecho $share_folder >> /etc/exportsexportfs -rv…

我有一个朋友写出了17种触发NPE的代码!避免这些坑

在JUnit4中,使用Mockito框架时,any() 是一个参数匹配器,当与基本数据类型一起使用时,需要使用相应的类型特定的匹配器,例如使用anyInt() 而不是any()。要防范它,不在高超的编码技巧,在细。的可能性,却并不是万能的,比如开发者在使用Optional,不检查是否存在,直接调用Optional.get(),那么会得到一个NoSuchElementException。我有一个朋友,写代码的时候常常遭到NPE背刺,痛定思痛,总结了NPE出没的17个场景,哪一个你还没有遇到过?

黑色星期五Friday the Thirteenth

题目描述 13号又是一个星期五。13号在星期五比在其他日子少吗?为了回答这个问题,写一个程序&#xff0c;要求计算每个月的十三号落在周一到周日的次数。给出N年的一个周期&#xff0c;要求计算1900年1月1日至1900N-1年12月31日中十三号落在周一到周日的次数&#xff0c;N为正整…

帕斯卡三角形与道路问题

苏珊很为难.她步行去学校,路上老是遇到斯廷基.斯廷基:"嘿嘿,苏珊,我可以陪你一起走吗?" 苏珊:"不!请走开."苏珊心想:我有办法了.每天早上我走不同的路线去学校.这样斯廷基就不知道在哪儿找到我了.这张地图表示苏珊的住所和学校之间的所有街道.苏珊去学校…

Java项目:学生信息管理系统(java+SSM+JSP+layui+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能包括&#xff1a; 三角色管理: 学生&#xff0c;教师&#xff0c;管理员&#xff0c;在线选课&#xff0c;成绩录入&#xff0c;学生管理&#xff0c;选课管理&#xff0c;教室管理等等。…

Java for LeetCode 067 Add Binary

Given two binary strings, return their sum (also a binary string). For example, a "11" b "1" Return "100". 解题思路&#xff1a; JAVA实现如下&#xff1a; static public String addBinary(String a, String b) {if (a.length() <…

ON DUPLICATE KEY UPDATE 导致mysql自增主键ID跳跃增长

具体解决方案可以根据项目来选择,如果项目不大,可以考虑1和2。如果不考虑高并发问题,可以考虑3。

一起学JDK源码 -- System类

System类是被final修饰的,不能被继承。

python csv模块心得

2019独角兽企业重金招聘Python工程师标准>>> with open(tiger.csv, wb) as csvfile:writer csv.writer(csvfile, quotingcsv.QUOTE_ALL)row [中国, 美国, 台湾, 马来西亚]writer.writerow([unicode(s).encode("utf-8") for s in row]) 转载于:https://m…

全局变量及输出语句

全局变量 是系统已经定义好的变量&#xff0c;主要反映sql数据库的操作状态。 全局变量名称以开头‘ 举例 identity:返回最后插入的标识值 error&#xff1a;返回执行的上一个T_sql语句的错误号 常用的输出语句 print&#xff1a;结果有消息中以文的形式显示 select&#xff1a…

Nested Mappings

/*hanzhiguang coded at 2009.07.30 1:20*/ // nesting_map.cpp : Defines the entry point for the console application. // /*------------------------------------------------------------------------- 给定自然数n,找出所有不同的有序对i和j,其中 1<j<i<n,使得…

Java项目:CRM客户关系管理系统(java+Springboot+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; Springboot项目CRM客户关系管理系统: 系统实现了CRM客户关系系统的基本功能&#xff0c;主要有看板&#xff08;当月参与的业务机会、当月转化情况、将要结束的业务机会等&#xff09;、业务机会&#xff0…

linux下occi操作oracle数据库,中文乱码的问题

转载&#xff1a;http://www.linuxidc.com/Linux/2008-02/11238.htm 前几日调通了OCI连接数据库的问题后&#xff0c;用Oracle自带的例子测试了一下&#xff0c;能正常读取数据&#xff08;都是英文的&#xff09;&#xff0c;就放心了&#xff0c;转去开发别的模块。这几天做数…

tomcat启动时一闪而过的问题

在CMD窗口中输入 cd E:\apache-tomcat-7.0.52\bin 后再输入E:显示进入相应目录E:\apache-tomcat-7.0.52\bin后&#xff0c;再输入startup 后窗口一闪而过&#xff0c;可通过以下步骤进行调试解决&#xff1a;1.检查确认JAVA_HOME配置正确&#xff0c;可以在命令行中输入java显示…

The Long-Term Stability of Ecosystems

The Long-Term Stability of Ecosystems Plant communities assemble themselves flexibly, and their particular structure depends on the specific history of the area. Ecologists use the term “succession”to refer to the changes that happen in plant communities…

big endian little endian

大端(big-endian)和小端(little-endian)<转>2007-12-07 20:36补&#xff1a;x86机是小端(修改分区表时要注意)&#xff0c;单片机一般为大端 今天碰一个关于字节顺序的问题,虽然看起来很简单,但一直都没怎么完全明白这个东西,索性就找了下资料,把它弄清楚. 因为现行的…

Java项目:学生考勤管理系统(java+SSM+Poi导出+Easyui+JFreeChart+maven+mysql)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 这个项目适合SSM框架的初学者&#xff08;涉及大量增删改查&#xff0c;很适合初学者&#xff09;以及对Shiro安全框架和Poi技术感兴趣的同学。 项目功能&#xff1a; 用户管理功能&#xff08;登录、退出登…

【STL源码剖析读书笔记】【第5章】关联式容器之hashtable

1、hashtable在插入、删除、搜寻操作上具有“常数平均时间”的表现&#xff0c;不依赖输入元素的随机性。 2、hashtable通过hashfunction将元素映射到不同的位置&#xff0c;但当不同的元素通过hash function映射到相同的位置时&#xff0c;便产生了“碰撞”问题。解决碰撞问题…

Event自定义事件

//index.html文件<!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><meta http-equiv"X-UA-Compatible"…

byte endian(biglittle endian)

1. 大小端的区别 little endian:把低位字节存放在内存的低位; // big endian: 将低位字节存放在内存的高位; 比如&#xff1a;0x1234,则12 就属于高位字节&#xff1b;34 属于低位字节 假如从地址0x0000 0000开始的一个字节中保存数据0x12345678, 这2中字节序在内存当中存…

鸡啄米vc++2010系列32(标签控件Tab Control 下)

上一节中鸡啄米讲了标签控件知识的上半部分&#xff0c;本节继续讲下半部分。 标签控件的创建 MFC为标签控件的操作提供了CTabCtrl类。 与之前的控件类似&#xff0c;创建标签控件可以在对话框模板中直接拖入Tab Control&#xff0c;也可以使用CTabCtrl类的Create成员函数创建。…

Java项目:网上图书商城系统(java+SSM+Jsp+MySQL+Redis+JWT+Shiro+RabbitMQ+EasyUI)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 这个项目涉及到Shiro整合JWT、秒杀功能所具备的基本要求(限流、乐观锁、接口隐藏、JMeter高并发测试等等)、消息中间件RabbitMQ的异步邮件通知和死信队列、沙箱支付宝模拟支付等等技术亮点。 项目功能&#…

虚拟机使用镜像文件安装系统

场景说明&#xff1a;指定Linux镜像之后&#xff0c;点击电源开始安装&#xff0c;安装完成之后&#xff0c;卸载ISO&#xff0c;进入BIOS&#xff0c;设置从硬盘启动。vmvare有提供快速安装的方式。当前的安装类似于手动安装&#xff0c;模拟真实的环境操作步骤&#xff1a;1&…

cmd命令简单别木马的蛛丝马迹

一些基本的Windows命令往往可以识别木马的蛛丝马迹&#xff0c;而且在保护网络安全上起到很大的作用。 检测网络连接 如果你怀疑自己的计算机上被别人安装了木马&#xff0c;或者是中了病毒&#xff0c;但是手里没有完善的工具来检测是不是真有这样的事情发生&#xff0c;那可以…

ubuntu常用翻译工具stardict

日常办公应用中&#xff0c;我们经常会碰到一些陌生的外文单词或文章需要翻译&#xff0c;在Windows平台上&#xff0c;可通过很多翻译工具来帮忙解决。当我们转到Ubuntu系统 中办公时&#xff0c;肯定也希望能有一款简单易用、功能强大的翻译工具。   这里给大家推荐Linux平…

Java项目:教务管理系统(java+JSP+Spring+SpringBoot+layui+maven)

源码获取&#xff1a;博客首页 "资源" 里下载&#xff01; 一、项目简述 功能包括&#xff1a; 三角色教师 管理员&#xff0c;学生教务管理系统&#xff0c;包括院系管理&#xff0c;课题综合管理&#xff0c;信息管理&#xff0c;以及差旅管理&#xff0c;学生选题…

jsp 环境配置记录

1. jdk&#xff0c;下载地址1 环境变量配置&#xff1a; 1&#xff09;新建 JAVA_HOME 变量 。 变量值填写jdk的安装目录&#xff08;本人是 C:\Java\jdk1.7.0) 2) 系统变量→寻找 Path 变量→编辑 在变量值最后输入 %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin; &#xff08;注意原…

一些关于找工作的书籍

技术类 算法导论&#xff1a;不要纠缠太难的部分&#xff08;红黑树、斐波那契额堆、NP、近似算法&#xff09;&#xff1b; 编程之美&#xff1a;仔细阅读&#xff0c;包括上面的智力题&#xff0c;纸上手写代码&#xff1b; 编程珠玑&#xff1a;建议仔细阅读&#xff0c;尤其…