官术网_书友最值得收藏!

Getting ready

Let's get ready for the exercise by creating a few text files and directories, and adding some content:

$ cd ~/
$ mkdir -p fileops
$ touch fileops/empty.txt
$ echo "abcd1234!!" > fileops/string.txt
$ echo "yieldswordinthestone" > fileops/swordinthestone.txt
$ touch fileops/read.txt fileops/write.txt fileops/exec.txt fileops/all.txt
$ chmod 111 fileops/exec.txt; chmod 222 fileops/write.txt; chmod 444 fileops/read.txt; fileops/all.txt;chmod 777 fileops/all.txt
$ sudo useradd bob
$ echo "s the name" > fileops/bobs.txt
$ sudo chown bob.bob fileops/bobs.txt

This recipe is about performing some simple file tests and to combine some of the other knowledge from earlier recipes on conditional logic, but with a twist—using user input from the CLI and file permissions.

Notice the commands  chmod, useradd, and chmod. Chmod is the command you may use to change the permissions of files for execution and more.
主站蜘蛛池模板: 诏安县| 讷河市| 大渡口区| 饶阳县| 名山县| 余姚市| 新田县| 柯坪县| 隆化县| 英超| 大连市| 满洲里市| 枞阳县| 尤溪县| 永登县| 嵩明县| 五台县| 呼玛县| 栾川县| 隆子县| 循化| 拜城县| 平利县| 洛浦县| 靖安县| 进贤县| 鹿邑县| 五大连池市| 靖江市| 汶上县| 永春县| 汪清县| 咸丰县| 永春县| 宿州市| 林口县| 株洲市| 合水县| 甘南县| 长寿区| 高邑县|