Linux操作系统极速入门[常用指令](安装jdk,MySQL,nginx),以及在linux对项目进行部署。

linux概述:

Linux是一套免费使用和自由传播的操作系统


我们为什么要学,Linux?

   

 主流操作系统:

        
        linux系统版本:

            内核版:
  •  由linux核心团队开发,维护
  •  免费,开源
  •  负责控制硬件

            发行版:
  •  基于linux内核版进行扩展
  • 由各个linux厂商开发,维护
  • 有收费版本和免费版本
Linux系统发行版:
  • Ubuntu:以桌面应用为主
  • RedHat:应用最广泛、收费
  • CentOS:RedHat的社区版、免费
  • openSUSE:对个人完全免费、图形界面华丽
  • Fedora:功能完备、快速更新、免费
  • 红旗Linux:北京中科红旗软件技术有限公司开发


    系统安装:

        Linux系统的安装方式:
  •  物理机安装:直接将操作系统安装到服务器硬件上
  • 虚拟机安装:通过虚拟机软件安装

                虚拟机(Virtual Machine)指通过软件模拟的具有完整硬件系统功能、运行在完全隔离环境中的完整计算机系统。

                    常用的虚拟机软件:
  •  VMWare
  • VirtualBox
  • VMLite WorkStation
查看IP地址:

通过如下命令查看当前Linux的IP地址:ip addr

    远程连接:

 常用的SSH(Secure Shell,安全外壳协议)远程连接工具:Putty、SecureCRT、Xshell、finalShell

        

直接双击运行FinalShell的安装程序完成安装即可

finalShell连接linux:

点击左上角一个像文件的图标,新建连接:

点击ssh连接:

点击ssh连接,输入必要的连接信息:

出现的弹窗:

连接成功后的页面:


    Linux的目录介绍:

  • /是所有目录的顶点
  • 目录结构像一颗倒挂的树

        Linux系统目录:
  •   bin 存放二进制可执行文件
  •   boot 存放系统引导时使用的各种文件
  •   dev 存放设备文件
  •  etc 存放系统配置文件
  •  home 存放系统用户的文件
  •    lib 存放程序运行所需的共享库和内核模块
  •  opt 额外安装的可选应用程序包所放置的位置
  •   root 超级用户目录
  • sbin 存放二进制可执行文件,只有root用户才能访问
  •  tmp 存放临时文件
  •  usr 存放系统应用程序
  • var 存放运行时需要改变数据的文件,例如日志文件

linux常用命令:


    文件目录操作命令:

        ls

显示指定目录下的内容


            语法:

 ls [-al] [dir]

[root@localhost usr]# ls


[root@localhost usr]# ls -a

[root@localhost usr]# ls -l

[root@localhost usr]# ll


            说明:

  •   -a 显示所有文件及目录 (. 开头的隐藏文件也会列出)
  • -l 除文件名称外,同时将文件型态(d表示目录,-表示文件)、权限、拥有者、文件大小等信息详细列出

            注意:

由于我们使用ls命令时经常需要加入-l选项,所以Linux为ls -l命令提供了一种简写方式,即ll

        cd

 用于切换当前工作目录,即进入指定目录


            语法:

cd [dirName]

[root@localhost ~]# cd /usr/local/

[root@localhost ~]# cd sde
[root@localhost sde]# cd ..
[root@localhost ~]# cd sde/
[root@localhost sde]# 

cd -  返回上次所在的目录 

[root@localhost /]# cd -
/usr/local
[root@localhost local]# 

cd ~ 直接回到 /root目录

[root@localhost usr]# cd ~
[root@localhost ~]# 

pwd 查看当前所在目录

[root@localhost usr]# pwd
/usr

cd . 当前所在目录

[root@localhost usr]# cd .
[root@localhost usr]# 

cd .. 返回上一级目录

[root@localhost local]# cd ..
[root@localhost usr]# 

cd ../../ 连续退两级目录

[root@localhost local]# cd ../../
[root@localhost /]# 


            特殊说明:

  • ~ 表示用户的home目录
  • . 表示目前所在的目录
  • .. 表示目前目录位置的上级目录

            举例:

  • cd ..        切换到当前目录的上级目录
  • cd ~        切换到用户的home目录
  • cd /usr/local    切换到/usr/local目录
  • cd -        切换到上一次所在目录

        cat

 用于显示文件内容


            语法:

 cat [-n] fileName


            说明:

 -n :由1开始对所有输出的行数编号

            举例:

