Sponsored Content
Top Forums Shell Programming and Scripting How can we change the permissions of a file in a directory Post 302396188 by linuxpenguin on Thursday 18th of February 2010 02:11:39 AM
Old 02-18-2010
If your file list is file1,file2, file3 and the directory name is 'directory', then

Code:
for i in file1 file2 file3
do
  chmod 755 directory/$i
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

checking file's permissions and change them

Hi all, I am very new to UNIX and Shell scripting, I need to run a script to check for file's and directoires permissions and change the permissions if necessary. I appreciate your help.. Thanks (7 Replies)
Discussion started by: K-ONE
7 Replies

2. Solaris

File Permissions change date

Hi, I was wondering if there is any way to find out when the file/directory's permissions were changed. Typically, when using 'chmod' to change a file/directory's permissions, the modification date does not change. Any help would be greatly appreciated. Thanks. (4 Replies)
Discussion started by: kpatel
4 Replies

3. UNIX for Dummies Questions & Answers

how to change permissions in a certain directory?

Hi , I have a situation where plenty of users log in to the same directory and put in files. When they put in the files, I need those files to become group writable (chmod g+w) automatically. I have no control over the users' profiles. Is there a way to do it? (1 Reply)
Discussion started by: praveen_indramo
1 Replies

4. Shell Programming and Scripting

We need to change the file permissions and ownerships?

I am running a linux centos server; our php script generates plenty of files in a directory, anything up to 1000 (though too often more).The files in these directories have permissions and ownerships which i need to change. I have used shell comment for changing the file permission which is... (1 Reply)
Discussion started by: nilson
1 Replies

5. UNIX for Dummies Questions & Answers

unzip and change file permissions

Hi, Is there any way to unzip a zip file and change file permissions to 777 while extracting the files. Does the file permissions on the zip file has to do anything with it(like zip read permissions only result in read uncompressed files etc.,)? Thanks, jp (2 Replies)
Discussion started by: jpk
2 Replies

6. UNIX for Advanced & Expert Users

script to recursively change permissions on file and dirs differently?

Hi there, I need to change all files/dirs 1. all files with 744 2. all dirs with 755 is there a script for that ? thanks, thegunman (13 Replies)
Discussion started by: TheGunMan
13 Replies

7. UNIX for Dummies Questions & Answers

I am not able change the file permissions

while trying to view the access permissions to file by "ls -lrt" command it is opening some files int the dir after that segmentation fault ie core is generarting the dir.will anybody please what is the problem. (1 Reply)
Discussion started by: rajkumar_g
1 Replies

8. Shell Programming and Scripting

ksh; Change file permissions, update file, change permissions back?

Hi, I am creating a ksh script to search for a string of text inside files within a directory tree. Some of these file are going to be read/execute only. I know to use chmod to change the permissions of the file, but I want to preserve the original permissions after writing to the file. How can I... (3 Replies)
Discussion started by: right_coaster
3 Replies

9. UNIX for Beginners Questions & Answers

Override a file in directory with no permissions

Hi, I am performing unit testing in an unix environment. i have read access to all the files in this environment, but i can't copy any files from my home directory to test environment. Is there any way i can override files in testing environment. What is the command to override a file in... (1 Reply)
Discussion started by: surendra.88
1 Replies

10. UNIX for Beginners Questions & Answers

Sftp change file permissions

Hi All, Apologies if this question has been asked before. I havent been able to resolve an issue and would like some help. I am getting files pushed to me via sftp. The files once pushed to my server in folder ABC have -rw------- but I need these files to have the following -rw-rw---- to be... (1 Reply)
Discussion started by: israr75
1 Replies
DH_INSTALLDEB(1)						     Debhelper							  DH_INSTALLDEB(1)

NAME
dh_installdeb - install files into the DEBIAN directory SYNOPSIS
dh_installdeb [debhelperoptions] DESCRIPTION
dh_installdeb is a debhelper program that is responsible for installing files into the DEBIAN directories in package build directories with the correct permissions. FILES
package.postinst package.preinst package.postrm package.prerm These maintainer scripts are installed into the DEBIAN directory. Inside the scripts, the token #DEBHELPER# is replaced with shell script snippets generated by other debhelper commands. package.triggers package.shlibs These control files are installed into the DEBIAN directory. package.conffiles This control file will be installed into the DEBIAN directory. In v3 compatibility mode and higher, all files in the etc/ directory in a package will automatically be flagged as conffiles by this program, so there is no need to list them manually here. package.maintscript Lines in this file correspond to dpkg-maintscript-helper(1) commands and parameters. Any shell metacharacters will be escaped, so arbitrary shell code cannot be inserted here. For example, a line such as "mv_conffile /etc/oldconffile /etc/newconffile" will insert maintainer script snippets into all maintainer scripts sufficient to move that conffile. A versioned Pre-Dependency on dpkg is needed to use dpkg-maintscript-helper(1). An appropriate Pre-Dependency is set in ${misc:Pre-Depends} ; you should make sure to put that token into an appropriate place in your debian/control file. SEE ALSO
debhelper(7) This program is a part of debhelper. AUTHOR
Joey Hess <joeyh@debian.org> 8.9.0ubuntu2.1 2012-06-12 DH_INSTALLDEB(1)
All times are GMT -4. The time now is 08:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy