Linux Getting Started General Command

xiaoxiao2021-03-06  41

Linux Getting Started General Command

1.Linux enters and exits the exit system to enter the Linux system: You must enter the user's account, you can create the following in the system installation process.

Account: 1. ROOT - Super User Account (System Administrator), use this account

You can do anything in the system. 2. Ordinary users - this account is used by the Push Tong users, can be limited

Operation. General Linux users are ordinary users, and system administrators generally make

Complete some system management work with a super user account. If you only need to complete one

Some tasks that can be completed by ordinary accounts, it is recommended not to use a super user account.

So unintentionally destroyed the system. Affect the normal operation of the system. User login is two steps: first step, enter the user's login name, system according to

The login name identifies the user; the second step, enter the user's password, this password is the user

A string that set it yourself, is confidential for other users, is in the login time

Ideal to identify the keywords of true and false users. When the user correctly enters the username and password, it will legally enter the system.

. Screen display: [root @ loclhost / root] #

At this time, you can do a variety of operations. Note that the super user's prompt is "

# ", Other users' prompts are" $ ".

Modify the password to better protect user accounts, Linux allows users to repair

Change your own password, modify the password command is Passwd, it will prompt the user to enter

Old passwords and new passwords, then ask users to confirm new passwords again to avoid use

Unintentionally press the wrong button. If the user forgets the password, you can apply to the system administrator

Please reset one yourself.

Virtual console Linux is a real multi-user operating system that can be accepted simultaneously.

A user log in. Linux also allows a user to log in multiple times, because

Like Unix, Linux and UNIX provide access to virtual console, allowing users

Multiple logins from the console at the same time. The choice of virtual console can be connected

The ALT key and a function key are pressed, and F1-F6 is usually used, for example, users

After logging in, press the ALT-F2 key, the user can see "Login:" prompt,

Explain that the user sees the second virtual console. Then just press the ALT-F1 button,

You can return to the first virtual console. A newly installed Linux system default

Users use the ALT-F1 to ALT-F6 keys to access the first six virtual console. virtual

The console allows users to work on multiple console while actually reflecting Linux system.

More users' features. Users can work on a virtual console

Switch to another virtual console start another job at the end of the end.

Exiting the system whether it is a super user or a normal user, when you need to exit the system,

Under the shell prompt, type the exit command. Replication, deletion, and movement of Linux files

The function of the command is the function of the command to copy the file or directory to another file or directory.

, Like the Copy command under MSDOS, the function is very powerful.

Syntax: CP [Option] Source File or Directory Target File or Directory

Description: This command copies the specified source file to the target file or put multiple source files.

Copy to the target directory.

The entries of the commands are as follows:

- a This option is usually used when copying the directory. It retains links, file properties,

And recursively copy the directory, its function is equal to the combination of DPR options.

- Reserved link when D copy is copied.

- f Delete the existing target file without prompting.

- The I and F options are reversed, and the prompt requirements will be given before the target file is overwritten.

confirm. When the answer y, the target file will be overwritten and is an interactive copy.

- P At this point, CP will also copy its modification time and access to the new file in addition to copying the contents of the source file.

- R If the source file given is a directory file, the CP will recursively copy the directory.

All subdirectories and files. At this point the target file must be a directory name.

- l Does not copy, just link files.

It should be noted that in order to prevent the user from being broken with a CP command in an inadvertent

Did another file, such as the user-specified target file name already exists, use the CP command to copy

After the baby file, this file will be overwritten by the new source file, so it is recommended that the user is

It is best to use the I option when copying the file using the CP command.

MV command

Users can use the mv command to change the file or directory or put the file by a directory

Move into another directory. This command is like a combination of REN and MOVE under MSDOS.

Syntax: MV [Option] Source file or directory target file or directory

Description: Different from the second parameter type in the mv command (is the target file or purpose

The standard directory), the mv command renames the file or moves it to a new directory.

When the second parameter type is the file, the mv command completes the file rename, at this time,

The source file can only be one (or source directory), which will give the source file

Or directory renamed a given target file name. When the second parameter is existing

When the directory name, the source file or directory parameter can have multiple, the mv command will each parameter

The specified source file is moved to the target directory. When moving files across file systems,

MV copy, then delete the original file, and the link to the file will also be lost

.

The meaning of each option in the command is:

- i interactive operation. If the MV operation will result in the existing target file

Overlay, at this time, the system is inquiry to rewrite, requiring the user to answer Y or N, so

Avoid mistakeover files.

- F prohibits interactive operation. Do not give it to the MV operation to overwrite some destination files

Any indication, the I option will no longer work after specifying this option.

If the target file (not a directory) already exists, the content of the file will

Covered by the new file. To prevent users from using the MV command to destroy another file, use the MV

When the command moves the file, it is best to use I option.

RM command

Users can delete unwanted files with the RM command. The function of this command is to delete one

One or more files or directories in a directory, which can also put a directory and

All files and subdirectories are removed. For link files, just disconnect the chain

Connect, the original file remains the same.

The general form of the RM command is:

RM [option] file ...

If you do not use the RE option, RM does not delete the directory.

The entries of the commands are as follows:

- f ignores the files that do not exist, never given a prompt.

- R indicates that RM is recursively deleted all directories and subdirectories listed in the parameters.

- i interactively deleted.

Be careful with the RM command. Because once the file is deleted, it cannot be recovered.

. Preventing the occurrence of this situation, you can use I option to confirm the deletion

document. If the user enters Y, the file will be deleted. If you enter any other

Things, the document will not be deleted.

Create and delete command mkdir command in linux directory

Function: Create a directory (similar to MD command under MSDOS).

Syntax: mkdir [option] DIR-NAME

Description: This command creates a directory named by DIR-NAME. Request to create a directory

Households have write permissions in the current directory (in the parent directory of DIR-NAME), and

DirName cannot be a directory or file name in the current directory.

The meaning of each option in the command is:

- m Set access to the new directory. You can also set with a chmod command.

- p can be a path name. At this point, if some directories in the path do not exist, after adding this option, the system will automatically establish a directory that has not yet exists.

Multiple directorys can be created once.

RMDir command

Function: Delete the empty directory.

Syntax: RMDir [option] DIR-NAME

Description: DIR-NAME represents a directory name. This command removes one from a directory or

Multiple subdirectory items. It is necessary to pay special attention to a directory before being deleted.

It must be empty. The RM - R DIR command can replace RMDIR, but there is danger. delete

In addition to a directory, you must have write access to the parent directory.

The meaning of each option in the command is:

- P recutably deleted directory DIRNAME, when the child is deleted, its parent directory is empty

Also deleted together. If the entire path is deleted or reserved for some reason

Some paths, the system displays the corresponding information on the standard output.

CD command

Function: Change the work directory.

Syntax: CD [Directory]

Description: This command changes the current directory to Directory specified. If

No specified Directory, returns to the home directory of the user. To change to the designated

Directory, the user must have execution and read permissions to the specified directory.

This command can use wildcards (see Chapter 10 of the wildcard mean).

PWD command

In the Linux hierarchical directory structure, users can benefit from any directory being authorized.

Create a new directory with the mkdir command, or use the CD command to convert from a directory

To another directory. However, there is no prompt to tell the user who is currently in.

Directory. If you want to know the current catalog, you can use the PWD command.

The command displays the entire path name.

Syntax: PWD

Description: This command shows the absolute path of the current work directory.

ls command

Ls is an English word List, its functionality is to list the contents of the directory. This is used

One of the most common commands, because users need to view a directory from time to time

Content. This command is similar to the DIR command under DOS.

Syntax: LS [option] [directory or file]

For each directory, the command will list all the subdirectories and files. for

Each file, the LS will output its file name and other information required. default

In the case, the output entries are sorted in alphabetical order. When not given a directory name or file

When name is, the current directory is displayed.

The meaning of each option in the command is as follows:

- a Display all subdirectories and files in the specified directory, including hidden files.

- a Display all subdirectories and files in the specified directory, including hidden files. but not

List "." And "..".

- b Display the non-display character in the file name with an octal escape character.

- c Sort by the modification time of the file.

- C is divided into multiple columns display.

- D If the parameter is a directory, only its name is displayed without displaying each file.

Often use together with the L option to get detailed information on the directory.

- f is not sorted. This option will make the LTS option to fail and make the AU options are valid.

- f Tag "/" after the directory name, the executable is marked "*",

Number link marked "@", pipe (or FIFO) back tag "|",

The SOCKET file is marked "=".

- i Node i node I display file in the first column output.

