Book-bot.com - read famous books online for free

Debian GNU/Linux : Guide to Installation and Usage by John Goerzen;Ossama Othman
page 112 of 298 (37%)

This section goes through a short example session to demonstrate how
permissions are used. To change permissions, we'll use the chmod command.

cd; touch myfile
There are a couple of new tricks here. First, you can use ; to put two
commands on one line. You can type the above as:

$ cd

$ touch myfile

or as:

$ cd; touch myfile
Either way the same thing will end up happening.

Recall that cd by itself returns you to your home directory. touch is
normally used to change the modification time of the file to the current
time. But it has another interesting feature: If the file doesn't exist,
touch creates the file. So you're using it to create a file to practice
with. Use ls -l to confirm that the file has been created and notice the
permissions mode:

$ ls -l

-rw-r-r- 1 user user 0 Nov 18 22:04 myfile

Obviously the time and user/group names will be different when you try it.
The size of the file is 0, because touch creates an empty file. -rw-r-r-
DigitalOcean Referral Badge