swapファイルの作り方
検証でswapファイルを用意する必要があった。
以下の手順でswapファイル(.swp)を生成できる。
1.一般ユーザーでログイン
2.viコマンドでファイルを開く
3.Ctrl + Zを押す
4.viコマンドでファイルを開く
例
[swap@centos ~]$ touch testfile
[swap@centos ~]$ vi testfile
[1]+ 停止 vim testfile
[swap@centos ~]$ vi testfile
[swap@centos ~]$ ls -al
-rw-r--r-- 1 swap swap 4096 12月 15 02:04 2018 .testfile.swp
-rw-rw-r-- 1 swap swap 0 12月 15 02:04 2018 testfile
[swap@centos ~]$
#################
###以下、参考情報
#################
[swap@centos ~]$ cat /etc/redhat-release
CentOS release 6.9 (Final)
[swap@centos ~]$ whoami
swap
[swap@centos ~]$ cat /etc/passwd |grep swap
swap:x:502:502::/home/swap:/bin/bash