Skip to content
Advertisement

How to create an archive and chmod it

I should create a file inside this file an archive. When I create it, I should use chmod so that the archive should have 757 rights.

I did this but I failed, is this right or wrong? :

$ mkdir file1
$ cd file1
# here i should create an archive but how i dont know
$ chmod 757 archivename

Advertisement

Answer

Use touch command first:

bash-4.3$ mkdir a                                                                                                                                                                                                            
bash-4.3$ cd a                                                                                                                                                                                                               
bash-4.3$ pwd                                                                                                                                                                                                                
/home/cg/root/a                                                                                                                                                                                                              
bash-4.3$ touch a.txt                                                                                                                                                                                                        
bash-4.3$ chmod 757 a.txt                                                                                                                                                                                                    
bash-4.3$ ls -lrt                                                                                                                                                                                                            
total 0                                                                                                                                                                                                                      
-rwxr-xrwx 1 18207 18207 0 May  4 11:29 a.txt
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement