Find zero byte file but don't need path


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find zero byte file but don't need path
# 1  
Old 04-29-2011
Find zero byte file but don't need path

Just i want to ask How to search and display name of zero byte file
I have used find command but it is showing complete file path
Thanks
find . -size 0
giving me zero byte file with location
1)/home/user/a
# 2  
Old 04-29-2011
Try this

Code:
find . -size 123c | xargs basename

c=>bytes

regards,
Ahamed
# 3  
Old 04-29-2011
but it is showing only one zero byte file though there are two files
i have given
find . -size 0 | xargs basename
# 4  
Old 04-29-2011
try this

Quote:
find . -size 0 -exec basename {} \;
# 5  
Old 04-29-2011
thanks its working fine
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Don't have tree, need advise to differentiate dir from file from this alternative that uses find

Hi, I don't have tree on the Solaris server and our SA don't want to install it. I found this example from One Line Linux Command to Print Out Directory Tree Listing | systemBash that more or less does what I am mainly looking for. Example run is as below: $: find ./ | sed -e... (2 Replies)
Discussion started by: newbie_01
2 Replies

2. Shell Programming and Scripting

Find command don't output anything, but file is there

Please if You can help me debug why nothing is found by this command? # echo "Zeus Robot" >> /home/vps/190/test # cat /home/vps/190/test Zeus Robot # find /home/vps -type f -mtime 2 -size -1000k -exec grep -l "Zeus Robot" {} \; >> out # cat out # cat /home/vps/190/test Zeus Robot Why... (6 Replies)
Discussion started by: postcd
6 Replies

3. UNIX for Dummies Questions & Answers

PATH settings don't seem to persist across sessions

I recently installed LaTeX on my linux machine and I attempted to add a directory to the PATH as the instructions say to do. They tell me to give the following command: PATH=/usr/local/texlive/2011/bin/i386-linux:$PATH; export PATH After I do this I can use commands such as "pdflatex" anywhere,... (5 Replies)
Discussion started by: TR5
5 Replies

4. UNIX for Advanced & Expert Users

Don't find file from foxbase 2.1.2d

Hi there, finally i'm installed Sco Foxbase 2.1.2d over my Sco Open Server 5.0.7v server. Well at this point almost is working fine, but, when i Run mi application i receive the next error: "sh: the_name_of_file": does not exist". I checked it over the Hard Disk and the file exist, the... (1 Reply)
Discussion started by: danilosevilla
1 Replies

5. Shell Programming and Scripting

How to a find a file in which path it is there?

Hi Firends, Good Morning to all, I want a find command to search a paticular file present in my system(ie search through under all users and all directories.) I am looking forward from you.:) Advance Thanks, Siva Ranganath CH (3 Replies)
Discussion started by: sivaranga001
3 Replies

6. UNIX for Dummies Questions & Answers

find locked files, print file path, unlock file

using OS X and the Terminal, I'd like to find all locked files in a specified directory, unlock them, and print a list of those files that were unlocked how can I do this? I'm familiar with chflags nouchg for unlocking one file but not familiar with unix enough to do what I'd like. Thanks! (0 Replies)
Discussion started by: alternapop
0 Replies

7. Shell Programming and Scripting

how to find the path of a file?

Hi all, Is there any way to find the the path of a file? I mean executable files and just anyother file we can think of? i know of one cmd called which $which mount /usr/bin/mount this is fine, but "mount" is a cmd not a file that can be searched eg: say i have created a text file... (3 Replies)
Discussion started by: wrapster
3 Replies

8. UNIX for Dummies Questions & Answers

command to find the path of a file

What is the command to find the path of a file if we know the file name and the root directory where the file resides.. For eg. if a file abc.dat resides in /home/mydir/myfiles/. I am looking for a command which will be fired from / directory, takes abc.dat as input and display the path of... (3 Replies)
Discussion started by: abhilashnair
3 Replies

9. Shell Programming and Scripting

Find a file in sub-directories.. o/p just the path

Hello All, I am somehow stumped with this ting. 'Find' will sure show me.. but I want only thepath of all the occurences of the file in any of the sub-dirs.. Any help will be sincerely appreciated. thanx! (3 Replies)
Discussion started by: pranavagarwal
3 Replies

10. UNIX for Dummies Questions & Answers

How to find if a file is zero byte or not?

hi, How to check if a file or files are of zero bytes and if yes, then to print their names? Ashu (1 Reply)
Discussion started by: er_ashu
1 Replies
Login or Register to Ask a Question