open a file after downloading

Posted on 2005-04-15
Last Modified: 2010-03-18
I am new to redhat 9, what comand line would I use to open a file I just download from the internet or CD??

Question by:jamesccnacmp
    LVL 9

    Accepted Solution

    Depends on the file type.  (Also helps if you know where you saved it ;))

    What kind of file is it?

    Author Comment

    any file !  for example  java or any thing?
    LVL 9

    Expert Comment

    You didn't need to accept an answer already...there is much more to say for your solution, I just needed some more information before getting started :)  Anyway....

    To open files from the command line, you typically need to know what kind of file it is then call the appropriate program on the command line to open it.


    Suppose you downloaded a file called "neatprogram_for_linux.tgz"

    the ".tgz" extension indicates it is a gzipped tar file.  you could open it 2 ways:

    1:  type "gunzip neatprogram_for_linux.tgz" which will uncompress the file and rename it to "neatprogram_for_linux.tar"
         then, to open the .tar file, you would use a line like "tar -xvf neatprogram_for_linux.tar" which will extract the tar archive usually to a subdirectory called "neatprogram_for_linux" and create all the files/subdirectories from there that were part of the tar archive.

    2:  tar can automagically filter the archive through gzip w/ the -z flag, so you could simply do "tar -zxvf neatprogram_for_linux.tgz" which will do all of the above in one step.

    Suppose you wanted to open a file called README that was part of the above example.
    The filename implies it is a text file, so you would usually open it with a text editor.  There are hundreds of text editors available for Linux, and the one(s) you use are a matter of personal preference.  Popular ones are pico (simple for new users but limited in power compared to others), vi or vim (very powerful but more don't just open it up and start typing.), and emacs (even more is so powerful and complicated that it is almost an entire operating system in and of itself!).  Personally, I use vim, which is symlinked from vi on most modern systems (vim stands for "vi improved" and the vanila vi is rarely included in modern linux distros anymore, but for convienience vi is linked to vim so you can still just type "vi" to start it). open README, you would just type "vi README"  (in case you try that and can't figure out how to exit vi, type "<esc>:q" (the escape key ensures you place vi in command mode if it isn't already, the ":" starts the comand, and the "q" is for quit...use "wq" to write and quit, and "q!" to quit without saving changes)

    To run a java program, you might run it with your java-enabled web "firefox /home/username/filename.js" or something...or you'd use whatever your java vm is.

    To run a perl script called "" you'd type "perl ./"

    To run a shell script called "" you would just type "./"

    To view "somepic.jpg" you'd decide what image viewer to open it with and type the appropriate "gimp somepic.jpg" to open it with gimp, "xv somepic.jpg" to open it with xview, etc.

    Does that help you better?

    LVL 9

    Expert Comment

    If you want to reopen the question (thereby possibly getting more input from others) or change the grade now that you have a more complete answer, you can post a request to reopen it at

    (remember to copy/paste the link to this question in the support forum)

    If you want to leave it as is, then that's fine as just seemed odd to me that you accepted a non-answer that quick and I thought it might mave been a mistake.  Either way, welcome to the Linux world.  When I first started using Linux (Slackware 3.0 in 1995 or so I think) it typically took about 2 weeks to figure out things that took 5 minutes to figure out in windows, but by the time I got it working in Linux, I had learned far more than I ever expected...knowledge that may not have been pertinant at the time but came in handy later.  Like anything new, it wil get easier and make more sense the more you use it.

    Author Comment

    a little I would be take some class next month in Unix/linux and that will me alot.
    buton till than I will play with redhat 9 and buy some book to help me out.
    thank you

    Author Comment

    Oh yes, I all most forgot I was trying to install java on redhat 9.

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
    Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now