command line work
Johnny Rosenberg
gurus.knugum at gmail.com
Thu Oct 9 16:05:58 UTC 2008
2008/10/9 NoOp <glgxg at sbcglobal.net>
> On 10/05/2008 08:49 AM, David Clark wrote:
> > I am now comfortable enough with Ubuntu that I want to venture out of the
> > GUI. I come from a command line background-back to DOS 4 (yuck)
> >
> > So where do I begin?
>
You got good answers already, here is more:
In the terminal, a few commands would probably make it easier to find other
commands…
The help command is called "man" in Unix (and Linux of course).
man intro
could be a strart.
Most commands have options, which begins with one or two "-" (minus). You
don't need one minus for each option. The following are possible:
ls -laB
(rather than ls -l -a -B)
"ls" is the command for listing directories, by the way. "DIR" in DOS.
Some options are words, then you need two minuses:
cp --recursive /my/stuff /my/backup/place/
"cp" means "copy".
Some options can be written in more than one way. The above is the same as
cp -r /my/stuff /my/backup/place/
and
cp -R /my/stuff /my/backup/place/
man -k copy
The "k" stands for "keyword", so the command above gives you a list with
short descriptions of commands in which descriptions the word "copy" is
mentioned.
Capital letters are different from small letters.
CP -r /my/stuff /my/backup/place/
won't work.
Some characters are good to know about, like the pipe character which lets
you send the output of one command as the input of another command:
ls -laB /my/directory/with/hundred/of/files | more
Note that we use / and not \ in Unix, but I guess that have been obvious for
you, since you can see this in the GUI too. Anyway, first we list a lot of
files, but the output is sent to the command "more" instead of the standard
output. "more" makes sure that the output stops so you can see the
information page by page (hit space for next page). There is also a similar
command called "less" which many people prefer. It's more advanced than
"more" I think, I don't know.
To redirect you can use the ">" character:
cp -r /my/stuff /my/backup/place/ > /my/path/my_listing
">>" adds to an existing file.
In many cases you don't need a file suffix. If you create a text file and
call it "MyFile", it will still be opened with your preferred text editor
when clicking it. I even tried to rename a jpg to png, Worked perfectly.
You can use the "<" if you want to give a command instructions from a file
rather than from the keyboard. Something like this:
grep search-word < /my/path/MyFile2
grep search-word < /my/path/MyFile2 > /my/path/MyFile3
Well, there's a lot more of course. Google is a good help for finding more,
as usual.
J.R.
>
>
> https://help.ubuntu.com/8.04/advanced-topics/C/index.html
> https://help.ubuntu.com/8.04/basic-commands/C/
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20081009/b7a8affd/attachment.html>
More information about the ubuntu-users
mailing list