Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash check if file is readable

FILE="/path/to/some/file"

if [[ -r $FILE && -w $FILE ]]; then
  # do stuff
else
  # file is either not readable or writable or both
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: restart bind centos 8 
Shell :: jenkins execute shell script on remote host using ssh 
Shell :: store pass git 
Shell :: awk field separator multiple characters 
Shell :: how to install spotify in ubuntu 
Shell :: upload git repository to github 
Shell :: how to get process id in linux 
Shell :: move linux 
Shell :: installing font awesome brand icons 
Shell :: if file not exists 
Shell :: Unable to upgrade Flutter: no origin repository configured. 
Shell :: awk if 
Shell :: where to find files in WSL unbuntu home directory on windows 
Shell :: create new github repo 
Shell :: store environment variables firebase 
Shell :: powershell -file 
Shell :: set default editor bash 
Shell :: display settings ubuntu 20.04 in right side 
Shell :: exit branch git 
Shell :: uninstall kubeadm 
Shell :: bash for 
Shell :: fetch a specific branch 
Shell :: docker build and run one command 
Shell :: kivy install ubuntu 
Shell :: install fm migrate 
Shell :: permanent noh vim 
Shell :: how to paste the lines in the buffer into the text after the current line in vi 
Shell :: unable to start test validator. check .anchor/test-ledger/test-ledger-log.txt for errors. 
Shell :: The fingerprint for the RSA key sent by the remote host is 
Shell :: -f in shell script 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =