Ubuntu – Chmod is not working as expected

chmodpermissions

When i am about to change my file permission like this

 $ sudo chmod a+x *.* 

This error appear

 chmod: cannot access ‘*.*’: No such file or directory

And when i want to change the permission of every single file in a directory with

 $ sudo chmod a+x directory/* 

The same error appear

 chmod: cannot access ‘directory/*’: No such file or directory

When i try the same command in other directory it works but under this directory /var/www/html it does not work but even when i change the permission file by file to a+x when i run

 ls

A permission error appear

 ls: cannot open directory .: Permission denied

Best Answer

The file extension in Linux is nothing special, it is just a part of the file name. The file globbing of the the shell uses * for all characters so you can just use chmod a+x * instead of .

Related Question