Learn to change file and directory permissions at the Linux command line.
Linux chmod command summary with examples (4:10)
Videos can also be accessed from the YouTube Playlist.
Our seventy-fifth word, or command to memorize is
chmod from our category
chmod allows you to change file
Recall from the file listing
command, we've seen permissions, and in this video on file mode, as in
chmod we'll kick off a
set of videos on the topic covering users, then groups and then the
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s).
chmod command has
only 9 options, the first argument is the mode to
change, followed by the file or list of files.
Like most commands, help is available with double-dash
-r option applies changes of
So why is
chmod an important command?
Well, in Linux, unlike other operations systems, file permissions are
given more importance, so you'll need to grasp how to make these
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Let's start with a directory listing.
Thanks for sticking with it, if have been here from the start, we have been busy.
I've used a convention like
to keep the display here simple.
video7* just to show a set,
instead of all the files we've been working on.
So, let's dig a bit deeper here and at the left, you can see 10 dashes
or letters, the first indicates file type, dash
- is for a regular file,
d for directory,
l for link. Then the permissions in
the next set of three for the owner, followed by three for the group,
and three for the rest of the world.
Next, let's create a new empty file using
touch video75.txt and
ls -og video75.txt.
For me the mode is read and write
for the group and world it's read only
r-- so I'll
chmod the group
g and add
+w for write.
And last, verify with an
lg -og video75.txt.
The group can now write.
Okay now you know how to use
And you know the syntax for commands, options and arguments.
One last tip about the
command. So we're just kicking off here (with file permissions) and
I kept it very simple. We have a few more videos (tutorials) to come on
the topic of users and I put a table in the Description (also see the
Linux Cheat Sheet) on the modes
and two others called octals and binaries, which we'll cover in the next
few videos because this is all so very important.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
Be on the lookout for new videos, subscribe to be informed by YouTube.
rsynccommand, hit Back.
chown, click Next.