cat /etc/profile        查看/etc目录下的profile文件内容

        

[root@localhost ~]# cat 1.txt 
11111111111
2222222222
333333333
4444444444
5555555555
6666666666
7777777777
8888888888
9999999999
0000000000

[root@localhost ~]# 

显示行号:

[root@localhost ~]# cat -n 1.txt 
     1  11111111111
     2  2222222222
     3  333333333
     4  4444444444
     5  5555555555
     6  6666666666
     7  7777777777
     8  8888888888
     9  9999999999
    10  0000000000
    11  
[root@localhost ~]# 
clear:清屏:

[root@localhost ~]# clear

more

 以分页的形式显示文件内容


            语法:

more fileName


            操作说明:

  •  回车键:向下滚动一行
  • 空格键:向下滚动一屏
  • b:返回上一屏
  • q或者 Ctrl+c :退出more

[root@bogon ~]# more tlias.log 

可以看到是以分页的形式,展示的tlias.log日志。

我按下回车键,向下滚动一行。

我按下空格键,向下滚动一屏。

我按下 b 键,返回上一屏。

我按下 q 或者 ctrl + c 退出:

这个是 ctrl + c:


            举例:

more /etc/profile    以分页方式显示/etc目录下的profile文件内容

        tail

 查看文件末尾的内容


            语法:

 tail [-f] fileName


            说明:

-f :动态读取文件末尾内容并显示,通常用于日志文件的内容输出

[root@bogon ~]# tail tlias.log 

查看后几行的:

[root@bogon ~]# tail -5 tlias.log 

            举例:

  • tail /etc/profile    显示/etc目录下的profile文件末尾10行的内容
  • tail -20 /etc/profile    显示/etc目录下的profile文件末尾20行的内容
  • tail -f /sde/my.log    动态读取/sde目录下的my.log文件末尾内容并显示

        mkdir

创建目录


            语法:

  mkdir [-p] dirName


            说明:

 -p:确保目录名称存在,不存在的就创建一个。通过此选项,可以实现多层目录同时创建
          

示例1: 

[root@bogon ~]# mkdir sde1

 

示例2:

[root@bogon ~]# mkdir sde2/sde3

加上 -p

[root@bogon ~]# mkdir -p sde2/sde3

[root@bogon ~]# cd sde2/sde3

 举例:

  • mkdir sde在当前目录下,建立一个名为sde的子目录
  • mkdir -p sde/test     在工作目录下的sde目录中建立一个名为test的子目录,若itcast目录不存在,则建立一个

        rmdir

删除空目录


            语法:

  rmdir [-p] dirName


            说明:

 -p:当子目录被删除后使父目录为空目录的话,则一并删除

[root@bogon ~]# rmdir sde

加上 -p 删除:

[root@bogon ~]# rmdir -p  sde2/sde3

[root@bogon ~]# rmdir sde1*

            举例:

  • rmdir sde       删除名为sde的空目录
  • rmdir -p sde/test  删除sde目录中名为test的子目录,若test目录删除后sde目录变为空目录,则也被删除
  • rmdir sde*       删除名称以sde开始的空目录
        rm

删除文件或者目录


            语法:

 rm [-rf] name

使用 rm 删除文件夹,里面要是存在的有文件或者文件夹,就会删除失败。

[root@bogon ~]# rm sde1

使用 -r 递归删除:

[root@bogon ~]# rm -r sde1
rm:是否进入目录"sde1"? y
rm:是否删除目录 "sde1/sde22"?y
rm:是否删除目录 "sde1"?y
[root@bogon ~]# 

看效果:

 -f  不询问删除:

[root@bogon ~]# rm -rf sde2
[root@bogon ~]# 

效果: 


            说明:

 -r:将目录及目录中所有文件(目录)逐一删除,即递归删除
-f:无需确认,直接删除

            举例:

  •  rm -r itcast/    删除名为itcast的目录和目录中所有文件,删除前需确认
  • rm -rf itcast/   无需确认,直接删除名为itcast的目录和目录中所有文件
  • rm -f hello.txt  无需确认,直接删除hello.txt文件

    拷贝移动目录:

        cp

 用于复制文件或目录


            语法:

 cp [-r] source dest

 复制到另一个目录 

