How Do You Check If the File Is Empty in Linux?
Contents How Check If File Is Empty Linux? Touch /Tmp/F1 Echo “Data” >/Tmp/F2 Ls -L /Tmp/F{1,2} [ -S /Tmp/F1 ] Echo $? the Non Zero Output Indicate That File...
Contents
How check if file is empty Linux?
touch /tmp/f1 echo “data” >/tmp/f2 ls -l /tmp/f{1,2} [ -s /tmp/f1 ] echo $? The non zero output indicate that file is empty. [ -s /tmp/f2 ] echo $? The zero output indicate that file is not empty.
Must Read
How can I check if a file is empty?
Check empty file?
- package com. app;
- io. File;
- public class CheckEmptyFile {
- if (file. length() == 0)
- System. out. println(“File is empty!!!”);
- else.
- System. out. println(“File is not empty!!!”);
- }
9 янв. 2017 г.