How To Change File or Directory Permissions via the Linux Terminal

A stylized image of a key on a keyboard
(Image credit: Pexels)

If you’ve ever tried to run a script from the command line in Linux and gotten an error message saying that it’s not executable or attempted to enter a directory only to be blocked by the system, you probably don’t have permissions to do those things. Fortunately, if you have the proper rights or the ability to act as a super user (accessible by using sudo), you can change the permissions on files and directories.

In this how-to we’ll look at the chmod command, a powerful command that can change file and directory permissions for the owner, user group members and others. In a section below, we’ll also explain how to tell what group your user is in and exactly what Linux means by “others.”

Latest Videos FromTom's Hardware
TOPICS
Jo Hinchliffe
Contributing Writer

Jo Hinchliffe is a UK-based freelance writer for Tom's Hardware US. His writing is focused on tutorials for the Linux command line. From PCBs to rowing boats to rockets, Jo tries wherever possible to integrate open source hardware and software into his projects. As such he is a keen Linux user, has authored a book on FreeCAD the open source 3D modeling software, and has published designs and tutorials across a wide range of makes.

With contributions from