How to display a file name which has zero bytes in size.

Answers were Sorted based on User's Feedback



How to display a file name which has zero bytes in size. ..

Answer / safi

we can find using find command.

find / -size 0

This will print all files under / which has 0 size.

Is This Answer Correct ?    64 Yes 1 No

How to display a file name which has zero bytes in size. ..

Answer / shail

find / -size 0 -print

Is This Answer Correct ?    1 Yes 0 No

How to display a file name which has zero bytes in size. ..

Answer / alok

find . - type f - size 0c -print

Is This Answer Correct ?    1 Yes 0 No

How to display a file name which has zero bytes in size. ..

Answer / likhitha

#try this
#this will give you the answer

find /home/itsme -type f size 0

#this will display all 0 size "files" in /home/itsme
directory
#

Is This Answer Correct ?    1 Yes 1 No

How to display a file name which has zero bytes in size. ..

Answer / kiruthiga.s

find . - size +0c

Is This Answer Correct ?    0 Yes 0 No

How to display a file name which has zero bytes in size. ..

Answer / sreehari ck

ls -l <location>

it will display all filenames exclude hidden file names

Is This Answer Correct ?    1 Yes 1 No

How to display a file name which has zero bytes in size. ..

Answer / akula

ls -ltr | grep "^-" | sort -nk5 | head -1
or
ls -ltr | grep "^-" | sort -nk5 | head -1 | awk '{ print $9 }'

Is This Answer Correct ?    0 Yes 0 No

How to display a file name which has zero bytes in size. ..

Answer / rajdeep paul

We can find it in a different way also as shown below.

ls -lrtR |grep " 0 "

Although it is better to use find command here.

Is This Answer Correct ?    7 Yes 8 No

How to display a file name which has zero bytes in size. ..

Answer / chinmayee

Hello

By touch command we can create zero byte file.
ex:touch file1 (creating a file)
cat file1 (displaying a file which size is zero)



check..........

Is This Answer Correct ?    13 Yes 36 No

How to display a file name which has zero bytes in size. ..

Answer / gowri

touch filename

Is This Answer Correct ?    3 Yes 27 No

Post New Answer

More Unix Commands Interview Questions

Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

0 Answers  


hw will u use awk in replacing cahrs and files

0 Answers  


What is the Unix file system hierarchy?

2 Answers  


how to remotely move a file ??? that mean how to move a file one machine to another machine ???

10 Answers   Altair,


Write a command to display a file’s contents in various formats?

0 Answers  


what is the command to list all files in a directory, including the hidden files in UNIX ?

9 Answers   CTS,


What does 'mkdir' command do in UNIX?

0 Answers   Syntel, Visa,


How can you see the command line history?

0 Answers  


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

0 Answers  


Explain ‘library functions’ with respect to unix commands?

0 Answers  


Describe the zip/unzip command using gzip.

0 Answers  


Explain command to show the space allocation of files?

0 Answers  


Categories