How To ZIP floder in LINUX

Hi All,
please any one let me the command for zip the folder in Linux.That folder having many sub folders.i need to zip all folder as a single rar.

ZIP and RAR are competitive products and use different compression tools and formats. RAR is not installed by default in any Linux distribution and you need to install it. While tools to extract RAR are free, creating RAR is usually not. Availability and installation depends on your Linux system, which requires that you provide information about your system in order to answer your question. ZIP is free, a common standard and available for any computer system.
You can create a zip archive using the following command:
zip -9r archive.zip directory_or_fileStandard under Linux and Unix systems is usually TAR and GZIP. For instance:
tar -zcvf archive.tgz directory_or_file

Similar Messages

  • How to zip the folder in application server?

    how to zip the folder in application server?

    You can use
    open dataset with filter
    link:[http://help.sap.com/abapdocu_70/en/ABAPOPEN_DATASET_OS_ADDITION.htm#!ABAP_ADDITION_2@2@]

  • How to zip a text file and send as email attachment in SAP version 4.6c?

    Hi Guru,
    How to zip a text file in SAP version 4.6c which doesn't have class CL_ABAP_ZIP?
    Please help.
    Thanks & Regards,
    Ari

    Hi,
    Try this link
    [http://sap.ittoolbox.com/groups/technical-functional/sap-dev/sapr3dev-zip-file-from-sap-1707099?cv=expanded]
    Cheers,
    Surinder

  • How to embed mplayer in Linux with JNI

    Hello All,
    I was wondering if anyone here knows to get a Linux based video player to draw on the awt Canvas. I am trying to play the streaming video in ASX / WMV format on Linux. And MPlayer is one such player that can play almost anything.
    For windows, there are a few options to embed the native media player and I am thinking of going with jawin as it hides most of the native implementation. But I have not much idea about how to do it in Linux. Couldn't find many examples / guides either.
    If someone has an idea / links and would like to share it, it'll be highly appreciated.
    Thanks in advance,
    Rex

    I could advance a little more and got the JNI library to draw on the awt Canvas. But still can't get another native program like gedit to draw on the Canvas.
    This is what I am doing to draw the rectangles (from Sun's example) -
    gc = XCreateGC(dsi_x11->display, dsi_x11->drawable, 0, 0);
    XSetBackground(dsi_x11->display, gc, 0);
    for (i=0; i<36;i++)
    XSetForeground(dsi_x11->display, gc, 10*i);
    XFillRectangle(dsi_x11->display, dsi_x11->drawable, gc,
    10*i, 5, 90, 90);
    XSetForeground(dsi_x11->display, gc, 155);
    XDrawImageString(dsi_x11->display, dsi_x11->drawable, gc,
    100, 110, testString, strlen(testString));
    But how do I pass the handle 'gc' to another program like gedit to draw on this surface instead of opening it's own window ? It'll be a great help if someone could share an idea on this.
    Thanks,
    Rex

  • How to zip multi files into one zip file in ABAP

    hi all:
    As you know, ABAP has CL_ABAP_GZIP class to support zip file function. But it only support one file zip. If I want to zip two files into one zip file, how to do it?
    thanks.

    Hi,
    <li>If you know how to zip one file,  to zip two files , you can follow the below steps.
    DATA:g_zipper     TYPE REF TO cl_abap_zip.
    "create our zipper object
    CREATE OBJECT g_zipper.
    "add 1st file to zip
    CALL METHOD g_zipper->add
       EXPORTING
         name    = file_name
         content = content_x.
      "add 2nd file to zip
    CALL METHOD g_zipper->add
       EXPORTING
         name    = file_name
         content = content_y.
    "save zip
    CALL METHOD g_zipper->save
       RECEIVING
         zip = zip.
    Thanks
    Venkat.O

  • How to zip a whole catalog with Java?

    can you tell me how to zip a whole catalog?
    i am not able to find a method that can zip a whole catalog and the files in it.
    please help me,thanks

    The following program is an extension of the code posted at:
    http://forum.java.sun.com/thread.jsp?forum=31&thread=48084
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream ;
    import java.util.zip.CRC32;
    import java.util.zip.ZipEntry;
    import java.util.zip.ZipOutputStream;
    import java.util.Date;
    public class NZipCompresser {
       private String m_basePath=null;
       private File m_dir = null;
       private String m_OutputFileName;
       public static void main(String[] args) {
          File directory=new File(args[0]);
          new NZipCompresser(directory, args[1]);
       public NZipCompresser() {
       // This class gets directory and compress it reqursivelyinto zip file named outputFileName
       public NZipCompresser(File directory,String outputFileName) {
          m_dir = directory;
          m_OutputFileName = outputFileName;
          try {
             compress();
          } catch (Throwable e) {}
       public void compress () throws Exception {
          try {
             FileOutputStream zipFilename = new FileOutputStream(m_OutputFileName) ;
             ZipOutputStream zipoutputstream = new ZipOutputStream (zipFilename);
             m_basePath = m_dir.getPath();
             CompressDir (m_dir,zipoutputstream);
             zipoutputstream.setMethod(ZipOutputStream.DEFLATED);
             zipoutputstream.close();
          catch (Exception e) {
             throw new Exception ("Something wrong in compresser: " + e);
       public void setDirectory (File dir) {
          m_dir = dir;
       public void setOutputFileName (String FileName) {
          m_OutputFileName = FileName;
       public File getDirectory () {
          return m_dir;
       public String getOutputFileName () {
          return m_OutputFileName;
       //Walker through directory structure
       private void CompressDir (File f, ZipOutputStream zipoutputstream) {
          System.out.println(f);
          if (f.isDirectory()) {
             File [] files = f.listFiles();
             for (int j=0;j<files.length;j++) {
                if (files[j].isDirectory()) {
                   System.out.println("calling CompressOneDir with:"+files[j].getPath());
                   CompressDir (files[j],zipoutputstream);
                if (files[j].isFile()) {
                   System.out.println("adding file:" +  files[j].getPath());
                   addOneFile(files[j],zipoutputstream);
          System.out.println("exiting:"+f);
       //Actualy compress the file
       private void addOneFile (File file, ZipOutputStream zipoutputstream) {
          ZipEntry zipentry = new ZipEntry(file.getPath().substring(m_basePath.length()+1));
          FileInputStream fileinputstream;
          CRC32 crc32 = new CRC32();
          byte [] rgb = new byte [1024];
          int n;
          //Compute CRC of input stream
          try {
             fileinputstream = new FileInputStream(file);
             while ((n = fileinputstream.read(rgb)) > -1) {
                crc32.update(rgb, 0, n);
             fileinputstream.close();
          catch (Exception e) {
             System.out.println("Error in computing CRC:");
             e.printStackTrace();
          //Set Up Zip Entry
          zipentry.setSize(file.length());
          zipentry.setTime(file.lastModified());
          zipentry.setCrc(crc32.getValue());
          //Write Data
          try {
             zipoutputstream.putNextEntry(zipentry);
             fileinputstream = new FileInputStream(file);
             while ((n = fileinputstream.read(rgb)) > -1) {
                zipoutputstream.write(rgb, 0, n);
             fileinputstream.close();
             zipoutputstream.closeEntry();
          catch (Exception ex) {
             System.out.println("Error in writing data:");
             ex.printStackTrace();
    }Compile this program and run it as follows:
    java NZipCompresser directory_name zipOutput_name
    Is this what you're looking for?
    V.V.

  • How to Zip server files(in a directory) and throwing back to client

    Can someone tell me how to zip all the files in a particular directory of my web application and throwing back to client to give option for save that zipped file.
    i have used the below used function to zip in servlet. But I cann't zip a particular directory of my application in server.
    Please help
    private void zipDir(String dir2zip, ZipOutputStream zos)
    try
    //create a new File object based on the directory we
    // have to zip File
    File fileDir2Zip = new File(dir2zip);
    System.out.println("is directory ..."+fileDir2Zip.isDirectory());
    //get a listing of the directory content
    String[] dirList = fileDir2Zip.list();
    for(int i = 0 ; i < dirList.length ; i++)
    System.out.println("Dir list ..."+dirList);
    byte[] readBuffer = new byte[2156];
    int bytesIn = 0;
    //loop through dirList, and zip the files
    for(int i=0; i<dirList.length; i++)
    File f = new File(fileDir2Zip, dirList[i]);
    if(f.isDirectory())
    //if the File object is a directory, call this
    //function again to add its content recursively
    String filePath = f.getPath();
    zipDir(filePath, zos);
    //loop again
    continue;
    //if we reached here, the File object f was not
    //a directory
    //create a FileInputStream on top of f
    FileInputStream fis = new FileInputStream(f);
    //create a new zip entry
    ZipEntry anEntry = new ZipEntry(f.getPath());
    //place the zip entry in the ZipOutputStream object
    zos.putNextEntry(anEntry);
    //now write the content of the file to the ZipOutputStream
    while((bytesIn = fis.read(readBuffer)) != -1)
    zos.write(readBuffer, 0, bytesIn);
    System.out.println("Last");
    //close the Stream
    fis.close();
    catch(Exception e)
    e.printStackTrace();

    Hi
    Whatever file exist in directory should execute with out any condition because they delete all files after exection of my process chain. They are using another process chain once a day for deletion of all files in that directory.
    So directory always contains fresh files.
    Here by using routine in infopackge i am unable to run all files one by one at a time.
    As of my knowledge  by using infopackage we can run only one file at a time.
    Here my question is , can we run more than one file in single run of infopackage?
    or can we have any function module to run the infopackage from externally? so that i can use function module in abap program? any ideas..
    Regards
    Raju

  • How to Zip Excel files using File Adapter?

    Hi,
    We have tried to ZIP the Excel file with  PayloadZipBean in File adapter. But we faced some issue while zipping.
    We have seen some zunk data in excel file after zipping with PayloadZipBean. Someone please help how to zip Excel files in PI with File Adapter.
    Regards,
    Sreeramulu Konjeti.

    Hi Sree,
    If you are facing any issue with PayloadZipBean then you can use java mapping to Zip the files.
    Please find the complete Java mapping code to zipt the file
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/50ce0433-4309-2b10-4bb4-d421e78463f7?quicklink=index&overridelayout=true

  • How to ZIP a PDF File with a Password Protection

    Hi,
    i've a pdf file with created smartforms and i want to assign a password to that pdf file but the SAP doesn't let doing that protection. So i want to create a zip file with a password protection for PDF file.
    How can i create a zip file with a password protection? Can somebody help me please?
    Thanks.

    Hello,
    Check this links
    Take a look to the class CL_ABAP_GZIP
    open (top-)zip-archive
    CALL METHOD lo_zip->load
        EXPORTING
          zip             = lv_zip_file_head
        EXCEPTIONS
          zip_parse_error = 1
          OTHERS          = 2.
    create sub-zip-archives which contain the files you would assign to a folder
    add sub-zip-archive to top-zip-archive
    CALL METHOD lo_zip->add
         EXPORTING
            name    = lv_zip_filename
            content = lv_zip_file.
    save zip-archive
    CALL METHOD lo_zip->save
        RECEIVING
          zip = ev_zip_file.
    ABAP Development
    How to ZIP a PDF file email attachment
    Re: How to ZIP a PDF file email attachment

  • How to Create NFS in Linux

    Hi all,
    I am very much new to Linux Admin, i am basically working as a apps dba, i have two servers, i installed Oracle Linux on that, now i want to create NFS file system, i have created u01 mount pioint in Linux1 and u01 in linux 2 with same space , i am able to ping both servers and i am able to do ftp both servers, could any one explain me how to create NFS in linux servers,
    Thanks

    On the server, edit the file <tt>/etc/exports</tt> to list the directories you
    want NFS to offer, and to which systems they should be offered:
    /u01    *(rw,sync,no_root_squash)
    /u02    *(rw,sync,no_root_squash)
    /u03    *(rw,sync,no_root_squash)The <tt>*</tt> matches any system/network and the <tt>(rw)</tt> says let the
    other systems read and write the tree, the <tt>sync</tt> forces the server NFS
    to finish the I/O before telling the clients the I/O is done, and the optional
    <tt>no_root_squash</tt> lets root on a client system access the files as if
    they were root on the NFS server; this may not be what you want.
    # /sbin/chkconfig nfs on
    # /sbin/service nfs startOn the NFS client, edit the <tt>/etc/fstab</tt> file to have lines that look
    like this:
    myserver:/u01 /u01 nfs rw,rsize=32768,wsize=32768,sync,nointr,hard 0 0
    myserver:/u02 /u02 nfs rw,rsize=32768,wsize=32768,sync,nointr,hard 0 0
    myserver:/u03 /u03 nfs rw,rsize=32768,wsize=32768,sync,nointr,hard 0 0and then from the client make sure you can see the offered files:
    # /usr/sbin/showmount -e myserverand if you can, do this on the client:
    # mkdir /u01 /u02 /u03
    # mount /u01
    # mount /u02
    # mount /u03If the clients ever reboot, the NFS files will be mounted automatically and you
    will not need these last 3 commands.
    The RDBMS has its own requirements for the options in the <tt>/etc/fstab</tt>
    entry, so the <tt>rw,rsize=...</tt> example may need to be adjusted a little.
    Happy NFS'ing.

  • How to zip one file i have on disk with java.util.zip

    I don't know how to zip a file. I managed to do new html file, but i don't know how to zip it.
    This is my code:
    PrintWriter pw = new PrintWriter (new FileWriter(export), true);
    Thanks!

    heres a zipper class i wrote which i have butchered a bit to make more generic (its basic and at present only takes one zipentry etc, but very simple and should be easy to extend etc) Just pass it your file in its constructor and then call its zipme method. PS if it can be made better let me know so i can update my class, cheers.
    import java.io.*;
    import java.util.zip.*;
    import java.awt.*;
    class zipper
         public File file;
         public zipper(File f)
              file = new File(f);
         public void zipme()
              try
                   FileInputStream fin = new FileInputStream(file);
                   int a = (int)file.length();
                   byte b[] = new byte[a];
                   fin.read(b);
                   ZipEntry k = new ZipEntry(fin.getName());//represents a single file in a zip archive!
                   File newFile = new File("D:\\AZipFile.zip");
                   ZipOutputStream zi = new ZipOutputStream(new FileOutputStream(newFile));
                   zi.putNextEntry(k);
                   zi.write(b,0,a);
                   zi.close();
                   fin.close();
              catch(FileNotFoundException e)
                   //System.out.println("ERROR File not found");
              catch(IOException ee)
                   //System.out.println("ERROR IO exception in Zipping file");
    }

  • How to use jdeveloper with linux?

    how to use jdeveloper with linux?
    Hello, i've download jdeveloper, and i have java1.4 installed. But i can't run jdeveloper i have jdev.exe and jdev but when i put /usr/local/jdev/bin/jdev a have a message like file not found. I don't know what to do.
    Help please!!!
    Ori.

    You need to go to the directory where you unzipped JDeveloper, for example:
    cd opt/jdev/jdevj2eebase1013/jdev/bin
    Once there, do this:
    chmod +x jdev
    chmod +x ojc
    Now you can try this:
    nohup ./jdev &
    or simply
    ./jev
    I usually create a soft link in ~/bin

  • How to zip report output and send via mail from application

    Hello,
    I want to know how to zip the report output and send it by mail to concerned person from application
    I want this as the report is having more than 70000s of records.
    Also the XLS has the limitation of 2^16 records and the report is having more than this
    Any help is very much appreciated
    Regards,
    Vani

    1: Make a Dummy report. From some post parameter form trigger, run your original report with "srw.runreport" call. The original report can generate output to a file.
    2: Then withing this dummy report run, call a user exit to zip the
    original reports output. You need to write this user exit and attach them
    with reports.
    3: Now use Report 9i distribution for this dummy report to sent this external zip file through mail.
    With Regards
    Reports Team

  • How to open Designer in Linux environment.

    I have installed Business Objects XI 3.1 on Linux 5.
    Now I want to create Universe and Desktop Intelligence Reports.
    1.     How do I open Designer. In windows we can open it from Program file. How to do it in Linux environment.
    2.     Do we need to install client component on Windows and then connect it to Linux Bo server.
    --Kuldeep

    Kuldeep,
    You misunderstood.
    The client tools are Windows only. The server portion of the install can be on Windows/*nix.
    The only way to launch Designer, Deski, Import Wizard etc. is from a Windows machine that can login to the CMS on *nix.
    You cannot launch client tools from *nix.
    Best,
    Srinivas

  • How to run .jar on linux & how to create .jar file using java?

    hi, may i know how to run .jar on linux & how to create .jar file using java? Can u provide the steps on doing it.
    thanks in advance.

    Look at the manual page for jar:
    # man jar
    Also you can run them by doing:
    # java -jar Prog.jar

Maybe you are looking for