File and Directory same name

Tags
solved

 
Thread Tools Search this Thread
# 8  
Old 12-20-2017
The inode number is in the 1st column.
Code:
find . \! -name . -prune -inum 151855 -exec echo rm {} \;

# 9  
Old 12-20-2017
Hi,

Please execute find command as below.

Code:
find . -inum 151855 -print

# 10  
Old 12-21-2017
Given what you have shown us with the ls -lib, the following command should work:
Code:
rm reports*s

# 11  
Old 12-21-2017
reportss should not collide with reports.
# 12  
Old 12-21-2017
Hi Folks,

This would just seem to me that there is a backspace embedded in the file name.

Code:
e415243 on BUILD cathsunvs02 # od -c
reportys^?^?s
reports
0000000   r   e   p   o   r   t   y   s 177 177   s  \n   r   e   p   o
^Ce415243 on BUILD cathsunvs02 #

So most of the solutions above will work fine.

Regards

Gull04
# 13  
Old 12-21-2017
Code:
$ ls -lib
total 472
204826 drwxrwxr-x    2 ora102   lpsgrp          256 Apr 03 2009  executables
204827 drwxrwxr-x    2 ora102   lpsgrp        12288 Nov 13 14:31 forms
204828 drwxrwxr-x    2 ora102   lpsgrp        12288 Dec 21 15:18 reports
151855 -rwxr-xr-x    1 wtolenti lpsgrp       217088 Jul 09 2015  reports\177s
204829 drwxrwxr-x    2 ora102   lpsgrp          256 Apr 03 2009  scripts
204830 drwxrwxr-x    2 ora102   lpsgrp          256 Apr 03 2009  sql
$ find . -inum 151855 -print
./reports
$

---------- Post updated at 03:39 PM ---------- Previous update was at 03:37 PM ----------

thanks so much everyone it works

Code:
$ ls -altr reports*s
-rwxr-xr-x    1 wtolenti lpsgrp       217088 Jul 09 2015  reports
$ rm reports*s
$
$ ls -latr
total 56
drwxrwxr-x    2 ora102   lpsgrp          256 Apr 03 2009  sql
drwxrwxr-x    2 ora102   lpsgrp          256 Apr 03 2009  scripts
drwxrwxr-x    2 ora102   lpsgrp          256 Apr 03 2009  executables
drwxrwxr-x    8 ora102   lpsgrp          256 Apr 22 2009  ..
drwxrwxr-x    2 ora102   lpsgrp        12288 Nov 13 14:31 forms
drwxrwxr-x    2 ora102   lpsgrp        12288 Dec 21 15:18 reports
drwxrwxr-x    7 ora102   lpsgrp         4096 Dec 21 15:38 .
$


|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to find and get a file in an entire directory with an excluded directory specified? abdulbadii UNIX for Beginners Questions & Answers 2 03-22-2018 07:14 AM
Shell script cannot create directory and move the file to that directory digioleg54 Shell Programming and Scripting 9 04-12-2017 03:57 AM
Systemd errors of missing file “No such file or directory” inspite of file being present rupeshkp728 Shell Programming and Scripting 0 12-14-2016 04:13 AM
Rename specific file extension in directory with match to another file in bash cmccabe Shell Programming and Scripting 1 03-04-2016 06:55 PM
Shell scripting-I need a script which should watch a directory for a file with specific directory akashdeepak Shell Programming and Scripting 8 08-26-2014 06:05 PM
Change to directory and search some file in that directory in single command saurau Shell Programming and Scripting 2 01-21-2013 08:53 AM
Grepping file names, comparing them to a directory of files, and moving them into a new directory sHockz Shell Programming and Scripting 1 02-02-2012 02:53 AM
Script which removes files from the first directory if there is a file in the second directory SLAMUL Shell Programming and Scripting 6 10-26-2011 09:12 PM
Help with searching for a file in a directory and copying the contents of that file in a new file zel2zel UNIX for Dummies Questions & Answers 6 03-05-2011 01:44 PM
Move the latest or older File from one directory to another Directory pp_ayyanar Shell Programming and Scripting 1 03-24-2010 04:22 PM
File transfer from one directory to another directory in unix easterraj Shell Programming and Scripting 5 11-03-2009 02:40 AM
Move a file from windows directory to unix directory kingpeejay Shell Programming and Scripting 1 06-19-2009 02:31 PM
Deleting the file only to all the directory and sub directory kingganesh04 Shell Programming and Scripting 7 12-30-2008 03:13 AM
find for specific content in file in the directory and list only file names madhu_Jagarapu AIX 2 12-23-2008 02:13 AM
Copying one file at a time from one directory to another directory. Nikhilindurkar UNIX for Dummies Questions & Answers 1 09-01-2008 10:25 AM