ln -s

[vagrant@localhost tests]$ ls
index.php  test
[vagrant@localhost tests]$ cat index.php
<?php

?>
<!DOCTYPE html>
<html>
<head>
        <meta charset="UTF-8">
        <script src="tinymce/js/tinymce/tinymce.min.js"></script>
        <script>
                tinymce.init({
                        selector:"#tiny",
                        // menubar: false,
                        plugins: "textcolor image link",
                        toolber: [
                                "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",
                                "fontsizeselect forecolor image link"
                        ],
                        statusbar: false,
                });
        </script>
</head>
<body>
        <textarea id="tiny" name=""></textarea>
</body>
</html>

[vagrant@localhost tests]$ ln -s index.php copy
[vagrant@localhost tests]$ ls
copy  index.php  test
[vagrant@localhost tests]$ cat copy
<?php

?>
<!DOCTYPE html>
<html>
<head>
        <meta charset="UTF-8">
        <script src="tinymce/js/tinymce/tinymce.min.js"></script>
        <script>
                tinymce.init({
                        selector:"#tiny",
                        // menubar: false,
                        plugins: "textcolor image link",
                        toolber: [
                                "undo redo | formatselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent",
                                "fontsizeselect forecolor image link"
                        ],
                        statusbar: false,
                });
        </script>
</head>
<body>
        <textarea id="tiny" name=""></textarea>
</body>
</html>

すげーーーーーーー linux

rm -rf ${dir_name | file name}

-r
This is used to delete directories. Even if there is a directory in the directory, all deletion will be done.

-f
It is ok to delete the file on linux without confirmation. For example, when deleting a large number of files, it is commonly used option when it is troublesome to check each time. Also, no warning will be issued even if the file does not exist.

[vagrant@localhost tests]$ ls
dmm index.php test
[vagrant@localhost tests]$ rm -rf dmm
[vagrant@localhost tests]$ ls
index.php test

chown -R ${dir_name}

Check the permission with the “ll” command.

[vagrant@localhost tests]$ ll
合計 12
drwxr-xr-x 2 vagrant vagrant 4096 2月 17 14:36 2019 dmm
-rw-rw-r– 1 vagrant vagrant 551 2月 10 11:26 2019 index.php
drwxr-xr-x 4 vagrant vagrant 4096 2月 15 08:53 2019 test
[vagrant@localhost tests]$ cd dmm
[vagrant@localhost dmm]$ ll
合計 0
-rw-rw-r– 1 vagrant vagrant 0 2月 17 14:36 2019 dmm.txt

drwxr-xr-x is 755
-rw-rw-r– is 644

[vagrant@localhost tests]$ chmod -R 764 dmm
[vagrant@localhost tests]$ ll
合計 12
drwxrw-r– 2 vagrant vagrant 4096 2月 17 14:36 2019 dmm
-rw-rw-r– 1 vagrant vagrant 551 2月 10 11:26 2019 index.php
drwxr-xr-x 4 vagrant vagrant 4096 2月 15 08:53 2019 test
[vagrant@localhost tests]$ cd dmm
[vagrant@localhost dmm]$ ll
合計 0
-rwxrw-r– 1 vagrant vagrant 0 2月 17 14:36 2019 dmm.txt

tail -f ${file_name}

originally tail is a command to display the last 10 lines(default) of the file.
As a command to be paired there is head, display the top 10 lines of the file. To change the number of lines to display, specify the number of lines with the -n option for both commands.

First i will make a sample file of 26 lines.

[vagrant@localhost tests]$ tail test.txt
 -数字表記-
 0     ---
 1     --x
 2     -w-
 3     -wx
 4     r--
 5     r-x
 6     rw-
 7     rwx
※2進数に直した3bitに当てはめる。

[vagrant@localhost tests]$ tail -n 3 test.txt
 6     rw-
 7     rwx
 ※2進数に直した3bitに当てはめる。

tail -n
Even if it is displayed to the end of the file, it does not end and when the end of the file is updated, the addition is displayed continuously.

add new line

command line automatically updated.

こりゃ驚いた

cp -r ${dir_name}

The cp command on Unix/linux is a command to copy files and directories. Since the cp command has existed for a long time(it appeared in the first Unix V1), it can be used with any UNIX/Linux OS.

option
-R : copy directory recursively

[vagrant@localhost tests]$ ls
index.php test
[vagrant@localhost tests]$ cp -r test test2
[vagrant@localhost tests]$ ls
index.php test test2

すげーーーーーー

