From the course: Learning Linux Command Line
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Modify file permissions - Linux Tutorial
From the course: Learning Linux Command Line
Modify file permissions
- [Instructor] Let's practice changing permissions on files. I have a small bash script here called test.sh, which is a simple program that just prints out a line of text when we run it. To run this, I'll need to use the Bash interpreter, so I'll write bash as my command and provide that script as an argument, and there's the output, but I could also change the permission mode on this program so that I can run it or execute it directly as if it were a command. I'll take a look at the permission mode string for this file with ls -l test.sh. And here I can see that while my user and the group can both read and write the file and others can read it, there's no X's in the mode string, meaning that nobody has execute permission on the file. Let's change that using chmod and +x. This adds the execute permission for everybody, the user, the group, and other. I'll run that and then I'll recall my command to take a look at the mode string for the file. Here, I can see the difference. My user…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
The Linux file system5m 48s
-
(Locked)
Understanding file paths4m 47s
-
(Locked)
Navigating the file system5m 42s
-
(Locked)
Finding directory and file information4m 46s
-
(Locked)
Create and remove directories3m 47s
-
(Locked)
Copy, move, and delete files and directories8m 50s
-
(Locked)
Find files from the command line2m 29s
-
(Locked)
Understand user roles and sudo6m 7s
-
(Locked)
Understand file permissions6m 16s
-
(Locked)
Modify file permissions8m 9s
-
(Locked)
Create hard and symbolic links3m 53s
-
(Locked)
Challenge: Fix broken syntax20s
-
(Locked)
Solution: Fix broken syntax1m 7s
-
(Locked)
Challenge: Practice working with files29s
-
(Locked)
Solution: Practice working with files24s
-
(Locked)
-
-
-