How to extract files in terminal[solved]

im trying to install themes and when i download the file i need to extract it and unless i switch to root in terminal i dont have permission to extract it to /usr/share/themes. so what code do i need to use tto exract files in terminal?
Last edited by pr0l1f1k (2010-01-21 01:10:45)

Also heres a handy little function that makes it easy to extract files from CLI if you cant remember the cmds. I have it in my /etc/bash.bashrc so it works for all users. Type "extract foo.bar" to extract. You might also need to install unzip,unrar or others.
extract () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
*.tar.gz) tar xvzf $1 ;;
*.tar.xz) tar xvJf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xvf $1 ;;
*.tbz2) tar xvjf $1 ;;
*.tgz) tar xvzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.xz) unxz $1 ;;
*.exe) cabextract $1 ;;
*) echo "\`$1': unrecognized file compression" ;;
esac
else
echo "\`$1' is not a valid file"
fi

Similar Messages

  • How to extract files from external server

    Dear Friends,
    I need to connect to an external non SAP server, from which i need to extract invoice files.
    Invoice files are of two types:
    1. .dat format files which contain invoice data
    2. .PDF or .JPEG documents, which are supporting documents for those invoice.
    My question are
    1. How do i connect to the external server?
    2. Do i have to do a FTP from SAP to that file server?
    3. Do i have to fetch the .dat file using dataset statments?
    4. What are the basis and network related activities involved to get connected to that external server?
    Any inputs and help on this is highly appreciated and rewarded.
    Thanks,
    Simha

    Hi Simha,
    1. How do i connect to the external server?
    Using  FTP or RFC, BAPI are also possible to get the data from Non SAP server.
    2. Do i have to do a FTP from SAP to that file server?
    based on your company policy use FTP to transfer the data.
    3. Do i have to fetch the .dat file using dataset statments?
        yes. if u using ECC6.0 try this method
    CL_RSAN_UT_APPSERV_FILE_READER=>APPSERVER_FILE_READ
    Reward if found helpful.

  • How to extract files for the Solaris jre in Windows env?

    Hi,
    I am trying to figure out how in the world I can get my hands on the lib and bin folders that would be available to me if I was to install the sun 1.5 jre on a solaris sparc machine.
    Obviously I have a windows machine on me and a LACK OF a solaris sparc one. But I happen to need the files that would be installed if I was to carry out the installation with a flavor of the 1.5 jre on a solaris platform.
    Any clues? Help is much appreciated!
    Cheers,
    - Pulkit

    I downloaded and installed CS5.5 design premium on April 30. Just to be sure, I uninstalled , re-extracted and installed cs5.5 again without a problem. The problem seems to be related to the CS6 download.

  • How to extract file with the extension .CAR

    Hi,
    I have a requirement where I need to extract the file .CAR . I have tried with the following command in DOS prompt :-  CAR -xvf <filename>  but I am not able to extract the file.Can you please tell how can I extract this file.What do I need to install to extract it?
    Regards,
    Pawan

    Hi,
    Check these links
    http://www.easymarketplace.de/winzip-7zip.php?Area=4soi
    http://service.sap.com/patches (SMP id required)
    Regards
    Fahad hamsa

  • How to extract files stored in 9ifs to 9i Database Table's BLOB Column

    Dear All,
    I am new for 9ifs. Now my client need to retrieve the files which is stored in 9i Database Table's BLOB Column. Actually the files are stored in 9ifs. Therefore we now want to write a Java program to retrieve the files from 9ifs to 9i Database Table's BLOB Column for my client.
    The Java program will be loaded as Java Procedure to 9i Database. Then the Java Procedure can be triggerred by DML of 9i Database.
    The Questions are:
    1. Can I use CM SDK (9ifs) to retrieve files form 9ifs to 9i Database?
    2. If the files are already stored in 9ifs, Can I use PL/SQL to copy the files from 9ifs to 9i Database?
    3. As the Java Procedure will run frequently, Any problem on 9i Database Java Pool?
    4. Any other advices to implement the above stituation depends on the Client must use the database link to retrieve our 9i Database data?
    Thanks a lot!

    To Get MySql recordset in dreamweaver.
    1. Dreamweaver
    2. File>new>html>create>
    3. File>save>untitle-1.php (make sure to use a php externsion)
    4.Database Panel(Window>Database)
    5.Click Application Tab
    6.Click Plus sign.
    7.click Recordset(query)
    8.Name it anything
    9.Define your connection
    10.Go down to database items
    11. Click Tables
    12. Click the appropriate table
    13. click test
    14.click ok
    To pull image from MySqlDataBase
    1Place cursor on page where you want the image.
    2 insert>Image
    3Select Image Source box appears.
    4Click select file form: Data Source(vs File System)
    5 Your recordset will display
    6 Select the record.
    7 Click ok

  • How to extract extension of  file like (jpeg from c:\prashant.jpeg)

    hi
    please tel me that howa to extract file type  from path of file
    like  c:\prashant.jpeg
    thanks

    use this code....
    PARAMETERS: infile LIKE rlgrap-filename OBLIGATORY.
    DATA: txt1 TYPE char200,
          txt2 TYPE char4.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR infile.
      PERFORM file_browse.
    START-OF-SELECTION.
      SPLIT infile AT '.' INTO txt1 txt2.
      WRITE: txt2.
    *&      Form  FILE_BROWSE
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM file_browse .
      CALL FUNCTION 'F4_FILENAME'
         EXPORTING
           program_name        = syst-cprog
           dynpro_number       = syst-dynnr
    *   FIELD_NAME          = ' '
         IMPORTING
           file_name           = infile.
    ENDFORM.                    " FILE_BROWSE

  • How to extract binary data from a File?

    Hello there!
    Hope I'm right here.
    I have a slight problem with a file containing text- and binary-data. At the beginning of the file is only some text followed by some html-code and at the end is some binary stuff like a pdf oder an image (jpg/gif).
    My problem is now how to split these parts and save them in the suitable format. The text and the html are no problem, but I don't know how to extract the binary data. I tried it out with an Inputstream, but I don't know how to find the exact position where the binary data begins.
    Anyone have an idea how I can solve this?
    Thanks in advance and sorry for my bad english.

    I don't believe a bullet-proof solution exists.
    If you know where the HTML ends, you may skip whitespace and then assume the rest is binary data. Or, if you know the first bytes of the binary data, you may locate those. With either of these solutions, though, you risk coming across a file where it doesn't work as expected, for example if the first byte of the binary data happens to match a whitespace character.

  • How to extract single file from multipart zip archives?

    Hello,
    I have a 10 parts of zip files that contains single file. When I extracted these, each program taking an action seperatly to each parts and gave me 10 files in a different folders. In a Windows, it is so simple. Winzip,winrar automaticaly discovering that are the parts of a single file and give me that.
    My question is simple: How to extract single file from a multipart zip/rar archives ?
    I know a way in "Terminal" but it is not comfortable for big parts.

    I tried with UnArchiver but it extracted each file seperately like showen in a photo

  • How to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    how to extract the audio of a zip file? if it helps I'm trying to add this album zip to my library

    Let's say you have a zipped audio collection (audio.zip) containing mp3 files. And you are at a Terminal prompt.
    List the files in the zip archive
    unzip -l audio.zip (that is ell)
    Extract all mp3 audio files into a new home directory folder called mymusic
    unzip -d ~/mymusic audio.zip \*.mp3
    Variations of the above will depend the zip contents, and internal structure. If the zipped audio collection was gzipped, or someone used rar on it, then the extraction process will be different.

  • Open Hub: How-to doc "How to Extract data with Open Hub to a Logical File"

    Hi all,
    We are using open hub to download transaction files from infocubes to application server, and would like to have filename which is dynamic based period and year, i.e. period and year of the transaction data to be downloaded. 
    I understand we could use logical file for this purpose.  However we are not sure how to have the period and year to be dynamically derived in filename.
    I have read in sdn a number of posted messages on a similar topic and many have suggested a 'How-to' paper titled "How to Extract data with Open Hub to a Logical Filename".  However i could not seem to be able to get document from the link given. 
    Just wonder if anyone has the correct or latest link to the document, or would appreciate if you could share the document with all in sdn if you have a copy.
    Many thanks and best regards,
    Victoria

    Hi,
    After creating open hub press F1 in Application server file name text box from the help window there u Click on Maintain 'Client independent file names and file paths'  then u will be taken to the Implementation guide screen > click on Cross client maintanance of file name > create a logical file path by clicking on new entiries > after creating logical file path now go to Logical file name definition there give your Logical file , name , physical file (ur file name followed by month or year what ever is applicable (press f1 for more info)) , data format (ASC) , application area (BW) and logical path (choose from F4 selection which u have created first), now goto Assignment of  physical path to logical path > give syntax group >physical path is the path u gave at logical file name definition.
    however we have created a logical path file name to identify the file by sys date but ur requirement seems to be of dynamic date of tranaction data...may u can achieve this by creating a variable. U can see the help from F1 that would be of much help to u. All the above steps i have explained will help u create a dynamic logical file.
    hope this helps u to some extent.
    Regards

  • How to extract text from a PDF file?

    Hello Suners,
    i need to know how to extract text from a pdf file?
    does anyone know what is the character encoding in pdf file, when i use an input stream to read the file it gives encrypted characters not the original text in the file.
    is there any procedures i should do while reading a pdf file,
    File f=new File("D:/File.pdf");
                   FileReader fr=new FileReader(f);
                   BufferedReader br=new BufferedReader(fr);
                   String s=br.readLine();any help will be deeply appreciated.

    jverd wrote:
    First, you set i once, and then loop without ever changing it. So your loop body will execute either 0 times or infinitely many times, writing the same byte every time. Actually, maybe it'll execute once and then throw an ArrayIndexOutOfBoundsException. That's basic java looping, and you're going to need a firm grip on that before you try to do anything as advanced as PDF reading. the case.oops you are absolutely right that was a silly mistake to forget that,
    Second, what do the docs for getPageContent say? Do they say that it simply gives you the text on the page as if the thing were a simple text doc? I'd be surprised if that's the case.getPageContent return array of bytes so the question will be:
    how to get text from this array? i was thinking of :
        private void jButton1_actionPerformed(ActionEvent e) {
            PdfReader read;
            StringBuffer buff=new StringBuffer();
            try {
                read = new PdfReader("d:/getjobid2727.pdf");
                read.getMetaData();
                byte[] data=read.getPageContent(1);
                int i=0;
                while(i>-1){ 
                    buff.append(data);
    i++;
    String str=buff.toString();
    FileOutputStream fos = new FileOutputStream("D:/test.txt");
    Writer out = new OutputStreamWriter(fos, "UTF8");
    out.write(str);
    out.close();
    read.close();
    } catch (Exception f) {
    f.printStackTrace();
    "D:/test.txt"  hasn't been created!! when i ran the program,
    is my steps right?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to extract text from a PDF file using php?

    How to extract text from a PDF file using php?
    thanks
    fabio

    > Do you know of any other way this can be done?
    There are many ways. But this out of scope of this forum. You can try this forum: http://forum.planetpdf.com/

  • How to extract the contents of ZIP file stored in oracle database column ?

    The file is in ZIP format and it is stored in BLOB databse column . The contents of file is in binary format .
    How to extract those contents from file and thus creating the same ZIP file as output in ODI ?
    Thanks
    Arun

    Perhaps you can something like what is described in the support note "How To Load A PDF File Or Other Binary Files To a BLOB Column From ODI (Doc ID 1412753.1)"

  • JDBC-XI-FILE scenario. How to extract data from more than one table in JDBC

    Hi,
    I was asked a question like in JDBC-XI-FILE scenario........ How to extract data from more than one tables (i.e from JDBC system) ?? What is the logic to do the same ??
    I am not sure whether this is a valid question..........but any help in this regards is highly appreciated.
    Regards
    Kumar

    HI,
    Yes it can be possible ,please see the following links
    JDBC  Receiver with Oracle Stored Procedures
    configuring jdbc adapter with multiple tables
    RFC -> XI -> JDBC Scenario Updating Multiple Tables
    /people/alessandro.berta/blog/2005/10/04/save-time-with-generalized-jdbc-datatypes
    JDBC Adapter multiple Selects
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=jdbc%20with%20multiple%20tables&cat=sdn_all
    Regards
    Chilla..

  • How to Extract the Highlight Text in PDF File

    Hi Scripters,
    i want know, how to extract the hightlight text in pdf files for text only format for (*.txt) file extension save.
    regards
    baby

    Hi,
    Okay i'll try do best.
    thanks for your reply.
    Regards
    Baby

Maybe you are looking for