How to delete the file with space in name

Hi
I want to delete the file "test ex.txt" file.
i run the following command in command prompt.i can delete the file successfully.
/bin/rm -f /mnt/"test ex.txt"
I want to run the command from java.So i am using the following code
String cmd = "/bin/rm -f /mnt/\"test ex.txt\"";
     Runtime rt = Runtime.getRuntime();
process = rt.exec(cmd);
The file was not deleted.
How to delete the file with space in name?
Help me

Use the form of exec that takes an array of command + args.
arr[0] = "/bin/rm"
arr[1] = "-f"
arr[2] = "/home/me/some directory with spaces";Or use ProcessBuilder, which is the preferred replacement for Runtime.exec, and which Runtime.exec calls.

Similar Messages

  • How to delete the files from server through OAF page

    Hi All,
    I have a requirement in which i am creating files on server through my CO code.
    Now once the page is rendered, i want to delete the files from the server.
    Just wondering how can we achieve this.
    Kindly advice!
    Thanks,
    Sachin

    Hi Sachin
    all the methods in the processRequest() are called during loading of the page.
    all the methods in the processFormRequest() are called during any action events on the page.
    So Use the method in processFormRequest() : write a method in
    that on which action you want to delete the file.
    regards
    sridhar

  • How to delete the files from iPhone before selling?

    How do I delete the files from my old iPhone4 before selling?

    Hey adhot,
    Before selling your iPhone, you'll want to follow these directions:
    Before you sell or give away your iOS device, make sure that you have removed all of your personal information. Follow these steps to protect your data and get your device to its factory default state for the new owner:
    Back up your device.
    Go to Settings > General > Reset, then tap Erase All Content and Settings.
    This will completely erase your device and turn off iCloud, iMessage, FaceTime, Game Center, and other services.
    If you are using iOS 7 and have Find My iPhone turned on, your Apple ID and password will be required. After you provide your password, the device will be erased and removed from your account so that the next owner can activate it.
    Contact your carrier for guidance on transferring service to the new owner.
    When the device is turned on for the first time by the new owner, Setup Assistant will guide them through the setup process.
    Important: Do not manually delete contacts, calendars, reminders, documents, photo streams, or any other iCloud data while signed in to your iCloud account, or the content will also be deleted from the iCloud servers and all of your iCloud devices.
    via: What to do before selling or giving away your iPhone, iPad, or iPod touch
    http://support.apple.com/kb/HT5661
    Have a great day,
    Delgadoh

  • [Solved] Removing files with space in name.

    Hello!
    I have files named Feh wallpaper (exactly with space in name) and I was trying to remove it but i don't have any file manager and I remove files by rm.
    I was try rm -r feh_wallpaper and rm feh wallpaper and rm can't remove it
    Last edited by SpeedVin (2009-06-30 04:23:29)

    sHyLoCk wrote:
    SpeedVin wrote:Hello again i have a question how to copy files with space in neme i was trying /file but no succes and i have () in the name of file that's are a problem
    I can't rename it i got the same error when i want copy this file
    Did you try with quotes? and it is \file "\" is an escape sequence.
    Ohh thanks option with quotes work
    Last edited by SpeedVin (2009-07-15 11:23:16)

  • How to delete the tracks with exclamation marks?

    I have just moved about 10 gigabytes of music I don't listen to off my hard disk to an external hard drive. This was to declutter my hard drive and get me down to about 50% free. Itunes now has all the moved tracks still listed with exclamation marks next to them all now. I want rid of these songs from my Itunes view. How can I get rid of these moved tracks now without manually deleting the batches. Annoying that exclamation mark field is not sortable or would be easy to mass delete.
    Anyone got a neat solution out there?
    Thanks in advance.
    Lorne

    Yes, but now you have lost all your regular playlists, ratings, play counts, last played dates, non-embedded artwork etc.
    Hope you don't miss them. If you do it might be possible to restore an earlier version of your library file and then bring it up-to-date with the free scripts at Doug's site.
    An all iTunes, no loss of data approach would have been as follows:
    Create a playlist called Found, select everything in Music and drag it into the Found playlist. Create a smart playlist called Lost matching All the rules Playlist is Music and Playlist is not Found. Your lost tracks will be in this playlist. You can delete them all with a Command-A to select them and Option-Delete to remove them. You can then delete the Lost & Found playlists.
    I normally recommend the scripts as being an easier way to do things that you may want to do again.
    tt2

  • How to delete the records with routine Z_AFRP4_DELETE as note [418584|

    Hello Gurus,
    I don't want to transfer data into HR and want to delete the records in table AFRP4 to business complete the Maintenance Orders
    Component version- EHP7 for SAP ERP 6.0
    Component-EA-APPL
    Release-617
    how can I delete these records
    Thanks fro Help
    AM

    Hello All,
    I found the solution, I copied the code in correction instruction number 0000282352 and create the report as programme  Z_AFRP4_DELETEand the executed
    *$*$----------------------------------------------------------------$*$*
    *$ Correction Inst.         0120061532 0000282352                     $*
    *$--------------------------------------------------------------------$*
    *$ Valid for       :                                                  $*
    *$ Software Component   SAP_APPL   SAP Application                    $*
    *$  Release 40B          All Support Package Levels                   $*
    *$  Release 45B          All Support Package Levels                   $*
    *$  Release 46B          All Support Package Levels                   $*
    *$  Release 46C          All Support Package Levels                   $*
    *$  Release 470          All Support Package Levels                   $*
    *$  Release 500          All Support Package Levels                   $*
    *$  Release 600          All Support Package Levels                   $*
    *$  Release 602          All Support Package Levels                   $*
    *$  Release 603          All Support Package Levels                   $*
    *$  Release 604          All Support Package Levels                   $*
    *$  Release 605          All Support Package Levels                   $*
    *$  Release 606          All Support Package Levels                   $*
    *$--------------------------------------------------------------------$*
    *$ Changes/Objects Not Contained in Standard SAP System               $*
    *$*$----------------------------------------------------------------$*$*
    *& Object          REPS Z_AFRP4_DELETE
    *& Object Header   PROG Z_AFRP4_DELETE
    *& REPORT Z_AFRP4_DELETE
    REPORT  Z_AFRP4_DELETE .
    * This report deletes confirmation records from table AFRP4 that are
    * not longer needed. Run it without update flag first !!
       tables: afrp4.
       data: lt_afrp4 like afrp4 occurs 0,
             ls_afrp4 like afrp4.
       selection-screen begin of block order with frame.
       select-options: zorders for afrp4-aufnr.   "order number
       selection-screen end   of block order.
       parameters: update as checkbox.
       select * from afrp4 into table lt_afrp4
                    where aufnr in zorders.
       if lt_afrp4[] is initial.
         format color col_normal.
         write: 'No HR confirmation background records read.'.
         exit.
       endif.
       format color col_heading.
       write: /5 'Order', 25 'Confirmation', 45 'Counter'.
       skip.  uline.  skip.
    * show corrections
       loop at lt_afrp4 into ls_afrp4.
         format color col_normal.
         write: /5 ls_afrp4-aufnr, 25 ls_afrp4-rueck, 45 ls_afrp4-rmzhl.
       endloop.
    * update on data base table
       if not update is initial.
         skip.  uline.  skip.
         delete afrp4 from table lt_afrp4.
         if sy-subrc is initial.
           format color col_positive.
           write: 'HR-records deleted successfull'.
         else.
           format color col_negative.
           write: 'Error when trying to update data base table AFRP4.'.
         endif.
       endif.

  • Rarcrack - how long for the file with 400 MB ?

    Hi everyone
    I'm trying to get the password in the encrypted file with 400 MB. It's more time I thought.
    If someone have used the program, rarcrack, can you tell me know that get the password with special characters ? 
    For example:
    The encrypted file with 400MB + the passwords "?_123_123_abc_@theworld".
    How long for that ?
    Thank you very much.
    Last edited by luckybc (2014-12-26 06:29:07)

    Does rarcrack know how long the pass-phrase is or not?
    Also, are you using a dictionary/removing obvious choices of pass-phrase to help speed up the process OR are you brute-forcing every single pass-phrase from the ASCII alpha-numeric alphabet + punctuation?
    TL;DR: Assuming I've done the Maths correctly, a damn sight longer that you might have thought
    Since you haven't said, I'm going to assume YES to the first question and I'm assuming you're brute forcing, to make the maths simpler.
    For one character position you're looking at about 26 lower case + 26 upper case + 10 digits + 10 punctuation marks of some sort. So that's 72 characters. You've got 22 characters in the passphrase, so that's a potential of 72^22 = 7.26632672153 x 10^40 pass-phrase combinations.
    Now let's assume you're doing this on modern hardware, with an SSD on a single machine which can process something at the rate of 200MB/s. That's two seconds a pass. That'll take you about 2.01842408931 x 10^37 hours.
    Disclaimer: I'm working off the assumption that encryption has been used, and that rarcrack would decrypt the whole file on each attempt (pass-phrase protection and encryption are different things...). I don't actually know how it works, but for those that do know how it does, you can probably work out the time from the number of pass-phrase combinations.
    Last edited by clfarron4 (2014-12-26 12:01:20)

  • Mail app's Previous Recipients-how to delete the file?

    I have tried, unsuccessfully, to Remove From List all the items in Previous Recipients, but they always return after I quit Mail and relaunch. I need to find the file that contains these stragglers and delete them forever. Anyone know where it is to be found?

    Daniel,
    The source of the Previous Recipient data is the AddressBook folder within the Application Support folder of your User folder (Home)/Library. It is in a file named MailRecents. In the Finder, you can delete that, but be sure for any backup source you may have in operation.
    If only due to some corruption, the date last modified will stale on the MailRecents file.
    Ernie

  • [SOLVED]Audacious can't open files with spaces on name

    I open audacious
    Type Ctrl+o and select a directory with spaces on it names,
    Audacious opens nothing
    Any ideas?
    I have deep trees of music with spaces, I was working on a script to rename one by one, but I'm too lazy
    Cheers
    Last edited by geckos (2014-01-29 21:32:33)

    Here is my solution, I did this for every error that apears like that...
    [geckos@localhost ~]$ audacious
    (bootstrap.c:60) [mowgli_init]: mowgli_init() is a deprecated function, provided only for backwards compatibility with Mowgli-1. You should remove it if you no longer support using Mowgli-1.
    *** ERROR: /usr/lib/audacious/Input/cdaudio-ng.so could not be loaded: libcdio_cdda.so.1: cannot open shared object file: No such file or directory
    ^C[geckos@localhost ~]$
    [geckos@localhost ~]$ pkgfile -r '.*/libcdio_cdda.so.1'
    extra/libcdio-paranoia
    [geckos@localhost ~]$ sudo pacman -Syu libcdio-paranoia
    :: Synchronizing package databases...
    (3/3) installing libcdio-paranoia [###########################################] 100%
    [geckos@localhost ~]$
    [geckos@localhost ~]$

  • HT2534 How to deleted the files in menu

    Please help me to remove the application to my screen menu..
    Tell me how to do it tnx,,,

    If you want to delete an app, tap and hold down on the icon until it wiggles then tap the X on the icon. Tap the home button when done.
    If you are asking about something else, please clarify.

  • Need to delete the file

    Hi Experts,
    I have one requirement, I am getting CODEPAGE error. To over come this i have a solution.
    but in that i am writing into the file and replacing the special characters with the space.
    But after writing into the file i want to delete the file, so that no conflict should be raised for two parallel user are accessing the same program simontenously.
    Kindly suggest how to delete the file after writing. and the time stamp of the file deleting in ddmmyyhhmmss format.
    Thanks in advance.
    Regards,
    Chirag

    Hi Chirag,
    A sample code snippet for you:-
    DATA FNAME(60) VALUE 'myfile'.
    OPEN DATASET FNAME FOR OUTPUT.
    OPEN DATASET FNAME FOR INPUT.
    IF SY-SUBRC = 0.
      WRITE / 'File found'.
    ELSE.
      WRITE / 'File not found'.
    ENDIF.
    DELETE DATASET FNAME.
    OPEN DATASET FNAME FOR INPUT.
    IF SY-SUBRC = 0.
      WRITE / 'File found'.
    ELSE.
      WRITE / 'File not found'.
    ENDIF.
    The output appears as follows:
    File found
    File not found
    Regards
    Abhii

  • How to delete  Plugins files in Library

    Hello guys.
    I am using AU plugins called Aalto .I saved files.
    That makes Logic keep crashing.
    So I wanna deleted the files I saved.
    I try to find a folder to removed it but I cound not find it .And try reinstall plugins and loading again but still the files is there. I dont get it.
    Can somebody help that how to delete the file  " Test version recoding ,Welcome to Aalto."?
    Please help.
    Thanks.
    Luna
    CCCcan

    If the cache path is to this folder then go with purging or else stop bi service and delete

  • How to delete preferences file???

    I recently bought a new Brother printer for my iMac v10.6.8.
    After installing, I could not properly print documents (very small font, not readable). 
    When I print a test-page directly from my printer menu, the result is perfect.
    People on the forum asked me to create another account on the iMac, and try to print.
    The result was indeed perfect.
    My question now is; where can I find, and how can I delete the file with preferences?
    I already deleted the .plist-file in Library/Preferences/Brother. Without result...

    They are found in the /Home/Library/Preferences/ folder. What you really should do is open Print & Scan preferences, select the Brother device in the list and click on the Delete [-] button. CTRL- or RIGHT-click in the list box and select Reset Print System from the context menu. Now click on the Add [+] button and re-Add the printer.

  • How to send multiple files with it's original name over HTTPS using one CC?

    I am working on a File to HTTPs scenario. It is in production and working fine. Currently we send only one file and I have hard coded the name in the communication channel in the header fields. Now we have to send more files with different names and I want to use only one receiver channel instead of many. We need to send the files with their original names.
    I used the ASMA in the sender File Adapter and I see the FileName in the dynamic configuration under http://sap.com/xi/XI/System/File name="FileName".
    I know we can use a UDF in message mapping and get the value and put it in HEADERFIELDONE. But we don't want to use mapping as the files are huge and we don't want to insert XML tags in the payload.
    So how do I put the Filename from the DynamicConfiguration to the HTTP header field as FileName without using mapping? Are there any settings?
    Can I put something in the PROLOG or can I use any other module in the File Sender Adapter or is there any other option?
    Any help is appreciated.
    Thanks
    Sai

    See my blog:
    /people/stefan.grube/blog/2009/06/19/unknown-use-case-of-dynamicconfigurationbean-store-file-name-to-jms-header-without-mapping
    You have to put the configuration in sender channel, as HTTP adapter does not allow modules.
    For the second module, put values related to HTTP adapter.

  • How to find the file by name and identify its type?

    Hi,
    In a folder thare are many files, the file types are doc, docx, pdf, and rtf. The file name is something like "FirstName LastName(more extrat letters).filetype".
    Now I would like to find all the files with a certain name and identify their types. For example, by input "Bill Gates", I would get the list of all files :
    Bill Gates.doc, Bill Gates-2010.pdf etc ...
    Any good ideas are welcome.
    Pengyou

    For finding files whose names match a certain pattern, create a FileFilter or FilenameFilter that returns true when the name matches the pattern in question, and then call list() or listFiles() with that filter.
    For identifying the "type", that depends what you mean. File's don't actually have a type. It's just that they're interpreted as such in some contexts. The simplest thing is to just look at the extension. You can be more sophisticated than that, but that gets complicated real fast. It depends what you're actually trying to accomplish.

Maybe you are looking for

  • Creative Cloud User Agent String spoofing old Chrome Browser?

    Was troubleshooting Creative Cloud not working on our network and noticed it is spoofing an old Chrome browser User Agent String. When Creative Cloud launches it presents itself as: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.22 (KHTML, like

  • Take Audio from a Clip

    Hi all, I'm very new to video but I've shot some video of a band and I want to improve the sound in Logic Pro (my comfort zone). How can I strip the audio from the video and save it so I can edit in Logic. The video is HDV Many thanks Steve

  • String in SQL Statement

    Hello All! Please help me how I can put in SQL statement string. For now, I have in data in field 9985. I need 99.85. Thank you in advance.

  • What is the fastest way to find a Node in an xml ?

    Hi all, We have a procedure which has to process huge XML documents (files of up to 250Mega). Without going too deep in the algorithm, I need to read data from legacy and build nodes in XML. In the legacy data I have written in tabular form the xml h

  • IPhone 5 suddenly no receiver sound

    Suddenly stopped receiver and can hear sound only through speaker phone or head phones.  I followed diesel vdub's recommendations (Jan 8, 2013) replying to thopkins8's question, but non of them worked. Is this a possible hardware or OS issue?