[root@bogon ~]# cp 1.txt  sde1/
[root@bogon ~]# cd sde1
[root@bogon sde1]# ll
总用量 4
-rw-r--r--. 1 root root 145 12月 28 15:57 1.txt
drwxr-xr-x. 2 root root   6 12月 28 15:56 sde2
[root@bogon sde1]# 

在当前目录下,改名复制。

[root@bogon sde1]# cp 1.txt ./66.txt
[root@bogon sde1]# ll
总用量 8
-rw-r--r--. 1 root root 145 12月 28 15:57 1.txt
-rw-r--r--. 1 root root 145 12月 28 15:59 66.txt
drwxr-xr-x. 2 root root   6 12月 28 15:56 sde2
[root@bogon sde1]# 

演示:cp -r  sde1/ ./daoen

[root@bogon ~]# cp -r sde1 ./daoen
[root@bogon ~]# cd daoen
[root@bogon daoen]# ll
总用量 0
drwxr-xr-x. 3 root root 45 12月 28 17:40 sde1
[root@bogon daoen]# cd sde1
[root@bogon sde1]# ll
总用量 8
-rw-r--r--. 1 root root 145 12月 28 17:40 1.txt
-rw-r--r--. 1 root root 145 12月 28 17:40 66.txt
drwxr-xr-x. 3 root root  21 12月 28 17:40 sde2
[root@bogon sde1]# cd sde2
[root@bogon sde2]# ll
总用量 0
drwxr-xr-x. 2 root root 6 12月 28 17:40 888.txt
[root@bogon sde2]# 

