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

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.
主站蜘蛛池模板: 庆云县| 玛纳斯县| 都匀市| 三门峡市| 宝兴县| 攀枝花市| 上蔡县| 金溪县| 湟中县| 永顺县| 磐石市| 平山县| 潢川县| 井陉县| 鸡西市| 德钦县| 达日县| 清水河县| 井研县| 海晏县| 彰化县| 泊头市| 兴山县| 青龙| 乌苏市| 克什克腾旗| 象山县| 当阳市| 长乐市| 德昌县| 临颍县| 双峰县| 西畴县| 宁明县| 莱芜市| 腾冲县| 临洮县| 屯门区| 宜城市| 乾安县| 诏安县|