How to display a file name which has zero bytes in size.
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / sreehari ck
ls -l <location>
it will display all filenames exclude hidden file names
| Is This Answer Correct ? | 1 Yes | 1 No |
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 |
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 |
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 |
what is the default signal kill in unix?
how will you convert a general file to a hidden file?
What is a bash command?
What is in grep command?
what is the use of uniq commmand?
what is the use of ls -l command & what is the information it gives about user ?
Which RAID Levels supported by LVM?
Assume the following files are in the working directory prompt> ls -l tasks -rw-r--r-- 1 alex student 1423 Feb 21 14:01 tasks What command can Alex use to give everyone permission to write to the file? What will the ls -l command display if he does so?
How do I search a whole word in vim?
distinguish between paging and swapping?
What is the difference between cat and more command?
What are Unix processes, and how do you manage them?