If/Then Conditional Statements in Shell Scripts The example below checks if the folder at bind-mount/package is empty. if [ -z "$(ls -A bind-mount/package)" ]; then # do a thing here else # else do a thing here fi