DOS User Study UNIX Guide [1] - File Maintenance

xiaoxiao2021-03-06  41

Section 1: Archive maintenance

1.1. Archive: Preface

Linux has a file system - meaning "a structure with many files and directories"

- and DOS very

Similar. The file has a name (file name, and its composition must follow some rules), placed in the directory.

Some are executable programs, they must have some extra parameters to be executed correctly. In addition, you can make

use

"Wild Card" (Wild Card), Output / Inlet, Piping. But, and

DOS is still different.

- - First: Under DOS, the file must abide by the rules of the 8.3 format.

Notenoug.txt.

We have a relatively free space in Linux. If your Linux is already installed

EXT2 or UMSDOS, etc.

On the archive system, you can use long-term names to name the file, which makes the file containing more characters and

"Point". For example, this_is.a.very_long.filename. Please note that I have used uppercase and lowercase letters.

And in fact ...

- - Second: Size is different. Therefore, filename.tar.gz and

Filename.tar.gz is two

The same archive. This rule is also established in the command: when using the LS

(Similar to DOS DIR)

Will get a list of the cases in the directory, but with LS, the system will only give you a wrong message.

- - Third: The file name starting with "." Will be considered hidden files. For example:

.I.am.a.hidden.file,

Can't see it when using LS (PS. You can see hidden files) with ls -a)

- - Fourth: Linux does not specify that the executable must have .com, .exe or

. Bat extension. Such as

If we use the LS -F command, you will find that the executive will be plus one.

'*'. E.g:

$ ls -f

Letter_to_joe cindy.jpg CJPG * i_AM_A_DIR /

MY_1ST_Script *

CJPG *, my_1st_script * is can be executed. In DOS, .bak indicates a backup file, and

Linux

Then add one '~' at the end of the file.

- - Fifth: The parameters required by the DOS program should be given by / switch.

Linux is using -switch.

Just like Dir / s and LS -R. Note, some of the programs under DOS such as PKZIP and

ARJ, uses and un * x

The same parameter given.

1.2. Archive: Corresponding to DOS and Linux related instructions

The left is a command command; on the right is the same functionality in Linux.

COPY: CP

Del: rm

REN: MV

TYPE: more, Less, Cat

Redirection and plumbing operations: <> >> |

Wildcards: *?

NUL: / dev / null

PRN, LST: / DEV / LP0; LPR

- - EXAMPLES -

Dos Linux

C: / Guido> Copy Joe.txt Joe.doc $ CP Joe.txt

Joe.doc

C: / Guido> Copy *. * Total $ CAT *> Total

C: / Guido> Copy Fractals.doc PRN $ CAT FractALS.DOC

| LPR

C: / Guido> DEL TEMP $ RM TEMP

C: / Guido> Del * .bak $ rm * ~ c: / guido> REN Paper.txt paper.asc $ mv paper.txt

Paper.asc

C: / Guido> Type Letter.txt $ more letter.txt

C: / Guido> Type Letter.txt $ Less Letter.txt

C: / Guido> Type Letter.txt> Nul $ CAT Letter.txt

> / dev / null

N / A $ more * .txt * .asc

N / a $ cat section * .txt

Note:

1) * Be smart in linux:

- - * indicates all files outside the thrush; * indicates all hidden files; *. * Is "some character"

A point "some character" archive name;

- - p * r can meet the words of Peter and Piper; Picked and PECK can also be form

* C *;

2) When using more this command, press to continue reading the next page,

'q' or Ctrl-C end.

LESS and MORE are similar, but the arrow keys are available.

3) Linux * There is no * undelete this command. So, think twice before cutting out the file ..

4) In addition to <> >> in DOS, Linux can use 2> to the error message orientation.

(stderr)

5) Linux has another group of universal character: []. Use:

- - [ABC] * Indicates files starting with A, B, or C;

- - [i-n] * represents a file starting by I, J, K, L, M, or N;

6) There is no rename like DOS; that is, ren * .xxx

* .yy is invalid.

1.3. Executive: Multi-worker and session

To perform a program, you can use the name like DOS. If this program is put

Path

(Section 4) The specified directory (second section), then the program will be started. Exception is,

Linux is not like DOS

You can perform program (.) Placed in the current directory (unless you have added PATH. To perform the current

The program in the directory can do this: ./ .

This is a standard command format:

$ comMMAND -S1 -S2 ... -SN PAR1 PAR2 ... PARN Output

-s1, -s2 ... -sn is the command option, PARN is a program parameter. We can type a number of commands on the same line

:

$ comMand1; command2; ...; commandn

This is the way to execute the command, but we can further. One makes us use

Main cause of Linux

Yes, it is a multi-worker system - it can execute several rules simultaneously (hereinafter, 'program' is replaced by 'stroke'

You can upgrade a trip to background to the foreground and continue. And linux can make you

Multiple sessions: This is like a few computers at the same time!

- - Switch session 1..8:

$ ... .

- - Start a new session, but don't leave the original session:

$ su -

E.g:

$ su - root

This is quite useful. For example, when you want a mount (machine). Because only root can make this matter.

- - End a session:

$ EXIT

- - Perform a stroke in the foreground:

$ propename [-switches] [parameters] [ Output]

- - Start a stroke on the background (executive on background) To add '&' this symbol:

$ propename [-switches] [parameters] [ Output] &

- - View how much it is being executed:

$ PS

This will list a table. Every stroke will have a PID to identify (a number).

- - Kill a itinerary:

$ KILL

Sometimes you must use this method to end some itinerary (when you don't know how to end correctly :) a trip or

Xu

To end with the following method:

$ KILL-15

$ KILL-9

In addition, shell (something like Command.com) allows you to suspend the execution of a trip, or put the prospects

Change to the background execution, background in the foreground. We use 'work' to call the itinerary.

- - View how many work:

$ jobs

The following work is to distinguish between a number allocated by a shell, rather than using a PID.

- - Pause a foreground stroke:

$

(But not always valid: P)

- - Suspend the program of the foreground:

$

(DITTO)

- - Move a paused program to the background to continue:

$ bg

- - Turn a background execution to the foreground:

$ fg

- - again, cut off a itinerary:

$ KILL%

The of this here may be 1, 2, 3, ... With these commands you can format the disk at the same time,

Compressed files, compile a program, you can also decompress, and you still see the prompt number and cursor waiting

Try your order. Try to try it next next !! Try it under Windows, compare them

The efficiency is different, then you will know if your choice is correct.

转载请注明原文地址:https://www.9cbs.com/read-61278.html

New Post(0)