Unix common command profile (4)

xiaoxiao2021-03-06  39

21) Change the last modification time of the file or directory

===============================

Perform format Touch Name (Name can be file or directory name)

22) Connection of files LN

==========

The same file can have more than one name to make files to do files.

Perform format ln oldname newname (Hard Link)

EXAMPLE

Ln file1 file2 links the name file2 to the file file1

Perform format ln -s oldname newname (Symblick Link)

EXAMPLE

ln -s file3 file4 links the name file4 to the file file3

23) File string to find grep

==============

Perform format Grep String File

EXAMPLE

GREP ABC FILE1

Looking for the entire text content of the string ABC in the file file1

24) Find the path of the file or command Find whereis which

====================

Perform format Whereis command (the path to display command)

Perform format which command (Display Command Path and Alias ​​defined by users)

Perform format What dismist (Display Command Function Summary)

Perform Find Search-path -name filename -Print

(Search the path of a file under the specified path)

EXAMPLE

% FIND / -NAME FILE1 -PRINT (looking for a path to file1 in root)

25) Compare files or directory content DIFF

====================

Perform format diff [-r] name1 name2 (Name1 Name2 can be used as a file name or directory name)

EXAMPLE:

% DIFF file1 file2

The comparison files File1 are different from those in File2.

% DIFF -R Dir1 Dir2

Comparison Directory DIR1 and Dir2

26) Archive print output LP

============

Users can use the setENV PRINTER in the .login file to set the list of lists when printing the print data.

Printername: SP1 or SP2 (1005 classroom)

EXAMPLE

% STENV Printer SP2 Sets from SP2 Print Information

Printing of general archives

==============

Perform format Lpr [-pprinter-name] filename

% lpr file1 or lpr -psp2 file1

Self-SP2 print file file1

Perform format ENScript [-pprinter-name] filename

% ENSCRIPT FILE3 or ENScript -psp1 File3 Since SP1 Print Archive File3

? Troff files

==================

Perform format ptroff [-pprinter-name] [-man] [- ms] filename

% ptroff -man /usr/local/man/man1/ptroff.1

Instructions for use in a Troff format from Apple Laser Writer Print Ptroff Command

% Ptroff -PSP2-Man / USR / MAN / Man1 / LPR1

Instructions for use in Troff Format Since SP2 LPR Command

List machine control command

==============

• Check the list of lists and print job sequence numbers and user names

=================================================

Perform format lpq [-pprinter -name]

% LPQ or LPQ -PSP1

Check the status of the SP1 list machine

• Delete the print job in the list machine (users can only delete their own prints)

=========================

Perform format lprm [-pprinter -name] UserName or Job Number

% LPRM User or LPRM -PSP1 User

Delete SP1 User User's print job This time the user name must be User

% lprm -psp2 456

Delete SP2 No. 456 Print Work

27) JOB control PS

===========

Unix O.s., can handle multiple processs at the same time as ForeGrourd and Background

The general user executes commands to perform Process in Foreground can also use Process.

Implement Process in a non-talk in Background

View System Process

====================

Perform format ps [-aux]

EXAMPLE:

% PS or PS -X (see your own process)

% PS -AU (see all user processs)

% PS -AUX (view the system inside the system and all users "Process)

• End or terminate Process

====================

Perform format kill [-9] PID (PID is using the process ID used by the PS command) Example:

% KILL 456 or KILL -9 456

Terminate Process ID for 456 Process

? How to perform Process in Background

====================================

Perform format Command & (Add a "&" symbol after Command

EXAMPLE:

% cc file1.c &

Working in the File1.c file is placed in Background execution

Press the "Control Z" button to press the "Control Z" button to type "BG" command

The command will be placed in the Background to continue executing

EXAMPLE:

% cc file2.c

^ Z

STOPPED

% BG

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

New Post(0)