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???
# 8  
Old 04-09-2012
I was answering to you last question which was about getting the full path of the filenames. It is unclear what you are looking for, as there is no such thing as files with no names under Unix.
What are the special characters you are looking for ?
# 9  
Old 04-09-2012
My question is how can i find the files which has no names.
I want to find their absolute path.
The filename is empty, It mite contain space or else any special or control characters.

---------- Post updated at 05:46 PM ---------- Previous update was at 05:42 PM ----------

one more thing is, I would like to find that file from anywhere.... mean to say root or any other parent directory.
# 10  
Old 04-09-2012
In my blog, current directory will be used for the 'find' if you do not supply an argument. All you have to do is to run the script with an absolute path

Code:
#! /bin/sh


ls -1Rb ${1:-.} | \
nawk '
...

# 11  
Old 04-09-2012
Quote:
Originally Posted by nikhil jain
My question is how can i find the files which has no names.
There is no such thing.
Quote:
I want to find their absolute path.
I answered to that part.
Quote:
The filename is empty, It mite contain space or else any special or control characters.
If it contains special or control characters, it is not empty.
Quote:
one more thing is, I would like to find that file from anywhere.... mean to say root or any other parent directory.
This will find files and directories with embedded spaces or control characters from anywhere:
Code:
find / -name "*[$(printf "\01")-$(printf "\037") ]*" -exec ls -ldb {} +

# 12  
Old 04-09-2012
thanks a lot chihung Smilie

jlliagre

It did worked
but can u explain me below stuff
Code:
(printf "\01")-$(printf "\037")

??

Last edited by Scrutinizer; 04-09-2012 at 10:26 AM.. Reason: Code tags..
# 13  
Old 04-09-2012
That means the range of characters from ASCII #1 to ASCII #31 (37 in octal) which happen to be the ASCII control characters.
This User Gave Thanks to jlliagre For This Post:
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