×
UNIX.COM Login
Username:
Password:  
Show Password






👤


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

Tags
solved

👤 Login to reply

 
Thread Tools Search this Thread Display Modes
    #8  
Old 12-20-2017
MadeInGermany MadeInGermany is offline Forum Staff  
Moderator
 
Join Date: May 2012
Last Activity: 16 July 2018, 7:08 AM EDT
Location: Simplicity
Posts: 4,153
Thanks: 365
Thanked 1,418 Times in 1,274 Posts
The inode number is in the 1st column.


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

Sponsored Links
    #9  
Old 12-20-2017
pradeep84in pradeep84in is offline
Registered User
 
Join Date: Dec 2012
Last Activity: 14 March 2018, 7:13 AM EDT
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 12-21-2017
Don Cragun's Unix or Linux Image
Don Cragun Don Cragun is offline Forum Staff  
Administrator
 
Join Date: Jul 2012
Last Activity: 16 July 2018, 1:02 AM EDT
Location: San Jose, CA, USA
Posts: 11,406
Thanks: 649
Thanked 3,969 Times in 3,393 Posts
Given what you have shown us with the ls -lib, the following command should work:


Code:
rm reports*s

    #11  
Old 12-21-2017
RudiC RudiC is offline Forum Staff  
Moderator
 
Join Date: Jul 2012
Last Activity: 16 July 2018, 7:55 AM EDT
Location: Aachen, Germany
Posts: 13,059
Thanks: 447
Thanked 4,008 Times in 3,685 Posts
reportss should not collide with reports.
Sponsored Links
    #12  
Old 12-21-2017
gull04 gull04 is offline Forum Advisor  
Registered User
 
Join Date: Dec 2004
Last Activity: 10 July 2018, 5:47 AM EDT
Location: Isle-of-Skye
Posts: 765
Thanks: 21
Thanked 144 Times in 126 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 12-21-2017
wtolentino wtolentino is offline
Registered User
 
Join Date: Oct 2005
Last Activity: 13 March 2018, 12:24 PM EDT
Posts: 57
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
👤 Login to reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02: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 05:05 PM
Change to directory and search some file in that directory in single command saurau Shell Programming and Scripting 2 01-21-2013 07: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 01:53 AM
Move the latest or older File from one directory to another Directory pp_ayyanar Shell Programming and Scripting 1 03-24-2010 03:22 PM



All times are GMT -4. The time now is 08:46 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.