How to find files without any name i.e. blank names???


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to find files without any name i.e. blank names???
# 1  
Old 04-06-2012
How to find files without any name i.e. blank names???

I tried using

Code:
find . -type f -name " "

It works only if there is single space.
what if i want to find only for the files without any name(no space constraint)???

Last edited by Franklin52; 04-06-2012 at 07:45 AM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 04-06-2012
First off, unix filesystems cannot have a filename that is just the nul (ASCII 0) character,
unless the filesystem has been badly corrupted. In other words if you have "noname" files they are probably files that have unprintable characters in the name.

If you think the filesystem has been corrupted, use fsck or a similar tool to check it.

This will find files that have at least one blank (ASCII 32 character ) in the name:
Code:
ls | grep ' '

If you have an all blanks (1 blank ... n blanks) filename the output of ls looks like this:
Code:
$ ls
                     close.csv              myfile.csv            t.lis
7167215.gpx          closest.gpx            np.c                  t.o

Note the "empty" spot.
# 3  
Old 04-07-2012
hey jim

What if i'm in the root directory???
# 4  
Old 04-08-2012
This User Gave Thanks to chihung For This Post:
# 5  
Old 04-09-2012
thanks a lot chihung Smilie Smilie
but one more doubt is...

how can it show me the absolute path of the filename..??
tried using find command...
but it dint help....
# 6  
Old 04-09-2012
Code:
find $PWD -type f -name "* *" -exec ls -dlb {} +

# 7  
Old 04-09-2012
jlliagre

thanks!!!!

but i doubt it will work for special characters!!!
it works only for space.
I did try this only in the beginning. SmilieSmilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find out the weird blank characters?

I have a text file downloaded from the web, I want to count the unique words used in the file, and a person's speaking length during conversation by counting the words between the opening and closing quotation marks which differ from the standard ASCII code. Also I found out the file contains some... (2 Replies)
Discussion started by: yifangt
2 Replies

2. UNIX for Dummies Questions & Answers

How to find position of blank row in UNIX?

Hi I have file "emp.txt"like below Emp Id Name 123 aa 123 bb 223 cc 233 dd 334 ee Please help me to know that the position of the blank row. (5 Replies)
Discussion started by: rock_01
5 Replies

3. Shell Programming and Scripting

Exclude certain file names while selectingData files coming in different names in a file name called

Data files coming in different names in a file name called process.txt. 1. shipments_yyyymmdd.gz 2 Order_yyyymmdd.gz 3. Invoice_yyyymmdd.gz 4. globalorder_yyyymmdd.gz The process needs to discard all the below files and only process two of the 4 file names available ... (1 Reply)
Discussion started by: dsravanam
1 Replies

4. Shell Programming and Scripting

I want to find the difference between two files, only for the header (column names)

Hi All, I want to find the difference between two files, by checking only the headers (column names) and report if any new column is added in the latest file. For Ex: If the file "declartion.txt has these columns url;image;id;showcase_id;showcase_name and the actual file "feed.txt" has... (34 Replies)
Discussion started by: Praveen Pandit
34 Replies

5. Shell Programming and Scripting

Find a blank field

Find a blank field Hi I have set of fields that have some blank values, how to find that and get its line noumbers in output file. Ex: Col1 col2 col3 11 ss 103 12 104 13 105 14 se 106 (2 Replies)
Discussion started by: Shenbaga.d
2 Replies

6. UNIX for Dummies Questions & Answers

how to find all .sql file names in all .sh unix files

Hi Guys, Can any one help me on this, I want to write unix command to get all .sh unix file name which are refered .sql files in it. Thanks Kolipaka (3 Replies)
Discussion started by: lakshmanrk811
3 Replies

7. Shell Programming and Scripting

How to find all files which has names in uppercase in a directory

i want to display all the files which has their names in the Uppercase in a particular directory...guide.. (6 Replies)
Discussion started by: sheelsadan
6 Replies

8. Shell Programming and Scripting

How to find empty files in a directory and write their file names in a text?

I need to find empty files in a directory and write them into a text file. Directory will contain old files as well, i need to get the empty files for the last one hour only. (1 Reply)
Discussion started by: vel4ever
1 Replies

9. Shell Programming and Scripting

Find and replace blank in the last field

Hi all, I have a huge file and I need to get ride of the fields 6-11 and replace the blanks in field 5 with a missing value(99999). 159,93848,5354,343,67898,45,677,5443,434,5545,45 677,45545,3522,244, 554,54344,3342,456, 344,43443,2344,444,23477... (12 Replies)
Discussion started by: GoldenFire
12 Replies

10. Shell Programming and Scripting

Find line before blank

Hello, I actually have two issues. First, here is the file the way it is now. someword someword:1 new-word new-word abcd someword someword:10 new-word new-word abcd thisis whatIneed:3 someword someword:5 new-word new-word abcd I need to get the line before the 2... (6 Replies)
Discussion started by: ddrew78
6 Replies
Login or Register to Ask a Question