- l Details of the file in a long format. This option is most commonly used.

The information listed in each line is: file type and permission link number file owner

Document Group file size establish or recently modified time name

For symbolic link files, there are "->" and reference files after displayed file names

Path name.

For device files, its "file size" field shows the main, secondary device number, not

Is the file size.

The total number of numbers in the directory displays the beginning of the long format list, which contains an indirect block. - L If the specified name is a symbolic link file, the link points to the link

file.

- m Output by a character flow format, the file is displayed, and the comma is separated.

- n The output format is the same as the L option, but only in the output of the owner and group group

It is expressed in the corresponding UID number and the GID, not the actual name.

- O is the same as the L option, but does not display the owner information.

- p After adding a "/" behind the directory.

- q Use "?" instead of "?" in the file name.

- r Displays the output results in an alphanist or first priority order.

- R Credit Displays files in each subdirectory of the specified directory.

- S gives the number of blocks used in each directory, including indirect blocks.

- T is displayed in the modification time (recently priority) instead of by the name. If the text

If the modification time is the same, then press the dictionary order. Modification time depends on whether it is used

C or U selection top. The default time tag is the last revision time.

- U shows the time (recently preferred) instead of the name while displaying

Sort. The time tag of -t is to modify to the last time.

- X The information of each row is displayed by row.

In the information displayed by the LS - L command, the beginning is a string consisting of 10 characters.

Where the first character represents the file type, it can be one of the following types:

- ordinary document

d catalog

l Symbol link

B block device file

C character device file

The next 9 characters represent the access rights of the file, divided into 3 groups, 3 digits per group.

The first group represents the authority of the file owner, and the second group indicates the authority of the same group,

The three groups indicate the permissions of other users. The three characters of each group indicate the text, respectively.

Read, write and execute permissions.

The permissions are as follows:

R read

W Write

X is executed. For the directory, it means enters permissions.

S When the file is executed, the UID or GID of the file is given the UID of the process.

(User ID) or GID (Group ID).

T Set the flag bit (stay in memory, not being swapped out). If the file is a directory,

The files in this directory can only be deleted by the superuser, directory owner or file

except. If it is an executable file, after the file is executed, point to its aquential segment.

The pointer remains in memory. This will then load it again when you execute it again.

The document.

Linux text handling command sort command

The function of the sort command is to sort the rows in the file. There are many sort commands.

Very practical options, these options were originally used to file a database format

A variety of sorting operations are performed. In fact, the sort command can be considered one

Very powerful data management tool, used to manage content similar to database records

Part.

The sort command will be sorted by the contents of the file, if the first character of the two lines

The same, this command will continue to compare the next character of these two lines, if it is still the same,

Continue to compare.

grammar:

Sort [option] file

Description: Sort all the rows in the specified file and display the results

Show on standard output. If you do not specify an input file or use "-",

The order content comes from standard input.

Sort Sort is compared according to one or more keywords extracted from the input row

Finished. Sorting keywords define the smallest character sequence used to sort. default

In the case, you can sort in the ASCII character sequence in a whole behavior keyword.

Change the options for default settings Main:

- M If a given file has been raised, the merge file.

- C check whether the given file is ranked, if they don't have a good order, then

Print an error message and exit in status value 1.

- u On only one line of rows, only the same line is left.

- o Output file writes sorted to the output file instead of the standard output, if the output file is one of the input files, Sort will first write the contents of the file first

Temporary files, then sort and write output results.

Change the options for default sorting rules Main:

- d Sort by dictionary, only letters, numbers, spaces, and tabs when compared

significance.

- f Treat your lowercase letters with uppercase letters.

- i ignores non-print characters.

- M as a month comparison: "jan" <"feb"

- r Sampling results in reverse sequence.

POSL - POS2 Specifies one or several fields as sorting keywords, field bit

Set from POSL to POS2 (including POSL, not including POS2). if not

Specify POS2, the keyword is from POSL to the end. Fields and characters from 0

Start.

- b looks for sorting keywords in each row (spaces and tabulation

symbol).

- T separator Specifies the character Separator as a field separator.

UNIQ command

The file may have a repeated row in its output file after processing. E.g

After using the CAT command to merge two files, use the sort command to sort

It may have a repeated row. At this point, you can use the UNIQ command to

