Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

sh check if directory is empty

#!/bin/bash
DIR="/tmp"

if [ "$(ls -A $DIR)" ]; then
     echo "Wow, $DIR is not Empty"
else
    echo "$DIR is Empty"
fi
Comment

PREVIOUS NEXT
Code Example
Shell :: restart nginx server 
Shell :: search for a commit in git logs 
Shell :: Failed to download metadata for repo ‘AppStream’ 
Shell :: download woeusb for ubuntu 20.04 
Shell :: install alacritty ubuntu 20.04 
Shell :: could not connect to development server 
Shell :: install docker kali linux 
Shell :: count sub files in folder linux 
Shell :: add kernel to jupyter 
Shell :: bash get width of terminal 
Shell :: ubuntu bluetooth protocol not available 
Shell :: restart ssh on windows 
Shell :: install yarn on centos 
Shell :: show all passwords linux 
Shell :: how to change account in git bash 
Shell :: pc specs linux command 
Shell :: bash return n characters after match 
Shell :: adding jars to classpath in linux 
Shell :: zsh: corrupt history file /home/.zsh_history 
Shell :: install postcss 
Shell :: homebrew restart redis 
Shell :: locate command not found 
Shell :: Error: Cannot install in Homebrew on ARM processor in Intel default prefix (/usr/local)! 
Shell :: how to check in which brach we are in git 
Shell :: Install dia for linux ubuntu 
Shell :: make all files in directory executable 
Shell :: powershell tolower 
Shell :: how to know the shell version in ubuntu 
Shell :: linux check gpu usage 
Shell :: starting apacha fail 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =