0% found this document useful (0 votes)
3 views1 page

File Permission Display Script

The document outlines a script that displays the permissions of a specified file. It checks if the file exists and, if so, uses the 'ls' command to show the permissions. If the file does not exist, it notifies the user accordingly.

Uploaded by

for11trade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

File Permission Display Script

The document outlines a script that displays the permissions of a specified file. It checks if the file exists and, if so, uses the 'ls' command to show the permissions. If the file does not exist, it notifies the user accordingly.

Uploaded by

for11trade
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Script No .

Definition:
Write a script to display the permissions of the particular file.
Script:
clear
echo enter the name of the file
read fname
if [ -e $fname ]
then
echo The permission on file $fname
ls -all $fname | cut -c 1-10
else
echo $fname does not exist
fi

OR
echo "Enter the filename"
read fn
ls -l $fn | cut -c 2-10

You might also like