Delete in the output file, leaving only the unique sample of each record.

grammar:

UNIQ [option] file

Description: This command reads the input file and compares the adjacent rows. In normal conditions

Next, more repeated rows will be deleted in the second and in the future, and the line comparison is based on the

The sequence sequence of the character set is performed. The result of this command is written to the output file

in. Enter files and output files must be different. If you enter a file, "-" table

Show, then read from standard input.

The commands each option is as follows:

- C The display output in each line, the number of times the Bank appears in the file.

It can replace the U and-D option.

- D shows only the repeated line.

- u Only lines do not repeat in the file.

- n The front n field is ignored with the blank before each field. A field is

A non-air, non-made string, which is separated from each other by tabs and spaces (

Fields start numbers from 0).

n The front n characters are ignored, the previous characters are skipped (the character starts from 0 "

).

- f N is the same as - n, where n is the number of fields.

- S n is the same as N, where n is the number of characters.

Linux backup and compression command

Tar command

TAR can create a file for files and directories. Using TAR, users can be a special

Document creation file (backup file), or change file in the file, or

Add new files to the file. TAR was originally used to create files on tape

Now, users can create files on any device, such as floppy disk. Tar

Command, you can pack a lot of files and directories into a file, this pair

The backup file or combine several files into a file for network transmission is

Very useful. TAR on Linux is a GNU version.

Syntax: TAR [Profile Counseling] file or directory

When using this command, the primary option must be there, it tells Tar what to do

Love, counsel is an auxiliary use, can be used.

Main options:

c Create a new file. If the user wants to back up a directory or some files

To select this option.

R Put the file you want to archive to the unlucky of the file file. For example, the user has made

Backup files, find that there is still a directory or some file forgot backup, this

You can use this option to append a directory or file to the backup file.

T list the contents of the file file, see which files have been backed up. u Update the file. That is, replacing the original backup file with the new file, if

If you can't find a file in your backup file, you append it to the backup file.

Rear.

x Release files from the archive file.

Auxiliary options:

B This option is set for the tape drive. Then follow a number, used to explain the block

Size, system preset value is 20 (20 * 512 bytes).

f Use the file or device, this option is usually necessary.

k Saves the already existing file. For example, we restore a file, restore

In the process, the same file is encountered, and it will not be covered.

M When restoring the file, set the modification time of all files to now.

M Create a multi-volume file to store in several disks.

v Detailed report information of TAR processing. If there is no such option, TAR does not report files

information.

W Each step is required to confirm.

z Using GZIP to compress the / decompressed file, add the file file after adding this option.

It is also necessary to use this option to decompress when compressed, but restore.

gzip command

Reducing the size of the file has two obvious benefits, one is to reduce storage space, two

When transmitting files over the network, the time of transmission can be reduced. Gzip is

A command to compress and decompress a file in the Linux system

It is convenient and easy to use.

Syntax: Gzip [Option] Compressed (Decompressed) file name

The meaning of each option:

-c Write the output to the standard output and retains the original file.

-d will decompress the compressed file.

-l The following fields are displayed for each compressed file:

The size of the compressed file

Uncompressed file size

Compression ratio

Name of uncompressed file

-r is classified to find all files specified and compressed in it or decompressed

Shrink.

-t test, check if the compressed file is complete.

-v's file name and compression ratio for each compression and decompression file.

-num Adjusts the speed of compression with the specified digital NUM, -1 or -fast means the fastest

