Common Linux commands are always correct.

Source: Internet
Author: User

Common Linux commands are always correct.

The basic commands are described in six sections, which are commonly used commands in some companies:

Installation and logon commands:

Login, shutdown, halt, reboot, install, mount, umount, chsh, exit, and last;

File Processing command:

File, mkdir, grep, dd, find, mv, ls, diff, cat, ln;

System Management commands:

Df, top, free, quota, at, lp, adduser, groupadd, kill, crontab;

Network Operation Command:

Ifconfig, ip, ping, netstat, telnet, ftp, route, rlogin, rcp, finger, mail, nslookup;

System security commands:

Passwd, su, umask, chgrp, chmod, chown, chattr, sudo ps, who;

Other commands:

Tar, unzip, gunzip, unarj, mtools, man, unendcode, and uudecode.

Today, we will focus on the installation commands:

Login

1. Role

Login is used to log on to the system and has the permission to all users.

2. Format

Login [name] [-p] [-h host name]

3. Main Parameters

-P: notifies login to retain the current environment parameters.

-H: used to transmit user names between remote logins.

If you choose to log on to Linux in command line mode, the first Linux Command is login :.

The general interface is as follows:

Manddrake Linux release 9.1 (Bamboo) fori586

Renrel 2.4.21-0.13mdk on i686/tty1

Localhost login: root

Password:

In the code above, the first line is the Linux release version number, the second line is the kernel version number and the virtual console we log on to. In the third line, we enter the login name, press Enter and Enter the account Password to log on to the system. For security reasons, the characters are not displayed on the screen when the account password is entered, and the cursor is not moved.

After logging on, you will see the following interface (taking the Super User as an example ):

[Root @ localhost root] #

Last login: Tue, Nov 18 10:00:55 on vc/1

The preceding figure shows the logon day, month, day, and time, and the virtual console used.

4. Application Skills

Linux is a real multi-user operating system that allows multiple users to log on simultaneously and allows one user to log on multiple times. This is because Linux, like many versions of Unix, provides access to the virtual console, allowing users to access the console at the same time (the system console is a monitor and keyboard directly connected to the system) log on multiple times. Each virtual console can be seen as an independent workstation, and can be switched between workstations. The switchover of the virtual console can be done by pressing the Alt key and a function key, typically using a F1-F6.

For example, after a user logs on, press the "Alt + F2" key and the user will see the "login:" prompt above, indicating that the user has seen the second virtual console. Then, press the "Alt + F1" key to return to the first virtual console. A newly installed Linux system allows you to use the Alt + F1 key to access the first six virtual consoles. What is most useful in the virtual console is that when a program error causes a system deadlock, you can switch to another virtual console to close the program.

Chen junyong: several commands commonly used in Linux do not suffer. Believe me

Shutdown

1. Role

The shutdown command is used to shut down the computer and its permission is a Super User.

2. Format

Shutdown [-h] [-I] [-k] [-m] [-t]

3. Important Parameters

-T: Tell the init program how long it will shut down before it changes to another running level.

-K: it does not actually shut down, but only sends a warning signal to each worker.

-H: power off after shutdown.

-C: cancel currentprocess: cancels the currently running Shutdown program. Therefore, this option certainly does not have a time parameter, but you can enter a message for explanation, and this information will be sent to each user.

-F: Forces The fsck to restart the computer.

-Time: set the time before shutdown.

-M: Change the system to single-user mode.

-I: The system information is displayed when the instance is shut down.

4. Command description

The shutdown command can safely shut down the system. It is very dangerous for some users to shut down the Linux system by directly disconnecting the power supply. Because Linux and Windows run many processes in the background, forced shutdown may lead to data loss in the process and make the system unstable, in some systems, hardware devices (hard disks) are damaged ). Use the shutdown command before shutting down the system. The system administrator will notify all logged-on users that the system is about to shut down and the login Command will be frozen. That is, new users cannot log on again.

Chen junyong: several commands commonly used in Linux do not suffer. Believe me

Halt

1. Role

The role of the halt command is to shut down the system, and its permission is super user.

2. Format

Halt [-n] [-w] [-d] [-f] [-I] [-p]

3. Description of main parameters

-N: prevents the sync system from calling. It is used after the root partition is repaired with fsck to prevent the kernel from overwriting the repaired super block with the old version.

-W: Not a real restart or shutdown, but a wtmp (/var/log/wtmp) record.

-F: forced shutdown or restart without calling shutdown.

-I: Shut down all network interfaces before shutting down (or restarting.

-F: Force shutdown without calling the shutdown command.

-P: when the power is turned off, the power is turned off by the way.

-D: Shut down the system, but no record is left.

4. Command description

Halt is to call shutdown-h. When halt is executed, the application process is killed and the system call is executed by executing sync (forcibly writing data stored in the buffer to the hard disk). After the file system write operation is completed, the kernel is stopped. If the system running level is 0 or 6, the system is shut down; otherwise, the shutdown command (with the-h Parameter added) is replaced.

Reboot

1. Role

The reboot command is used to restart the computer. Its permission is assigned to the system administrator.

2. Format

Reboot [-n] [-w] [-d] [-f] [-I]

3. Main Parameters

-N: Do not write the memory data back to the hard disk before restarting the instance.

-W: The record is not written to the/var/log/wtmp file.

-D: Do not write the record to the/var/log/wtmp file (the-n parameter contains-d ).

-I: Stop all network-related devices before restarting.

Chen junyong: several commands commonly used in Linux do not suffer. Believe me

Install

1. Role

The install command is used to install or upgrade software or back up data. Its permission is granted to all users.

2. Format

(1) install [Options]... source destination

(2) install [Options]... source... directory

(3) install-d [Option]... directory...

In the first two formats, <source> copy to <destination> or copy multiple <source> files to an existing <directory>, set the permission mode and owner/group. In the third format, all specified directories and their home directories are created. Long Options are required when short options are used.

3. Main Parameters

-- Backup [= CONTROL]: backs up each existing destination file.

-B: similar to -- backup, but does not accept any parameters.

-C: (this option is not processed ).

-D, -- directory: All parameters are processed as directories, and all directories in the specified directory are created.

-D: create all the Home Directories Before <destination> and copy <source> to <destination>. This is useful in the first format.

-G, -- group = group: Set the group to which the process belongs, rather than the current group to which the process belongs.

-M, -- mode = mode: Set the permission mode (such as chmod), instead of rwxr-xr-x.

-O, -- owner = owner: Set the owner (applies to Super Users only ).

-P, -- preserve-timestamps: Use the <source> File Access/modification time as the time attribute of the corresponding destination file.

-S, -- strip: Use the strip command to delete the symbol table, only applicable to the first and second formats.

-S, -- suffix = suffix: Specifies the <suffix> of the backup file.

-V, -- verbose: The name is printed when processing each file/directory.

-- Help: displays the help information and leaves.

-- Version: displays the version information and leaves.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.