演示带 /* 的

[root@bogon ~]# cp -r sde1/* ./daoen
[root@bogon ~]# ll
总用量 2264
-rw-r--r--. 1 root root     145 12月 28 15:19 1.txt
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 3 root root      45 12月 28 17:48 daoen
drwxr-xr-x. 3 root root      45 12月 28 15:59 sde1
drwxr-xr-x. 3 root root      18 12月 28 15:56 sde2
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# cd daoen
[root@bogon daoen]# ll
总用量 8
-rw-r--r--. 1 root root 145 12月 28 17:48 1.txt
-rw-r--r--. 1 root root 145 12月 28 17:48 66.txt
drwxr-xr-x. 3 root root  21 12月 28 17:48 sde2
[root@bogon daoen]# 


            说明:

 -r:如果复制的是目录需要使用此选项,此时将复制该目录下所有的子目录和文件

            

举例:

  •  cp hello.txt sde/            将hello.txt复制到itcast目录中
  • cp hello.txt ./hi.txt           将hello.txt复制到当前目录,并改名为hi.txt
  • cp -r itcast/ ./sde/        将sde目录和目录下所有文件复制到sde66目录下
  • cp -r itcast/* ./sde/       将sde目录下所有文件复制到sde66目录下

        

mv

为文件或目录改名、或将文件或目录移动到其它位置


            语法:

 mv source dest

演示改名:

[root@bogon ~]# ll
总用量 2264
-rw-r--r--. 1 root root     145 12月 28 15:19 1.txt
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 3 root root      45 12月 28 15:59 sde1
drwxr-xr-x. 3 root root      18 12月 28 15:56 sde2
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# mv 1.txt 666.txt
[root@bogon ~]# ll
总用量 2264
-rw-r--r--. 1 root root     145 12月 28 15:19 666.txt
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 3 root root      45 12月 28 15:59 sde1
drwxr-xr-x. 3 root root      18 12月 28 15:56 sde2
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# 

演示移动:

[root@bogon ~]# mv 666.txt sde1/
[root@bogon ~]# ll
总用量 2260
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde1
drwxr-xr-x. 3 root root      18 12月 28 15:56 sde2
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# cd sde1
[root@bogon sde1]# ll
总用量 12
-rw-r--r--. 1 root root 145 12月 28 15:57 1.txt
-rw-r--r--. 1 root root 145 12月 28 15:19 666.txt
-rw-r--r--. 1 root root 145 12月 28 15:59 66.txt
drwxr-xr-x. 3 root root  21 12月 28 16:06 sde2
[root@bogon sde1]# 

移动到不存在的文件夹,就是改名字。

[root@bogon ~]# mv sde1 sde6
[root@bogon ~]# ll
总用量 2260
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 3 root root      18 12月 28 15:56 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# 

移动到一个已经存在的目录:

[root@bogon ~]# ll
总用量 2260
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 2 root root       6 12月 28 18:15 sde
drwxr-xr-x. 3 root root      18 12月 28 15:56 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# mv sde sde2
[root@bogon ~]# ll
总用量 2260
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 4 root root      29 12月 28 18:15 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# cd sde2
[root@bogon sde2]# ll
总用量 0
drwxr-xr-x. 2 root root 6 12月 28 18:15 sde
drwxr-xr-x. 2 root root 6 12月 28 15:56 sde3
[root@bogon sde2]# 


            举例:

  •                 mv hello.txt hi.txt        将hello.txt改名为hi.txt
  • mv hi.txt sde/        将文件hi.txt移动到sde目录中
  • mv hi.txt sde/hello.txt    将hi.txt移动到sde目录中,并改名为hello.txt
  • mv sde/ sde1/        如果sde1目录不存在,将sde目录改名为sde1
  • mv sde/ sde1/        如果sde1目录存在,将sde目录移动到sde1目录中

    打包压缩命令:
tar:

文件进行打包、解包、压缩、解压


        语法:

 tar [-zcxvf] fileName [files]

  •  包文件后缀为.tar表示只是完成了打包,并压缩
  •  包文件后缀为.tar.gz表示打包的同时还进行压缩

        说明:

  • -z:z代表的是gzip,通过gzip命令处理文件,gzip可以对文件压缩或者解压
  •  -c:c代表的是create,即创建新的包文件
  •  -x:x代表的是extract,实现从包文件中还原文件
  • -v:v代表的是verbose,显示命令的执行过程
  •  -f:f代表的是file,用于指定包文件的名称

演示打包不压缩:

[root@bogon ~]# tar -cvf sde.tar sde2
sde2/
sde2/sde3/
sde2/sde/
[root@bogon ~]# ll
总用量 2272
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 4 root root      29 12月 28 18:15 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root   10240 12月 28 18:54 sde.tar
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# 

解压:

[root@bogon ~]# ll
总用量 2272
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root   10240 12月 28 18:54 sde.tar
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# tar -xvf sde.tar
sde2/
sde2/sde3/
sde2/sde/
[root@bogon ~]# ll
总用量 2272
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
drwxr-xr-x. 4 root root      29 12月 28 18:15 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root   10240 12月 28 18:54 sde.tar
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# 

演示将一个目录中的文件,全部打包。

[root@bogon sde2]# ll
总用量 0
drwxr-xr-x. 2 root root 6 12月 28 18:15 sde
drwxr-xr-x. 2 root root 6 12月 28 15:56 sde3
[root@bogon sde2]# tar -cvf all.tar ./*
./sde/
./sde3/
[root@bogon sde2]# ll
总用量 12
-rw-r--r--. 1 root root 10240 12月 28 19:00 all.tar
drwxr-xr-x. 2 root root     6 12月 28 18:15 sde
drwxr-xr-x. 2 root root     6 12月 28 15:56 sde3
[root@bogon sde2]# 

进行解压操作:

[root@bogon sde2]# ll
总用量 12
-rw-r--r--. 1 root root 10240 12月 28 19:00 all.tar
[root@bogon sde2]# tar -xvf all.tar
./sde/
./sde3/
[root@bogon sde2]# ll
总用量 12
-rw-r--r--. 1 root root 10240 12月 28 19:00 all.tar
drwxr-xr-x. 2 root root     6 12月 28 18:15 sde
drwxr-xr-x. 2 root root     6 12月 28 15:56 sde3
[root@bogon sde2]# 

压缩并打包:

[root@bogon ~]# tar -zcvf daoen.tar.gz sde2
sde2/
sde2/all.tar
sde2/sde/
sde2/sde3/
[root@bogon ~]# ll
总用量 2264
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
-rw-r--r--. 1 root root     228 12月 28 19:04 daoen.tar.gz
drwxr-xr-x. 4 root root      44 12月 28 19:02 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# 

解压缩:

[root@bogon ~]# tar -zxvf daoen.tar.gz 
sde2/
sde2/all.tar
sde2/sde/
sde2/sde3/
[root@bogon ~]# ll
总用量 2264
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
-rw-r--r--. 1 root root     228 12月 28 19:04 daoen.tar.gz
drwxr-xr-x. 4 root root      44 12月 28 19:02 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# 

-rw-r--r--. 1 root root     228 12月 28 19:04 daoen.tar.gz
drwxr-xr-x. 4 root root      44 12月 28 19:02 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# tar -zxvf daoen.tar.gz -C /usr/local
sde2/
sde2/all.tar
sde2/sde/
sde2/sde3/
[root@bogon ~]# cd /usr/local
[root@bogon local]# ll
总用量 0
drwxr-xr-x.  2 root root  65 12月 27 17:25 appjar
drwxr-xr-x.  2 root root   6 4月  11 2018 bin
drwxr-xr-x.  2 root root   6 4月  11 2018 etc
drwxr-xr-x.  2 root root   6 4月  11 2018 games
drwxr-xr-x.  2 root root   6 4月  11 2018 include
drwxr-xr-x.  9 root root 136 12月 27 13:39 jdk-21.0.1
drwxr-xr-x.  2 root root   6 4月  11 2018 lib
drwxr-xr-x.  2 root root   6 4月  11 2018 lib64
drwxr-xr-x.  2 root root   6 4月  11 2018 libexec
drwxr-xr-x. 10 root root 141 12月 27 14:30 mysql
drwxr-xr-x. 11 root root 151 12月 27 15:58 nginx
drwxr-xr-x.  2 root root   6 4月  11 2018 sbin
drwxr-xr-x.  4 root root  44 12月 28 19:02 sde2
drwxr-xr-x.  5 root root  49 12月 14 04:28 share
drwxr-xr-x.  2 root root   6 4月  11 2018 src
[root@bogon local]# 
    文本编辑命令:
vi/vim:

 vi命令是Linux系统提供的一个文本编辑工具,可以对文件内容进行编辑,类似于Windows中的记事本

        语法:

 vi fileName(要编辑的文件名)

        说明:

  • 1、vim是从vi发展来的一个功能更加强大的文本编辑工具,在编辑文件时可以对文本内容进行着色,方便我们对文件进行编辑处理,所以实际工作中vim更加常用。
  • 2、要使用vim命令,需要我们自己完成安装。可以使用下面的命令来完成安装:

        yum install vim

      

 vim:
            作用:

对文件内容进行编辑,vim其实就是一个文本编辑器

            语法:

vim fileName

 

 三个模式介绍:

从命令行模式,到低行模式 是 按的 Shift + : 

命令行模式的快捷键:

  • gg 定位到文本内容的第一行
  • G 定位到文本内容的最后一行
  • dd 删除光标所在行的数据
  • ndd 删除当前光标所在行及之后的n行数据
  • u 撤销操作
  • i或a或o 进入插入模式

操作演示:

刚刚执行的是 vim 1.txt 然后点击了回车,先是进入到了命令行模式:

我按一下 i a o 这三个其中一个,进入插入模式:

然后我们就可以输入内容了:

进入低行模式:我按的是 Shift + :

对文件进行保存:

也可以输入 x 退出并保存:

测试:

看看新内容是否在:

插入操作的,快捷操作的演示(命令行模式):

gg

G

dd

ndd 例如:2dd(一次直接删除 2行)5dd(一次直接删除5行)

u


      低行模式的快捷操作:

                  
            

:wq 保存并退出

:q! 不保存退出

:set nu 显示行号

:set nonu 取消行号显示

:n 定位到低n行,如 : 10 就是定位到第 10 行            
                

    低行模式,快捷操作演示:

q! 

看效果:

set nu 

set nonu

: n

查找命令:

        find:

在指定目录下查找文件


            语法:

 find dirName -option fileName

[root@bogon ~]# ll
总用量 2268
-rw-r--r--. 1 root root     100 12月 28 19:51 1.txt
-rw-------. 1 root root    1257 12月 14 04:31 anaconda-ks.cfg
-rw-r--r--. 1 root root     228 12月 28 19:04 daoen.tar.gz
drwxr-xr-x. 2 root root       6 12月 28 20:11 hello.java
drwxr-xr-x. 4 root root      44 12月 28 19:02 sde2
drwxr-xr-x. 3 root root      60 12月 28 18:02 sde6
-rw-r--r--. 1 root root 2307208 12月 27 09:57 tlias.log
[root@bogon ~]# find . -name *.java
./hello.java
[root@bogon ~]# 

[root@bogon ~]# cd /
[root@bogon /]# find /root/sde2/ -name *.java
/root/sde2/1.java
/root/sde2/2.java
[root@bogon /]# 

            举例:

  • find . –name *.java        在当前目录及其子目录下查找.java结尾文件
  • find /itcast -name *.java    在/itcast目录及其子目录下查找.java结尾的文件

        grep:

从指定文件中查找指定的文本内容


            语法:

 grep word fileName

指定精准查找:

[root@bogon ~]# grep Exception tlias.log 

可以发现,找到的都标红了。

忽略大小写的查找:

查找结果:


            举例:

  • grep Hello HelloWorld.java    查找HelloWorld.java文件中出现的Hello字符串的位置
  • grep hello *.java        查找当前目录中所有.java结尾的文件中包含hello字符串的位置

                

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/275719.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Vulnhub-Al-Web-1.0 靶机复现完整过程

一、信息收集 1.主机发现 arp-scan -l2.端口扫描 nmap -sV -p- 192.168.200.16PORTSTATESERVICEVERSIONMAC Address80/TCPOpenhttpApache httpd00:0C:29:C4:1B:78 (VMware) 3.目录扫描 python dirsearch.py -u http://192.168.200.16扫描出来这两个文件,首先先…

关于SQL时间盲注(基于sleep函数)的手动测试、burpsuite爆破、sqlmap全自动化注入

SQL时间注入是一种常见的SQL注入攻击方式,攻击者通过在SQL语句中注入时间相关的代码,来获取敏感信息或者执行非法操作。其基本原理如下: 攻击者向Web应用程序中输入一段恶意代码,通过SQL语句查询数据库,并注入时间相关…

【论文阅读】Resource Allocation for Text Semantic Communications

这是一篇关于语义通信中资源分配的论文。全文共5页,篇幅较短。 目录在这里 摘要关键字引言语义通信资源分配贡献公式符号 系统模型DeepSC TransmitterTransmission ModelDeepSC Receiver 语义感知资源分配策略Semantic Spectral Efficiency (S-SE&#…

ClickHouse基础知识(二):ClickHouse 安装教程

1. 准备工作 1.1 确定防火墙处于关闭状态 1.2 CentOS 取消打开文件数限制 (1)在 hadoop101 的 /etc/security/limits.conf 文件的末尾加入以下内容 sudo vim /etc/security/limits.conf(2)在 hadoop101 的/etc/security/limits.…

主编夜话,2023 技术圈儿大事件盘点丨 RTE 开发者日报 Vol.115

开发者朋友们大家好: 这里是「 RTE 开发者日报 」,每天和大家一起看新闻、聊八卦。我们的社区编辑团队会整理分享 RTE (Real Time Engagement) 领域内「有话题的 新闻 」、「有态度的 观点 」、「有意思的 数据 」、「有思考的 文…

netty trojan

参考代码:https://github.com/kdyzm/trojan-client-netty 参考博客: github代码作者的博客:https://blog.kdyzm.cn/post/71 trojan-go介绍:https://p4gefau1t.github.io/trojan-go/developer/trojan/ trojan协议介绍:h…

Python 进阶(十八):配置文件(configparser 模块)

大家好,我是水滴~~ configparser模块是Python标准库中的一个模块,用于解析配置文件。它提供了一种简单而灵活的方式来读取、修改和写入INI格式的配置文件。本文将介绍该模块是如何操作配置文件的。 文章中包含大量的示例代码,希望能够帮助新…

Google Ad帐号被封?这几个关键点看好

海外广告投放工作中,账号是非常重要的环节。与在Facebook上运行广告相比,运行Google Ads在代理选择方面通常没有那么严格,因为 Google 对 IP 使用并不那么严格。但是,这并不意味着您可以不加考虑地使用任何代理IP。在本文中&#…

vue3-富文本编辑器(vue-quill)

官网&#xff1a;VueQuill | Rich Text Editor Component for Vue 3 安装 pnpm add vueup/vue-quilllatest 使用 局部使用 先导包 import { QuillEditor } from vueup/vue-quill import vueup/vue-quill/dist/vue-quill.snow.css; 再使用 <QuillEditor theme"snow…

Arduino中手写脉冲控制步进电机-2

目录 1、前言 2、时间-位移关系计算 3、Matlab计算时间和位置数据 (1)Matlab程序 &#xff08;2&#xff09;Arduino程序 4、Matlab生成Arduino电机正反转程序语句 &#xff08;1&#xff09;Arduino程序 &#xff08;2&#xff09;Matlab 命令行方式生成Arduino步进电…

21.仿简道云公式函数实战-数学函数-COS

1. COS函数 COS 函数可用于计算角度的余弦值&#xff0c;返回 -1 到 1 之间的数值。 2. 函数用法 COS(弧度) 3. 函数示例 如计算 COS(60) 的值&#xff0c;可设置公式为COS(RADIANS(60))&#xff0c;返回 0.5。 4. 代码实战 首先我们在function包下创建math包&#xff0…

【C++】开源:cpp-httplib HTTP协议库配置与使用

&#x1f60f;★,:.☆(&#xffe3;▽&#xffe3;)/$:.★ &#x1f60f; 这篇文章主要介绍cpp-httplib HTTP协议库配置与使用。 无专精则不能成&#xff0c;无涉猎则不能通。——梁启超 欢迎来到我的博客&#xff0c;一起学习&#xff0c;共同进步。 喜欢的朋友可以关注一下&a…

Python入门学习篇(十一)——函数注释函数嵌套全局变量与局部变量

1 函数注释 1.1 使用说明 第一步 在函数体里面输入三个""" 第二步 回车1.2 示例代码 def quotient(divisor,dividend):""":param divisor: 除数:param dividend: 被除数:return: 商"""return divisor/dividendnum1int(input(&…

10. Opencv检测并截取图中二维码

1. 说明 在二维码扫描功能开发中,使用相机扫描图片时,往往图片中的信息比较多样,可能会造成二维码检测失败的问题。一种提高检测精度的方式就是把二维码在图片中单独抠出来,去除其它冗余信息,然后再去识别这张提取出来的二维码。本篇博客记录采用的一种实现二维码位置检测…

律师卷宗档案保存期限多久?律师档案卷宗如何整理?

律师卷宗档案的保存期限可以根据不同法律和法规进行调整&#xff0c;因此可能会有所不同。一般来说&#xff0c;律师卷宗档案的保存期限通常为10年以上。然而&#xff0c;具体的保存期限还会受到当地司法体系和律师协会规定的影响。建议您咨询所在地的律师协会或相关法律机构&a…

AGV智能搬运机器人-替代人工工位让物流行业降本增效

在当今快速发展的世界中&#xff0c;物流业面临着巨大的挑战&#xff0c;包括提高效率、降低成本和优化工作流程。为了应对这些挑战&#xff0c;一种新型的自动化设备——智能搬运机器人正在崭露头角。本文将通过一个具体的案例来展示富唯智能转运机器人在实际应用中的价值。 案…

【2023】通过docker安装hadoop以及常见报错

&#x1f4bb;目录 1、准备2、安装镜像2.1、创建centos-ssh的镜像2.2、创建hadoop的镜像 3、配置ssh网络3.1、搭建同一网段的网络3.2、配置host实现互相之间可以免密登陆3.3、查看是否成功 4、安装配置Hadoop4.1、添加存储文件夹4.2、添加指定配置4.3、同步数据 5、测试启动5.1…

openGauss学习笔记-175 openGauss 数据库运维-备份与恢复-导入数据-管理并发写入操作示例

文章目录 openGauss学习笔记-175 openGauss 数据库运维-备份与恢复-导入数据-管理并发写入操作示例175.1 相同表的INSERT和DELETE并发175.2 相同表的并发INSERT175.3 相同表的并发UPDATE175.4 数据导入和查询的并发 openGauss学习笔记-175 openGauss 数据库运维-备份与恢复-导入…

【新版Hi3536AV100性能果真强悍】

Hi3536AV100是针对多路高清/超高清&#xff08;1080p/4M/5M/4K&#xff09;智能NVR产品应用开发的新一代专业高端SoC芯片。 Hi3536AV100集成了ARM Cortex-A55八核处理器和性能强大的神经网络处理器&#xff0c;支持多种智能算法应用。 Hi3536AV100支持32路1080p多协议解码及4路…

js中深拷贝与浅拷贝的区别?如何实现一个深拷贝?(收藏好,用时好找)

文章目录 一、数据类型存储二、浅拷贝Object.assignslice()concat()拓展运算符 三、深拷贝_.cloneDeep()jQuery.extend()JSON.stringify()循环递归 四、区别小结 一、数据类型存储 前面文章我们讲到&#xff0c;JavaScript中存在两大数据类型&#xff1a; 基本类型引用类型 …
最新文章