Compression method (low compression ratio), - 9 or - BEST represents the slowest compression method (high pressure

Covers. The system default is 6.

unzip command

How to compress file with MS Windows WinZip how to compress how to

Unlock it? You can use the unzip command, this command is used to descend the exhibition called .zip

Compressed file.

Syntax: unzip [option] Compressed file name .zip

The meaning of each option is:

-x file list decompress file, but does not include the specified file file.

-v View the compressed file directory, but does not decompress.

-t test file is damaged, but does not decompress.

-d directory solves the compressed file to the specified directory.

-z only shows the annotation of the compressed file.

-n does not override existing files.

-o covers existing files and does not require user confirmation.

-j does not rebuild the directory structure of the document, unfolding all files to the same directory.

Run the DOS command in the Linux environment

The Linux system provides a set of portable tools called mtools that allow users to

Easily read, write files and directories from standard DOS floppy disks. They are for DOS and

Exchange files between Linux environments is very useful. They do not have a common file

The powerful means of exchange files between systems in system format. For a MSDOS

Floppy disk, just put the floppy disk in the floppy drive, you can use the command provided by mtools.

To access files on the floppy disk.

The main commands of mtools are as follows:

MCD directory name change the MSDOS directory;

Mcopy Source File Target File Copying the file between MSDOS and UNIX;

The MDEL file name deletes the MSDOS file;

The MDIR directory name shows the MSDOS directory; the MFormat drive letter creates a MSDOS file system on a low-level formatted floppy disk

;

The RNLabel drive letter produces a MSDOS volume display;

MMD directory name is established by msdos directories;

MRD directory name deletes the MSDOS directory;

The MREN source file target file renames the existing MSDOS file;

The MTYPE file name shows the contents of the MSDOS file.

Tip: These commands are very similar to the corresponding MSDOS commands.

Linux change file or directory access to each file and directory in the Linux system have access licensed permissions, with it

To determine who can access and operate files and directories.

The access rights of the file or directory are divided into read-only, only three kinds of only written and can be implemented. In

Taking the document as an example, read-only permissions represent only read its content, but it is forbidden to do anything.

Change operation. Executable permission indicates that the file is allowed to perform as a program

. When the file is created, the file owner automatically has read, write and

Execute permissions to facilitate reading and modification of files. Users can also put it as needed

Access permission is set to any combination of needs.

There are three different types of users to access files or directories: Files

Some, group users, other users. Everyone is generally the founder of the file. Instant

Some can allow the same group of users to have the right to access the file, but also access to the file

Limit other users to the system. In this case, every user in the system

Can access the files or directories owned by the user.

There are three groups of access to each file or directory, and each group is represented by three.

The read, write and execution permission of the owner of the file; read the user's readings

, Write and execute permissions; other users of the system, write and execute permissions. Use

The LS -L command displays the details of the file or directory, the leftmost list

Part of access. E.g:

$ ls -l sobsrc. TGZ

-rw-r - r - 1 root root 483997 JU1 L5 17: 3L

Sobsrc. TGZ

The horizontal line is empty. R represents read-only, W is written, and X represents executable.

Note that there are 10 locations here. The first character specifies the file type. Usually

In the sense, a directory is also a file. If the first character is a horizontal line, a table

Show is a non-directory file. If D, it is a directory.

E.g:

- rw- r - r -

Ordinary file file main group users other users

Is the access rights of the file SOBSRC.TGZ, indicating that Sobsrc.tgz is a

Ordinary document; Sobsrc.tgz owner has read and write permissions; with SOBSRC.TGZ

The user of the primary group only has read rights; other users only have read privileges.

After identifying the access rights of a file, users can take advantage of the Linux system

The CHMOD command is provided to reset different access rights. You can also use

CHOWN commands Change the owner of a file or directory. Use the chgrp command

Change the user group of a file or directory. These commands are described below. CHMOD command

The chmod command is very important for changing the access rights of the file or directory.

limit. Users use it to control files or directory access.

This command has two usage. One is a text that contains letters and operator expressions

Word setting method; the other is a digital setting method containing numbers.

Text setting method

CHMOD [WHO] [ | - | =] [MODE] file name?

The meaning of each option in the command is:

Operation objects WHO can be any of the following or a combination thereof:

u Represents "User", the owner of the file or directory.

g represents "Group", that is, the same group is the same as the file owner

All users of IDs.

o Represents "other (others) users. a Represents "All (all) users. It is the system default value.

The operation symbol can be:

Add a certain permissions.

- Cancel a certain permission.

= Give a given permissions and cancel all all permissions (if any).

Set the permissions indicated by MODE available to any combination of the following letters:

r readable.

W can be written.

X can be executed.

X Only the target file is executable for some users or the target file is

The X attribute is added to the time.

s The owner or group ID of the process is set to the file of the file when executed.

the Lord. The user ID bit of the "U S" setting file, "G S" setting group ID bit

.

t Save the program's text to the switch.

u Have the same authority with the owner of the file.

g has the same permissions with users of the owner of the file.

o Have the same permissions from other users.

File Name: Separate a list of files to change permissions, support wildcline

symbol.

Multiple permissions can be given in a command line, and there is a comma.

For example: CHMOD G R, O R EXAMPLE

Make the group and other users read permissions on the file example.

2. Digital setting method

We must first understand the meaning of the attribute represented by the number: 0 means no

Permissions, 1 represents executable permissions, 2 indicates writable rights, 4 indicates readable permissions,

Then add it. Therefore, the format of the digital attribute should be 3 binary from 0 to 7.

Number, the order is (U) (G) (O).

For example, if you want to have a file owner with a "read / write",

You need to put 4 (readable) 2 (write) = 6 (read / write).

The general form of digital setting method is:

CHMOD [MODE] file name?

chgrp command

Function: Change the group of files or directories.

Grammar: chgrp [option] Group filename?

This command changes the user group to which the specified file belongs. Where Group can

It is the user group ID, or the group name of the user group in the / etc / group file. file

The name is a list of files that are separated by spaces to support wildcards. in case

The user is not the owner or super user of the file, and the group of the file cannot be changed.

Each of the commands is:

- r Cancellation changes the specified directory and all subdirectories and files

Group.

Chown command

Function: Change the owner and genus of a file or directory. This order is also very

Common. For example, the root user copies its own file to the user XU, in order to let

User XU can access this file, ROOT users should set this file

For the XU, otherwise, the user XU cannot access this file.

Syntax: Chown [option] user or group file

Note: Chown changes the owner of the specified file to the specified user or group.

The user can be a username or user ID. The group can be a group name or group ID. File is

Space Separates a list of files to change permissions, support wildcard.

The entries of the commands are as follows:

- r Cancellation changes the specified directory and all subdirectories and files

owner.

- v shows the work made by the chown command.

Linux Getting Started General Command 2003-03-06 · · Xia Zhimin ·· Yeong Software Channel

Previous 1 2 3 4 5 6 7 8 9 10 11 12 Next page Linux related to user

Passwd command

For system security reasons, each user in the Linux system has its users

In addition, there is also its corresponding user password. So use the useeradd command to increase

Also need to use the passwd command to set your password for each newly added user; users can then change their passwords with the passwd command.

The general format of this command is: passwd [user name] where the username is required

Modify the username of the password. Only super users can use "PasswD username

"Modify the password of other users, ordinary users can only use Passwd without parameters

Make your own password.

The method of use of this command is as follows:

enter

Passwd ;

Enter the current password in (CURRENT) UNIX Passwd: Enter the current password

In New Password: Enter a new password under prompt (see this on the screen

Password):

The system prompts to enter this new password again.

After entering the correct, this new password is encrypted and put in / etc / shdow file. Choose

A password that is not easy to decipher is is important.

Select the password should follow the following rules:

The password should have at least six (preferably eight) characters;

The password should be uppercase letters, punctuation and numbers are mixed.

The process of superuser modifying other users (xxq) is as follows,

# Passwd root

New Unix Password:

Retype New Unix Password:

Passwd: All Authentication Tokens Updated

SuccessFully

#

su order

This command is very important. It allows an ordinary user with a superuser or

His user's permissions can also make super users do something as ordinary users.

situation. When the ordinary user uses this command, there must be a superuser or other user's mouth.

make. To leave the current user's identity, you can play exit.

The general form of this command is: SU [option] [?] [User account]

Description: If you do not specify the user account, the system preset is superuser root.

. The meaning of each option in this command is:

? C will end after executing a command.

• The purpose of adding this minus is to make the environment variables and users who want to convert.

? m keeps environment variables unchanged.

Password: [Enter the password of the superuser] Linux system management command

Wall command

The function of this command is to send information to all logged in users, users can first

Deposit the information you want to send in a file, then enter:

# Wall

This will send information to all users.

In the above example, the symbol "<" indicates the input redirection, and the meaning of it is

Please refer to the relevant content of Chapter 10. E.g:

# Wall 'Thank you!'

Broadcast Message from root (tty1) Fri Nov 26 14:

15:07 1999 ...

Thank you!

#

After performing the above command, the user's screen shows "THANK you!"

Do not show the system prompt $ (#), then press the back key again, the screen appears

The prompt.

Write command

The function of the Write command is to send information to a user in the system. Command

The general format is:

Write User Account [Terminal Name]

For example: $ WRITE GUEST HELLO

At this point, the system enters the message state, and the user can enter the information you want to send.

After all, I hope to exit the send state, press the combination button .

MESG instruction

The MESG command sets whether other users are allowed to send information to themselves with the write command.

. If you are allowed to send information to yourself, enter the command:

# MESG Y

Otherwise, enter: # MESG N

For super users, the default value of the system is n; for the general user system

I recognize Y. If you don't bring any parameters after MESG, the current status is Y.

Still n ..

SYNC command

The SYNC command is used when turning off the Linux system. Users need to pay attention

Yes, you cannot shut down the system with a simple shutdown power, because Linux is like it.

Like the UNIX system, many data are cached in memory, and they need to shut down the system.

To make a synchronous check of memory data and hard disk data, ensure that the hard disk data is closed

The system is the update, only this can ensure that the data will not be lost. Generally normal

The process of shutting down the system is automatically carried out, during the system operation

It will also be done timed that users do not need user intervention. The sync command is forced

The data in memory writes back to the hard disk to prevent data loss. Users can be needed

Use this command. The general format of this command is:

Sync

SHUTDOWN command

The shutdown command can safely shut down or restart the Linux system, which is in the system.

Tip a warning message to all login users on the system before closing. This command is still

Allow users to specify a time parameter, can be a precise time, or

It is a time period from now. The format of the exact time is HH: mm, indicating

Hours and minutes; the time period is represented by " " and minutes. System execution this command

Once, data is automatically synchronized.

The general format of this command is: shutdown [option] [time] [warning information

] The meaning of each option in the command is:

- k does not really shut down, but just issue a warning message to all users.

- Retart immediately after shutdown.

- The h is turned off after shutdown.

- f Qu quickly and skips FSCK when restarting.

- n Quick shutdown, no init program.

- C Cancel a rundown that has been run.

It is important to specify that this command can only be used by superuser.

Free command

The feature of the free command is to view the usage of the current system memory, it displays the system

The remaining and useful physical memory and exchange memory, as well as sharing memory and core

The buffer used.

The general format of this command is: Free [-b | -k | -m] commands

The meaning is as follows:

-b is displayed in bytes.

-k is displayed in k bytes.

-m is displayed in megabytes.

uPtime command

UPTIME Command Display The system has run how long it is displayed, it appears in turn.

Interest: Today, how long it has been running, how much login is currently used

Households, the system has an average load in the past 1 minute, 5 minutes and 15 minutes.

The general format of this command is: uptime

Linux disk management

DF command

Function: Check the disk space occupancy of the file system. Can be used to use this command

How many spaces are found to get the hard drive, and how many space remaining is left.

Syntax: DF [option]

Explanation: DF commands can display all file systems for i nodes and disk blocks

condition.

The meaning of each option is as follows:

-a Displays the disk usage of all file systems, including 0 (block)

File system, such as / proc file system.

-k is displayed in k bytes.

-i displays I node information instead of disk block.

-t Displays the disk space usage of the file system of each specified type.

-X lists disk space usage (with T) not a specified type file system (with T

The option is reversed).

-T Displays the file system type.

Du command

DU's English is originally "Disk Usage", meaningful for displaying disk space

Happening.

Function: Statistical Directory (or file) The size of the disk space is scheduled. Syntax: du [option] [names ...]

Description: This command enters each subdirectory of the specified directory step by step, and displays the directory.

The case where the file system data block (1024 bytes) is occupied. If there is no Names

Then, the current directory is counted.

The various options of this command mean the following:

-s Only the total number of data blocks for each NAMES parameter is given.

-A Recursively Displays the occupied files in each file and the designer directory in the specified directory.

The number of data blocks. If neither -s, no--A, only displayed in Names

Each directory and the number of disk blocks in each sub-directory.

-b lists disk space usage in bytes (the system defaults in k bytes)

unit).

-k lists disk space usage in units of 1024 bytes.

-c finally coupled with a total (system default setting).

-l Computing all file size, calculates multiple times for hard link files.

-X Skip directory on different file systems does not statistically.

DD command

Function: Copy the specified input file into the specified output file and in the copy

Format conversion can be performed during the shell. You can use this command to implement DOS

The role of the diskcopy command. First use the DD command to write the data on the floppy disk into a hard disk.

A registration file, write this registration file to the second floppy disk, complete

DiskCopy's function. It should be noted that the registration file on the hard disk should be used

The RM command is deleted. The system defaults to use standard input files and standard output files.

Syntax: DD [option]

if = Enter a file (or device name).

OF = Output file (or device name).

IBS = bytes read the bytes bytes at a time, that is, the number of bytes read into the buffer.

Skip = Blocks Skip the IBS * Blocks block that reads into the buffer.

Obs = bytes writes the BYTES byte once, ie the number of bytes written to the buffer.

BS = bytes At the same time, the number of bytes of the read / write buffer is set (equal to setting IBS and

OBS).

CBS = Byte converts the BYTES byte.

Count = Blocks only copies the input Blocks block.

Conv = ASCII converts the EBCDIC code to the ASCIL code.

Conv = EBCDIC converts the ASCIL code to an EBCDIC code.

CONV = IBM converts the ASCIL code to the Alternate EBCDIC code.

Conv = Block converts the change bit into a fixed character.

CONV = Ublock converts the fixed bit into a changing bit.

Conv = ucase converts the letters from lowercase to uppercase.

CONV = LCase converts the letters by uppercase to lowercase.

CONV = NOTRUNC is not cut off output file.

CONV = Swab exchanges each pair of input bytes.

CONV = NoError does not stop processing at an error.

CONV = SYNC Tunes the size of each input record to the size of the IBS (with

NUL fills).

fdformat command

The floppy disk is one of the commonly used storage media. Fan must be grouped before use

Format, then store data with TAR, DD, CPIO, etc.

Establish an installable file system on a floppy disk.

Function: Low-level formatting floppy disk

Grammar: format [-n] Device

Note: The action of this command is to format the floppy disk.

The -n floppy disk is not inspected after formatting.

Device Specifies the device to be formatted, usually one of the following devices:

/ dev / fd0d360

/ DEV / FD0H1200

/ DEV / FD0D360 / DEV / FD0H360

/ dev / fd0d720

/ dev / fd0h720

/ dev / fd0h360

/ dev / fd0h720

/ dev / fd0h1440

Linux other commands

echo command

The function of the echo command is to display a piece of text on the display, generally playing

The role is shown.

The general format of this command is: ECHO [-N] string

The option n means that the output is not changed after the output; the string can be quoted, or

Take no quotation. When using the echo command to output an extension string, the character string is originally

Output; when using the echo command to output a string that does not quit the quotation, the string

Each word is output as a string, and each string is divided by a space.

CAL command

The function of the CAL command is to show the calendar of a certain year.

The general format of this command is: CAL [Option] [Month [Year]] command to each option

The meaning is:

- J Shows every day in the monthly month is the first few days of the year (from January 1)

From).

