-
Shell 的 echo 指令与 PHP 的 echo 指令类似,用于字符串的输出。命令格式:echo string。在 shell 脚本中,如果需要输出
或 -t 等特殊字符,请使用 echo -e
-
假设我们要在 linux 服务器上执行两条需要 sudo 权限的命令,比如 "docker ps -a" 和 "docker images"
不使用 sudo 无法执行 docker ps -a。$ docker ps -a
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/json?all=1: dial unix /var/run/docker.sock: connect: permission denied
-
wget 是一个从网络上自动下载文件的自由工具,支持通过 HTTP、HTTPS、FTP 三个最常见的 TCP/IP 协议下载,并可以使用 HTTP 代理。"wget" 这个名称来源于 “World Wide Web” 与 “get” 的结合。
-
linux find 命令详解,inux find -name模糊查找文件的方法。Linux find 命令用来查找指定目录下的文件。如果使用 find 命令时,不指定查找目录,则 find 命令将在当前目录下查找子目录与文件。
-
rsync 是一个常用的 Linux 应用程序,用于文件同步。优点:增量同步文件。它可以在本地计算机与远程计算机之间,或者两个本地目录之间同步文件。也可以当作文件复制工具,替代 cp 命令。
-
linux tar忽略文件,tar忽略文件夹,tar排除目录
-
有时我们会在 shell 脚本中看到 "{} ;",那么 "{} ;" 究竟是什么意思呢?别急,耐心往下看。find ~/logs/fe -mtime 7 -exec rm {} ;简单解释一下上面的 shell 脚本:1、"find ~/logs/fe -mtime 7" 的意思是:在 ~/logs/fe 目录下查找最后修改日期超过 7 天的(日志)文件;2、-exec 后面是要对查找到的文件执行的命令(即 rm 删除操作);3、"{}" 是占位符,"find ~/logs/fe -mtime 7" 查找到的文件会被填补到这个位置;4、";" 用于标识命令的结束,为什么要这么做呢?因为 rm 命令可以接收多个参数,不知道要在哪里结束,所以 ";" 用于起到标识(-exec后面的)命令结束的作用。你可能要问,为什么要对";"进行转义呢?原因是";"在 shell 脚本已有使用,即用于语句的分隔,所以出现了";"的写法
-
vi 是 Unix 和 Linux 系统下标准的编辑器。vim 是 vi 的升级版本,兼容 vi 所有指令,支持语法高亮和多级撤销等新特性vi/vim 分为三种模式,分别是命令模式(Command mode),输入模式(Insert mode)和底线命令模式(Last line mode)
-
本文的目标是帮你轻松读懂下面这条 shell 语句,并能够熟练 find 命令查找文件。find /home/tides/logs -mtime +7 -exec rm {} ;首先,你需要先了解一下 find 的基本语法:find /home/tides/logs -mtime +7 -exec rm {} ;
-
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
cc:1c:ba:9a:95:c7:35:51:79:c6:26:29:5e:19:64:50.
Please contact your system administrator.
Add correct host key in /home/tides/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/tides/.ssh/known_hosts:9
remove with: ssh-keygen -f "/home/tides/.ssh/known_hosts" -R saas-dev
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.