Linux $ source

“source” is a command to execute the command described in the file.

list.txt

echo Hello

[vagrant@localhost tests]$ ls
index.php list.txt test.php tinymce
[vagrant@localhost tests]$ source list.txt
Hello

wow.

isExist APP ~ "pgrep httpd"
if [[ -n $isExist App ]]i then
	 service httpd stop
fi

あああああああああ、シェルスクリプト勉強しなきゃ。。。駄目だ、時間がかかりすぎる。

tail -n 100 /var/log/httpd/error_log | egrep -i “WARN|ERR|FAIL|CRIT”

Can use the tail command to export the file specified in the File parameter from the specified position to standard output.

[vagrant@localhost ~]$ tail -n 100 /var/log/httpd/error_log
[Sun Feb 10 09:48:03 2019] [notice] Digest: generating secret for digest authentication …
[Sun Feb 10 09:48:03 2019] [notice] Digest: done
[Sun Feb 10 09:48:03 2019] [notice] Apache/2.2.15 (Unix) DAV/2 configured — resuming normal operations

install OpenVAS for centos

After installing the repository of OpenVAS, install OpenVAS with the following command.

yum -y install openvas

[vagrant@localhost app]$ sudo yum -y install openvas
読み込んだプラグイン:fastestmirror
インストール処理の設定をしています
Determining fastest mirrors
epel/metalink | 6.7 kB 00:00
* base: ftp.riken.jp
* epel: mirror.premi.st
* extras: ftp.riken.jp
* remi-safe: ftp.riken.jp
* updates: ftp.riken.jp
base | 3.7 kB 00:00
epel | 4.7 kB 00:00
epel/primary_db | 6.0 MB 00:11
extras | 3.4 kB 00:00
jenkins | 2.9 kB 00:00
jenkins/primary_db | 126 kB 00:01
mariadb | 2.9 kB 00:00
mysql-connectors-community | 2.5 kB 00:00
mysql-connectors-community/primary_db | 33 kB 00:00
mysql-tools-community | 2.5 kB 00:00
mysql-tools-community/primary_db | 48 kB 00:00
mysql56-community | 2.5 kB 00:00
nginx | 2.9 kB 00:00
nodesource | 2.5 kB 00:00
remi-safe | 3.0 kB 00:00
remi-safe/primary_db | 1.2 MB 00:02
updates | 3.4 kB 00:00
updates/primary_db | 3.0 MB 00:05
パッケージ openvas は利用できません。
エラー: 何もしません

なにいいいいいいいいいい???????
ドキュメントをみると、対象のIPを指定するとスキャンしてくれて、脆弱性レポートを作ってくれるらしい。なるほど。

Linux “sed” command

Replace the character string / output the replaced line

[vagrant@localhost tests]$ ls
baio.txt

baio.txt

2019 年 MM 月 DD 日に発表いたしました、再生細胞薬「SBXXX」の慢性期脳梗塞を対象にした
米国でのフェーズ N 臨床試験の解析結果について、患者さんからの声をたくさんお寄せ
いただいております。改めて私より、今後についてお伝えさせていただきたいと思います。

To replace the character string, use “s” command and specify “s/beforeReplacment/afterReplacement”

[vagrant@localhost tests]$ cat baio.txt
2019 年 MM 月 DD 日に発表いたしました、再生細胞薬「SBXXX」の慢性期脳梗塞を対象にした
米国でのフェーズ N 臨床試験の解析結果について、患者さんからの声をたくさんお寄せ
いただいております。改めて私より、今後についてお伝えさせていただきたいと思います。

[vagrant@localhost tests]$ cat baio.txt | sed s/患者/株主/
2019 年 MM 月 DD 日に発表いたしました、再生細胞薬「SBXXX」の慢性期脳梗塞を対象にした
米国でのフェーズ N 臨床試験の解析結果について、株主さんからの声をたくさんお寄せ
いただいております。改めて私より、今後についてお伝えさせていただきたいと思います。

/usr/local/bin

Although the way of thinking differs depending on the operating system, in general /usr/local and below, it is used to keep compiled oneself.

/usr/bin and /bin put the standard command of the system, but place other thing in /usr/local/bin.

[vagrant@localhost app]$ echo $PATH
/home/vagrant/.pyenv/plugins/pyenv-virtualenv/shims:/home/vagrant/.pyenv/shims:/home/vagrant/.pyenv/bin:/home/vagrant/.rbenv/shims:/home/vagrant/.rbenv/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/vagrant/bin

u, that’s strange..