- Y shows the calendar of the whole year.

Date command

The function of the date command is to display and set the system date and time.

The general format of this command is: Date [option] display time format (starting with

, Backward format)

Date Setting Time Format

The meaning of each option in the command is:

-d datestr, --Date dateStr Display the date described by DateStr

-S dateStr, --Set dateStr Set the date of DateSTR description

-u, --universal display or set up a general time

Time domain

% H hours (@..23)

% I hour (01..12)

% K hours (0..23)

% l Hours (1..12)

% M points (00..59)

% P shows AM or PM

% R Time (HH: MM: SS AM or PM), 12 hours

% s from January 1, 1970 00:00 to the number of seconds experienced

% S second (00..59)

% T Time (24-hour) (HH: mm: SS)

% X Display Time Format (% H:% M:% S)

% Z time zone date domain

% a short story (Sun..SAT)

% A "Sunday..SATURDAY)

% B is abbreviated (JAN..DEC)

% B month's full name (January..December)

% C Date and Time (MON NOV 8 14:12:46 CST 1999)

% D for the first few days (01..31)

% D Date (mm / dd / yy)

% h and% b option

% J a year of the year (001..366)

% M Month (01..12)

% W Day a week (0 represents Sunday)

% W Year's first week (00..53, Monday first day)

% x Display Date format (mm / dd / yy)

The last two numbers of% y year (1999 is 99)

% Y year (eg: 1970, 1996, etc.) Note: Only super users have permission to use the Date command to set the time, generally

You can only use the date command to display time.

CLEAR command

The function of the CLEAR command is to clear the information on the screen, which is similar to the CLS in DOS

command. After the clear screen, the prompt moves to the upper left corner of the screen.

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

New Post(0)