Unix command to delete range of files

Hi
I need to delete the files including and between these file numbers:
P0001665877.dbf . . . and P0001665985.dbf
Is this the correct command?:
rm P0001665[8-9]*.dbf
or should it be this:
rm P0001665[8-985]*.dbf
Thanks in advance.
AIX 5.2

Fred is trying to match all the conditions,
you mentioned you need to delete all filename between P0001665877.dbf and P0001665985.dbf
You need to wrap your example by code, we can't tell the exact command you posted, it was parsed a little by forum.

Similar Messages

  • Unix command to delete files with .cache extension

    I was wondering if anyone knew of a unix command that can be sent to another computer that will delete all files on the hard drive with a certain extension such as .cache.
    Like: rm *.cache
    Thank you!

    Well, I don't recommend it, but if you want to fubar the computer, send this as root:
    find / -name "*.cache" -exec rm -f {} \;

  • Unix command to make list of file name

    Hi Gurus,
    I have seen post how to process multiple file from johngoodwin.blogspot.com.
    But what is the equlivalent command in unix to list all file names.
    I want one text file will contain all text file name and another text file will contain all csv filenames.
    Need some suggestion.Please help.
    Thanks in advance.

    Hi please follow below steps.
    vi yourfilename.sh
    then in edit mode put your command
    then save it by pressing esc : q (escape colon q)
    Now your file will be there. just run that script file in OS Command.But that file should be accessible or else give the full path for that script file.
    Thanks

  • Unix command: remove a dir containing files

    If rmdir deletes an empty directory, which command could I use to remove one containing files?

    iBertus wrote:
    deficite wrote:
    Try just using -r. I do it all the time and never get any errors. Like if I were to delete /:
    rm -r /
    Geez... not sure I'd use that example  :twisted:  :twisted:  :twisted:
    LOL, ditto!

  • Unix command in FTP connection through File Adapter

    Hi All,
    I have a scenario IDOC to file in which the user requested for pushing file to FTP server as below
    put localfilename %localfilename%CITISECUFLATNA%CITIGPASSIN%%B
    Here my file name is test.txt.
    so I tried giving in communial channel as
    File Access Parameters
    Target Directoy      : put test.txt %test.txt%CITISECUFLATNA%CITIGPASSIN%%B
    File Name Scheme: text.txt
    But I go the error in Communication channel as
    An error occurred while connecting to the FTP server 'ftp-gw.dx.deere.com:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 501 Syntax errors in parameter.     usage: %[recipient id]%[APRF]       where either [recipient] or [APRF] can be omitted.            (to change your current default SEND relationship).            %% (places you in your 'HOME' TR).   &['s'|'single'] ('get' command gets single file).   &['m'|'multiple'] ('get' command gets multiple files). '. For details, contact your FTP server vendor
    Please let me know how we can specify in our FTP parameter in Communication chanel.
    Regards,
    Dhill.

    Hi Satish,
      Thank you very much for your help and your time.  But I tried as you told
    Target Directory as : \
    File name scheme : test.txtCITISECUFLATNA%CITIGPASSIN%%B
    and also tried as
    Target Directory as : \
    File name scheme : test.txt<b>%</b>CITISECUFLATNA%CITIGPASSIN%%B
    still i got the same eror....  I am getting success only when I specify like
    Target Directory as : %%
    File name scheme : test.txt
    but the vendor is saying he is not able to see the file anywhere in ftp.
    Regards,
    Dhill

  • Unix command for turning file sharing off

    Is there a Unix command I can use to turn off file sharing on Leopard ( as well as Tiger ) laptops? I don't mean a command to kill it for the session, I need it off even if the system is restarted. Yes, I can do it though the Preferences, but I need to do it to over 200 some laptops. We have ARD and if we had a Unix command to send to turn file sharing off that would be helpful. Thank you.

    There is a CLI for just about everything. From the [OS X Leopard Security Configuration Guide|http://images.apple.com/server/macosx/docs/LeopardSecurity_Config20080530.pdf]:
    To disable FTP.
    launctl unload -w /System/Library/LaunchDaemons/ftp.plist
    To disable SMB.
    defaults delete /Library/Preferences/SystemConfiguration/com.apple.smb.server EnabledServices
    launctl unload -w /System/Library/LaunchDaemons/nmbd.plist
    launctl unload -w /System/Library/LaunchDaemons/smbd.plist
    To disable AFP.
    launctl unload -w /System/Library/LaunchDaemons/com.apple.AppleFileServer.plist

  • How to generate a empty file in AL11 using ABAP and unix command

    Hi Experts,
    when load infopackage triggers it will search file from AL11 if file is available it will get loaded successfully.  When there is no file in AL11 error while opening file (orgin A) and the load will fail.  At this level i have to write a abap code using unix command to generate a empty file.
    Is there any way to achieve the above requirement.
    Thanks
    Vara

    Hi,
    If i get your requirement properly then you want to create a blank file if there is no file on the application server so that your infopackage does not fail, am i correct.
    If this is your requirement then this can be easily done if you use process chain to load the file via infopackage. Follow the following steps:
    1. Add a ABAP program before the infopackage and check if the file is present on the server or not. Use a simple ABAP statement OPEN DATASET <FNAME>. Check the SY-SUBRC after this statement if it is not 0 then it means that the file does not exist on the application server.
    2. Once you have established that the file is not present create a flat file using a code similar to the below one
    OPEN DATASET FILENAME FOR OUTPUT IN TEXT MODE
                          MESSAGE D_MSG_TEXT.
    IF SY-SUBRC NE 0.
      WRITE: 'File cannot be opened. Reason:', D_MSG_TEXT.
      EXIT.
    ENDIF.
    * Transferring Data
    LOOP AT INT_table.
      TRANSFER INT_table-field1 TO FILENAME.
    ENDLOOP.
    * Closing the File
    CLOSE DATASET FILENAME.
    3. Add your infopackage step after this ABAP program in your process chain.
    I hope this helps.
    Best Regards,
    Kush Kashyap

  • Unix command to find certain files

    hello,
    i have a powerbook g4 running leopard... i want to find all files related to a certain program or app. What would the unix command be to find all files related to a certain program or app.
    Also... is there unix commands to find all related preferences or cached items?
    Any help would be great.

    find / -name "*.doc"
    where "*.doc" would find all files ending in .doc
    and / is the root (top most) directory. You may specify a different starting point
    find $HOME -name "*.pdf"
    or even multiple starting directories
    find ~username1 ~username2 ~username3 -name "*.zip"
    You may specify more than one type of file to locate
    find $HOME \( -name "*.dmg" -or -name "*.plist" \)
    You may also want to look at the xargs command, as well as find's "-print0" option and xargs' "-0" option
    find $HOME -name "*.txt" -print0 | xargs -0 grep "magic"

  • Unix Command to Move Folders back into Directory

    As you can see from my previous thread: https://discussions.apple.com/thread/3138884?tstart=0
    I ended up reinstalling Mac OS X 10.6.0 after using "mkdir" and "mv" Unix commands to move my old files to a "previous" folder and I'm still trying to access my account because it's Vile Vault protected. I wish I knew how to move my old folders out from previous into /volumes/macintosh\ HD
    Basically it looks like this right now
    ~/Volumes/Macintosh/HD\ Previous (I'm not even sure if that's written the right way
    I need to move all of the folders out from Previous into ~/Volumes/Macintosh\ HD and deleting the existing ones in it.
    All I want to do is have my old Kernel Panic back because I know how to fix it now.
    Thank you very much!

    Hi Philip
    Philip Han wrote:
    I honestly despise the forum setup... Whenever I wait too long the cursor loses focus so when I hit backspace I go back a page and lose everything I wrote. This has happened to me on 3 different computers now.
    I don't have this problem at all, and I can't make any suggestions on how to fix it.  Maybe you should post a separate thread in the Using the Forums Forum.
    So in the end I went against your advice and moved Applications and Users back to their original folder in HD and I logged in just fine! Well, I did have to boot into single user mode to restore Admin Privileges by creating a new account and then changing Privileges. Some programs didn't start up but it's okay, I know which ones rely on System and whatnot but at least I have nearly everything in its original place and I can back it all up.
    Ahh, you're made of sterner stuff than me !
    Best Buy has $99 1TB WD Passport SE's (The USB 3.0 Version actually!) so I grabbed one immediately and set up Time Machine.
    Sounds like a good choice. 
    Seriously, what other way can you ensure that your data is safe without using File Vault? I use Truecrypt for some things that I don't access much, but daily operations? I'd rather just put up with the sluggish performance of FV!
    I think it depends on what level of security you need. Do you routinely have files that simply must not be read by a third party if your computer gets stolen? 
    FV has always struck me as a hammer to crack a nut, and if something goes wrong you can't even take the disk to a data recovery specialist to get your information back.
    On occasions when I have data that must be kept secure I use Disk Utility to set up an encrypted sparse bundle, which I keep on the desktop. When I need to access files in the bundle then I double click on it and enter the password to mount it.  A minor problem with this is that TM will copy across the whole sparse bundle even if just one file on it is edited. Even so, it's not really a problem since TM is working in the background.
    Thank you for all your help Bob!
    You're most welcome
    Bob

  • Need a unix command

    Hi all,
    I just can't figure this out... I need a unix command that will backup any file matching a specific file extension AND the directory structure those files are in into a separate directory or volume. In other words, let's say that I have the files and directory structure below. I want to backup all of the txt files as separate files (not a tar archive) without writing the img files, without overwriting one txt file with another, and preserving the directory structure.
    foo/bar/a.txt
    foo/bar/b.txt
    foo/bar/a.img
    foo/bar/b.img
    foo/me/a.txt
    foo/me/b.txt
    foo/me/a.img
    foo/me/b.img
    foo/me/you/a.txt
    foo/me/you/b.txt
    foo/me/you/a.img
    foo/me/you/b.img
    I've read the man pages for ditto and rsync... they're geared toward backing up every file in a directory, and so they're not very clear about how to backup one single file type/extension.
    Everytime I try different varients of the rsync command, I either get errors "rsync error: some files could not be transferred (code 23) at /SourceCache/rsync/rsync-24.1/rsync/main.c(717)", or file not found, or it overwrites the 'a.txt' with a different 'a.txt' without preserving the directory structure.
    Can someone give me the exact syntax for backing up the .txt files in the example above to an external disk (e.g. /Volume/backup)???
    Thanks!

    OK... my example was oversimplified. There are tons of different types of files in my directories (*.img, *.gif, *.etc), and I only want to cp one type (e.g., .txt).
    So, I started with the --include flag using the following command:
    rsync -nav --include *.txt foo/ /Volumes/baz/
    the result listed every file in foo (e.g., *.txt, *.img)
    I thought that perhaps the \*.txt should be *.txt
    rsync -nav --include *.txt foo/ /Volumes/baz/
    the result listed every file in foo (e.g., *.txt, *.img)
    rsync -nav --include "*.txt" foo/ /Volumes/baz/
    again, the result listed every file in foo (e.g., *.txt, *.img)
    Clearly, the --include flag wasn't working as I expected it to work. So, I decided to try the --exclude flag:
    rsync -nav --exclude "*.img" foo/ /Volumes/baz/
    Now, the results listed every file in foo except the *.img files.
    I needed to exclude other files as well, so I tried:
    rsync -nav --exclude "*.img *.etc" foo/ /Volumes/baz/
    Now, the results listed every file in foo INCLUDING the *.img files. So, adding additional file types within quotes broke the original command.
    rsync -nav --exclude *.img *.etc foo/ /Volumes/baz/
    Now, I get the error "rsync: link_stat "/Volumes/HD/foo/*.etc" failed: No such file or directory (2)"; and all .etc files are still included
    Now I tried:
    rsync -nav --exclude *.img --exclude *.etc foo/ /Volumes/baz/
    Now, this excluded both *.img and *.etc files. I have about 20 file types other than *.txt ... there has to be some other way!!!
    PowerMac Dual 2.7GHz G5 Mac OS X (10.4.9) 4.5GB RAM

  • Programatically delete Photoshop Temp##### files

    XP Pro
    CS3
    1GB Ram
    Scripting with JavaScipt
    We run photoshop doing batch processes all week long. Is there anyway to include in the javascript batch process a command to delete the temp file that gets built up. I realize they are normally deleted upon proper program termination but that doesn't always happen.
    Since the name appears somewhat with random numbers I am not sure how I could point directly at that, the constant appears to be "Photoshop Temp" but there is also the numbers at the end of that file name to consider.
    or for another consideration (secondary).
    Can I put at the end of the batch command a line of code to close Photoshop? If so what would that be?
    Thank you,
    Jeff

    Yes, I am talking about scratch files.
    Two parts...
    If the Photoshop application is run all week and we process 1GB of files through there it is going to make a huge scratch file correct? That is also why am curious if I can put a line of code at the end of the script to terminate Photoshop which will delete the scratch file.
    As far as workflow goes in our environment the best way is to take the recommendation of "try67" and use the getFiles() function of the currently logged in user and delete that scratch file if Photoshop will allow me to do that while the Photoshop application is still running.
    Concerning the automatic deletion of scratch files...
    I will take a closer look. I just had to go in delete 4 different scratch files on the day I originally posted this thread (3/7/2009).
    I am going to confirm that the installation is up to date.
    Another question which you will probably be able to answer right away. If I (user "A") am bumped out due to an application crash and someone else (user "B") logs in will it still delete the scratch file upon Photoshop launch?
    Thank you very much for your time in reviewing my question and replying.
    Jeff

  • Using UNIX command to copy desktop files/folders

    Hello All. I need help using UNIX command(s) to copy text documents and or folders from my lab computers to my desktop at home. Since I have such a slow connection, I think this will work best. I need help with the cp command and the path mostly. Since all files would be in folders on the desktop (including documents (that "missed" the folders), I believe I could simply copy desktop contents? Thanks, J Langlois

    What you want to do is SCP (secure copy) your documents to your remote host.
    send this command to the computer with the documents
    scp ~/Desktop/FILEOR_FOLDERNAME USERNAME@REMOTE_COMPUTER:~/Desktop/
    Replace all the stuff in UPPERCASE with the correct vales for your situation.
    Mini (Intel Core Duo)   Mac OS X (10.4.8)  

  • Unix Command to search file

    Hi
    Can anyone tell me how to get filename from server using
    UNIX command in ABAP program.I have requirement to search file in server using date criteria.
    should i use 'FIND' command to search file??
    Plz do needful..

    You need to use SM69 to define command and use it in your report.
    Regards,
    Christophe

  • Select a range of files to delete

    How can I select a range of files to delete?  I have ten files I want to delete.  Do I have to select each one individually?

    If it is in Finder and they are listed one after the other in a continuous fashion, select the first file, hold the shift key and select the last file. Then delete.
    If on the Desktop you can choose them by using your mouse pointer to draw a square around them, that will selct all.

  • UNIX command to format or delete all content on Flash Drive

    Need a unix command that will allow me to quickly remove all contents or format a flash drive.
    Computers will be OS X based and I would have to batch process them.
    I'm just looking for the command itself, then my other guys can automate them
    Thanks

    Hi Mihalis,
       The second of your commands has a risk of failure because some of the directories may not be empty when the attempt is made to delete them. The problem isn't that the command won't try to delete all directories. The problem is that it tries to delete higher level directories before the directories they contain. A depth-first search will remedy that problem. Thus, I recommend the following form of the command:
    find -d /Volumes/Flash -type d -exec rmdir {} \;
    or
    find -d /Volumes/Flash -type d -delete
    Gary
    ~~~~
       A straw vote only shows which way the hot air blows.
             -- O'Henry

Maybe you are looking for