Unix Shell Scripts   «Prev  Next»

Setting File Permissions - Exercise

Setting Shell Script file Permissions

Objective: Use the chmod command to set file permissions on a script file.

Exercise scoring

This exercise is worth 2 points.

Background/overview

You should have an account set up on the DispersedNet Labs server or on a UNIX server at your site. Log in to this account so you see a UNIX command line prompt. You will be working with the filename “welcome” that you created in the last exercise.

Instructions

  1. Log in to your UNIX account so you are working at a command prompt.
  2. Use the ls command to view the current file permissions of your script file by entering the following line:

% ls –l welcome

  1. Use the chmod command to add the Execute permission to your script file by entering the following line:


% chmod u+x welcome

  1. Use the ls command again to check that the Execute permission has been added by entering the following line:

% ls –l welcome