Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

how to change permissions on a file in linux

sudo chmod -R ugo+rwx /file/path
Comment

linux change permission

permission = read(4) + write(2) + execute(1)

===== CHMOD ===== ( change permission for file )
chmod [permissions] file
(u)ser, (g)roup, (o)ther, (a)ll
(r)ead, (w)rite, (e)xecute
(+) add permission, (-) remove permission, (=) set permission

#Examples:
chmod o+rwx file # add rwx for other
chmod o=rw file  # set rw for other
chmod og-x file  # remove x from other and group
chmod a+r file   # everyone can read

# Numeric
chmod 724 file # owner=everything, group=writing, other=reading
                                            
first number is for owner of file, 
second for group of owner,
third for everyone

===== OTHER =====
ls -l [path]

---------- # file
d--------- # directory

-rwx------ # owner
----rwx--- # group
-------rwx # other
Comment

change file permission linux

chmod +x <fileName> # add execute permission to that file (.x.x.x) 
chmod +r <fileName> # add read permission to a file
chmod +w <fileName> # add write permission to the file

chmod u+x <fileName> #add execute permission to owner of the file

chmod 400 <fileName> # set file only read permission to owner 
#chmod-calculator.com
Comment

PREVIOUS NEXT
Code Example
Shell :: run dotnet core app 
Shell :: git display current head 
Shell :: infinite loop bash 
Shell :: powershell script path 
Shell :: for loop change increment matlab 
Shell :: bash print odd or even lines 
Shell :: docker run in the background 
Shell :: git push existing repository 
Shell :: docker build name 
Shell :: install discord bot on server 
Shell :: add a cookie to curl 
Shell :: xamp start ubuntu 
Shell :: git difftool meld 
Shell :: install ruby 
Shell :: docker prune -a 
Shell :: kill port mac terminal 
Shell :: powershell get all applications installed 
Shell :: sed add line after match 
Shell :: list file in tar archive 
Shell :: CMake Error: Could not find CMAKE_ROOT !!! 
Shell :: conda install notebook 
Shell :: install openssl 1.0.2 
Shell :: create new branch without losing changes 
Shell :: bash scripts options without arg 
Shell :: centos reboot 
Shell :: send giphy on slack 
Shell :: installing xlswriter 
Shell :: windows service start 
Shell :: tar compress powershell 
Shell :: extract from tar gz into folder 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =