[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

open a file after downloading

I am new to redhat 9, what comand line would I use to open a file I just download from the internet or CD??

help
0
jamesccnacmp
Asked:
jamesccnacmp
  • 3
  • 3
1 Solution
 
fixnixCommented:
Depends on the file type.  (Also helps if you know where you saved it ;))

What kind of file is it?
0
 
jamesccnacmpAuthor Commented:
any file !  for example  java or any thing?
0
 
fixnixCommented:
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.

Examples:

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 complicated...you don't just open it up and start typing.), and emacs (even more powerful....it 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).

So...to 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 browser...like "firefox /home/username/filename.js" or something...or you'd use whatever your java vm is.

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

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

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

Does that help you better?


0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
fixnixCommented:
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

http://www.experts-exchange.com/Community_Support/

(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 well...it 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.
0
 
jamesccnacmpAuthor Commented:
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
0
 
jamesccnacmpAuthor Commented:
Oh yes, I all most forgot I was trying to install java on redhat 9.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now