我需要能够显示每个服务端口打开的I,每个服务按字母顺序列出,格式如下:
ftp
============
192.168.33.226
192.168.33.129
192.168.33.220
http-alt
============
192.168.33.243
192.168.33.252
我有一个包含ips列表的nmap结果的文件,如下所示:
Nmap scan report for 192.168.33.252
Host is up (0.041s latency).
Not shown: 999 filtered ports
PORT STATE SERVICE
800
我想从文件中提取不包含特定模式的所有行。
pattern="tmp/[...]/include/linux/*.h"
file contains:
17937;/home/[...]/tmp/[...]/include/linux/header.h;484;16;[Other text here]
37417;/home/[...]/tmp/[...]/src/file.cpp;1851;41;[Other text here]
17945;/home/[...]/tmp/[...]/include/linux/*/header.h;484;16;[Other text her
Bash if条件在比较特定字符串时不匹配
匹配字符串:
Red Hat Enterprise Linux Server release 7.2 (Maipo)
代码:
machineOSVersion="Red Hat Enterprise Linux Server release 7.2 (Maipo)"
modifiedOSVersion="CentOS Linux release 7 OR Red Hat Enterprise Linux Server release 7.2 (Maipo)"
if [[ ${machineOSVersion} =
出于测试目的,我创建了以下目录。
user@linux:~$ mkdir dir0{1..3}
user@linux:~$ ls -l
total 12K
drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir01
drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir02
drwxr-xr-x 2 user user 4.0K Mei 31 10:45 dir03
user@linux:~$
然后,我用find -exec删除了它
user@linux:~$ find -type d -exec rmdir {}
有人能看到我在这里做错了什么吗?
local VERSION=$(java -version 2>&1 | grep "java version")
if [[ ! "$VERSION" =~ *"1.8.0_33"* ]]; then
ERROR (not code, just place holder)
else
NO ERROR (not code, just place holder)
fi
谢谢你的快速帮助!
* UPDATE *
以下是我还尝试过的:
local VERSION=$(java -version 2
我需要在shell脚本中使用echo和grep。我能用吗?
我试过了,但不正确:
echo Linux: grep "Linux" ~/workspace/ep-exercicios/m1/e2/intro-linux.html | wc -w
我需要显示消息:
Linux: (number of Linux word on the document).
示例:
Linux: 945
我在输入'go install‘时收到这个错误信息。
root@kali:~/Scripts/Enum/gobuster# go install
go install: no install location for directory /root/Scripts/Enum/gobuster outside GOPATH
For more details see: go help gopath
我的“go env”如下所示。
root@kali:~/Scripts/Enum/gobuster# go env
GOARCH="386"
GOBIN=""