Re: essential basic command

From: Lew Pitcher (Lew.Pitcher_at_td.com)
Date: 10/11/05


Date: Tue, 11 Oct 2005 10:34:19 -0400


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hendrik Maryns wrote:
> Shadus schreef:
>
>> On 2005-10-11, Lorne Bradley <ltbradley@rogers.com> blabbed:
>>
>>> Hi, As an old Windows user, I have the most basic command line question.
>>> How do you RUN a program and and open a file?
[snip]
>> In notepad you [ALT]FO to open a file.
[snip]
> To answer
> that question, you have to know what kind of file it is, and with which
> program it should be opened. Then you invoke this program with the file
> as an argument. For example to open example.pdf:
>
> acroread example.pdf
>
> or something.unknown_extension but you think it is a text file:

To determine what sort of data is contained in the file, use the file(1)
command ("man 1 file")

  pitchl@srdscs05:~/Documentation/PDF Files$ file bourne_shell.pdf
  bourne_shell.pdf: PDF document, version 1.2

  pitchl@srdscs05:~/download/fl$ file flowchart.tar.gz
  flowchart.tar.gz: gzip compressed data, from Unix

  pitchl@srdscs05:~/www$ file login.php
  login.php: PHP script text

  pitchl@srdscs05:~/www$ file index.html
  index.html: HTML document text

  pitchl@srdscs05:~/images$ file CLOUD.GIF
  CLOUD.GIF: GIF image data, version 89a, 75 x 60

- From there, choose the application you want to use to manipulate the
file. For the Windows user, here's a hint: there is more than one
program that can "open" the file ("open" in the MSWindows sense of
natively manipulate the contents of the file); you have to select which
program is apropos for your use.

  pitchl@srdscs05:~/images$ apropos gif
  Data::Dumper (3) - stringified perl data structures, suitable
                              for both printing and eval
  argz_stringify [argz_add] (3) - functions to handle an argz list
  gif2tiff (1) - create a TIFF file from a GIF87 format
                              image file
  giftopnm (1) - convert a GIF file into a portable anymap
  ppmtogif (1) - convert a portable pixmap into a GIF file

  pitchl@srdscs05:~/images$ apropos html
  CGI::Pretty (3) - module to produce nicely formatted HTML
                              code
  Pod::Html (3) - module to convert pod files to HTML
  enscript (1) - convert text files to PostScript, HTML,
                              RTF, ANSI, and overstrikes
  grohtml (1) - html driver for groff
  man2html (1) - format a manual page in html
  pod2html (1) - convert .pod files to .html files
  xfhelp (1) - lauches an HTML browser to display online
                              documentation for The Cholesterol Free
                              Desktop Environment

You can use the apropos(1) command ("man 1 apropos") to query the help
file ("man pages") for tools (commands, files, modules, etc.) that have
something to do with a specific keyword. In the case of commands, you
want those entries that come from section 1 ( "(1)" ) or section 8 (
"(8)" ) of the man pages.

- --

Lew Pitcher, IT Specialist, Enterprise Data Systems
Enterprise Technology Solutions, TD Bank Financial Group

(Opinions expressed here are my own, not my employer's)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (MingW32)

iD8DBQFDS81ragVFX4UWr64RAuGWAKCGkAJwimfShlqXl+kDrM75UzFhUACdGUAe
5IpPtjcyFyMZlqD6fzwxFSM=
=Qv/H
-----END PGP SIGNATURE-----



Relevant Pages

  • Re: Great SWT Program
    ... to unite temporarily against their common enemy -- me? ... the manual to write a shell script, oops, .bat file. ... (It lists all commands whose ...
    (comp.lang.java.programmer)
  • Re: First Law of Intelligence and the Big Bang
    ... You recoginze that "changes of direction" are due to commands if the ... Commanded activity would produce the kind of system that humans ... "intelligently designed artifacts look like intelligently designed ...
    (talk.origins)
  • [SLE] (Revisited) Works in Windoze, NOT in SuSE!?!?!?!?!?!?
    ... I'd guess Windows does stuff with the modem to prevent the ... windoze exactly, added additional AT commands to allow flex in line noise, ...
    (SuSE)
  • 5.1 -> 5.2 disaster
    ... this is not a hardware problem! ... spot over and over on multiple different commands. ... The contents of the transmission may also be subject to ...
    (freebsd-questions)
  • Re: Absolute path in argv[0]
    ... manpage and find out why), so there's no necessity to "solve" it. ... The only necessity comes from your inability to code to the platform, ... Lew Pitcher, IT Consultant, Enterprise Data Systems ...
    (comp.os.linux.misc)