Unix/Linux Go Back    


UNIX for Beginners Questions & Answers If you're not sure where to post a Unix or Linux question, post it here. All unix and Linux beginners welcome in this forum!

File and Directory same name

UNIX for Beginners Questions & Answers


Tags
solved

Reply    
 
Thread Tools Search this Thread Display Modes
    #8  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wtolentino
MadeInGermany's Unix or Linux Image
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 22 January 2018, 3:00 AM EST
Location: Simplicity
Posts: 3,947
Thanks: 335
Thanked 1,322 Times in 1,192 Posts
The inode number is in the 1st column.


Code:
find . \! -name . -prune -inum 151855 -exec echo rm {} \;

Sponsored Links
    #9  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wtolentino
pradeep84in's Unix or Linux Image
pradeep84in pradeep84in is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 28 December 2017, 7:57 AM EST
Location: Bengaluru / Kolkata, India
Posts: 17
Thanks: 5
Thanked 0 Times in 0 Posts
Hi,

Please execute find command as below.



Code:
find . -inum 151855 -print

Sponsored Links
    #10  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wtolentino
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 21 January 2018, 11:05 PM EST
Location: San Jose, CA, USA
Posts: 10,929
Thanks: 611
Thanked 3,819 Times in 3,263 Posts
Given what you have shown us with the ls -lib, the following command should work:


Code:
rm reports*s

    #11  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wtolentino
RudiC's Unix or Linux Image
RudiC RudiC is online now Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 22 January 2018, 3:28 AM EST
Location: Aachen, Germany
Posts: 11,966
Thanks: 354
Thanked 3,688 Times in 3,386 Posts
reportss should not collide with reports.
Sponsored Links
    #12  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wtolentino
gull04's Unix or Linux Image
gull04 gull04 is offline Forum Advisor  
Registered User
 
Join Date: Dec 2004
Last Activity: 19 January 2018, 6:23 AM EST
Location: Isle-of-Skye
Posts: 731
Thanks: 19
Thanked 131 Times in 116 Posts
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
Sponsored Links
    #13  
Old Unix and Linux 4 Weeks Ago   -   Original Discussion by wtolentino
wtolentino's Unix or Linux Image
wtolentino wtolentino is offline
Registered User
 
Join Date: Oct 2005
Last Activity: 22 December 2017, 9:03 AM EST
Posts: 56
Thanks: 11
Thanked 0 Times in 0 Posts


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 .
$

Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell script cannot create directory and move the file to that directory digioleg54 Shell Programming and Scripting 9 04-12-2017 03:57 AM
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
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



All times are GMT -4. The time now is 04:32 AM.