Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

-f in shell script

#-f in shell script is used to check if a file exists or not

filename=/home/root/sample.txt
if [ -f $filename ]
 then
     echo "File exists"
 else
     echo "File doesn't exists"
 fi
 
 Note: You can directly give the file name inside brackets.
Comment

PREVIOUS NEXT
Code Example
Shell :: amend git description 
Shell :: install next-auth 
Shell :: ssh with key linux 
Shell :: time machine logs 
Shell :: install docker-machine-driver-hyperkit 
Shell :: run ssh and immediately execute command 
Shell :: node installation error authenticated user is not valid 
Shell :: golang msys2 
Shell :: veil framework install 
Shell :: colcon build number of threads 
Shell :: bash store string in variable 
Shell :: Delete non empty folder 
Shell :: get rasbien version 
Shell :: install svgo linux 
Shell :: flutter add const auto 
Shell :: get all installed application in windiws in C# 
Shell :: how to generate a .gitignore 
Shell :: cannot open source file conio.h ubuntu 
Shell :: brownie list networks 
Shell :: docker compose command 
Shell :: seach only in name apt 
Shell :: linux convert pdf trennen 
Shell :: desintaar pip de macos 
Shell :: replace spaces with hypen linux 
Shell :: windows 10 ipconfig fix 
Shell :: libodbc1 2.3.7 ubuntu 
Shell :: ufw command not found bitnami 
Shell :: use rebase in git command 
Shell :: guest additions not working on ubutnu 2104 
Shell :: lxc command not found 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =