- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Deleting an archive with an space
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 03:30 AM
тАО01-03-2006 03:30 AM
how can i delete a file which contains an space ?
For example: there is a file named
root@user1> ls -1
log commands.txt
name of programs.txt
book to learn spanish.txt
root@user1>
If i aply: rm log* it can not deleted
how can i delete them?
Thanks, Manuales.
Solved! Go to Solution.
- Tags:
- evil spaces
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 03:32 AM
тАО01-03-2006 03:32 AM
Re: Deleting an archive with an space
rm "file name"
Jeff Traigle
- Tags:
- quoting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 03:32 AM
тАО01-03-2006 03:32 AM
Re: Deleting an archive with an space
"the name.log"
should work.
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 03:40 AM
тАО01-03-2006 03:40 AM
Re: Deleting an archive with an space
Will deal with more than one space, or tab between the "log" part of the name and the remainder.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 04:18 AM
тАО01-03-2006 04:18 AM
SolutionA general variation of this problem is to handle a file with special, non-printing characters as well as embedded spaces. Here's one way to search-and-destroy those:
# cd filesystem
# find . -xdev name "bad*" -exec ls -li {} \;
(or):
# ls -ilb . #...in place of the above 'find'
Either the 'find' or the 'ls' alone will expose the inode number of the file in question. Now use it to delete the file, like this:
# find . -inum 152 -xdev -exec rm -i {} \;
REMEMBER that an inode number is only unique WITHIN a filesystem! Using an interactive 'rm' is always a safety net. The '-xdev' option of 'find' also insures that you do NOT cross mountpoints (filesystems).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 04:48 AM
тАО01-03-2006 04:48 AM
Re: Deleting an archive with an space
Try some of the suggestion in this question posted in the forum before for a similar situation.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=953425
Hope this helps.
regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 04:53 AM
тАО01-03-2006 04:53 AM
Re: Deleting an archive with an space
ll -i
this will list the inode number in the first column.
Like this:
571217 -rw-r--r-- 1 kmo users 0 Jan 3 12:52 fred
You're file's number will be different then 571217 of course.
With this information, you type:
find . -inum 571217 -exec rm {} \;
Of course, you would replace the 571217 with your inum.
Oz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 05:06 AM
тАО01-03-2006 05:06 AM
Re: Deleting an archive with an space
do you know another one?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 05:14 AM
тАО01-03-2006 05:14 AM
Re: Deleting an archive with an space
What didn't work? They doing this (as I first suggested):
# cd /tmp
# touch "book to learn spanish.txt"
# ls -li /tmp/"book*"
# find . -xdev -name "book*" -exec ls -li {} \;
...either command shows me 152 as the inode number on my filesystem. Hence:
# find . -xdev -inum 152 -exec rm -i {} \;
./book to learn spanish.txt: ? (y/n) y
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-03-2006 05:21 AM
тАО01-03-2006 05:21 AM
Re: Deleting an archive with an space
now, in this moment i'm verifying the others answers ...
thanks !!!