Unix common command profile (1)

xiaoxiao2021-03-06  38

1) Login workstation

==========

Perform format Telnet Hostname (executed under DOS)

Telnet IP-Address

EXAMPLE:

Telnet Doc Telnet 140.122.77.120

Note: IP_ADDRESS can be queried using instruction ARP HOSTNAME or ARP DOMAIN_NAME

Login steps

=========

Login: _______ => Enter username

Password: _______ => Enter a password

2) Exit step

=========

% logout or% exit or%

Change account password

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

% passwd => The following message will appear after the execution

CHANGING NIS Password for User On Ice.

Old Password: ______ => Enter the old password

NEW password: ______ => Enter the new password (preferably 6-8 words English letters and digital mixing)

Retype new password: ______ => Enter a password

3) Online manual Man

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

Perform format Man Command-Name

EXAMPLE:% MAN LS

Enter a remote computer system

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

Perform format rlogin hostname [-1 username]

EXAMPLE:

% rlogin doc

Remote login enters workstation DOC

% rlogin doc -l user

Enter the workstation DOC using the USER account

Perform format Telnet Hostname or Telnet IP Address

Example:% Telnet Doc OR% Telnet 140.109.20.251

4) Archive or directory processing LS

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

List the file name in the file or directory

Perform format ls [-tflgr] [name] (Name) is a file name or directory name)

EXAMPLE:

Ls lists the file names in the current directory

LS -A lists all file names that contain? started hidden file

Ls -t lists files in accordance with the order of the file final modification

LS -F lists the file name and its type "/" at the current directory, expressed as the directory name

"*" Is indicated as the end "@" end is indicated as Symblic Link

LS -L lists all files in the directory, the file size modification time and name

Ls -lg is the same as the owner group name of the file

Ls -r displays the name of the directory and all the subdirectory (Recursive Listing)

5) Find File Find

Finding Files That Match A Pattern

$

Find. -name 'd *'

THE DOT (.) Find to search the current directory and itssubdirector. The -name Option File Name OPTION File Name

Pattern (in this case d *) TELLS FIND TO Search for All File Names That Match

That Pattern. in this Example, Find Will Look for All File Names Beginning

WITH D. Note That D * is enclosed by Single Quotes 'D *'.

$ FIND / HOME / LESLIE -NEWER MyFile

This Example Can Be Read As Follows: in Directory / Home / Leslie and ITS

Subdirectories, Find All Files Modified After Myfile. (To Determine WHEN A

File Was Last Modified, Use The Ll Command.)

$ FIND. -NAME '* .TMP' - EXEC RM {} /;

You Can Execute Commands on Files Located with the Find Command. Let's say you want to remove all Files with a extension in Thecurrent Directory and ITS Subdirectories.

To Find Files That Do Not Match A Specific Pattern, Use the logical not

Operator, The Exclamation Mark (!). after useing this operator, you must

Use Options to Define File Attributes Such As File Name. Then, Files Are

Found That Do Not Have The attributes you specify.

For Example, To Find All Files In / Tmp That Aren't OWNED BY LESLIE, USE

This Command:

$ FIND / TMP / (! -user leslie /)

THE / Escapes the Parentheses So That They Are Not Interpreted As Special

Characters by the shell. To find files That Have Two DistINCT Attributes, Use the logical and

Operator, Expression -a Expression. For Example, To Find All Directories IN /

That Are Owned by leslie, use this command:

$ FIND / / (-type d -a -user leslie /)

To Find Files That Have Either OR Both of Two Attributes, Use The Logical OR

Operator, Expression -o Expression. For Example, To Remove All Files Ending

With .o or named a.out what has not been accessed for a week, uschacomb:

$ FIND / / (-Name a.out -o -name '* .o' /) -time 7 -exec rm {} /; 6) Directory Abbreviation CD =========== ~ Users login's Working Directory ~ username Specifies a USER's Working Directory. Current Working Directory .. Current Directory (Parent of Working Directory) Change the working directory location ================ Perform format CD [Name] Name can be used for directory name path or directory abbreviation Example: CD change the directory location to the user login Working Directory (Start Directory) CD DIR1 Change Directory Location to DIR1 Directory Location CD ~ USER Change the directory location to the user's Working Directory CD .. Change the directory location to the upper layer of the current directory (ie Parent of Working Directory Cd ../user changes the directory location to the directory location of the relative path user under the directory location of the user, change the directory location to the directory location of the absolute path (Full Path)

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

New Post(0)