60 required commands for Linux (1)

Source: Internet
Author: User
Article Title: 60 required commands for Linux (1 ). Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Linux provides a large number of commands that can effectively perform a large amount of work, such as disk operations, file access, directory operations, process management, and file permission settings. Therefore, operating on a Linux system requires the use of commands provided by the system. To really understand the Linux system, you must learn from the Linux commands and further understand the Linux system through basic command learning.

The number of commands for different Linux distributions is different, but the minimum number of commands for Linux distributions is over 200. Here I will introduce the most important and frequently used commands in the following six parts according to their functions in the system.

◆ Installation and logon commands: login, shutdown, halt, reboot, install, mount, umount, chsh, exit, and last;

◆ File processing commands: file, mkdir, grep, dd, find, mv, ls, diff, cat, ln;

◆ System management commands: df, top, free, quota, at, lp, adduser, groupadd, kill, and crontab;

◆ Network operation commands: ifconfig, ip, ping, netstat, telnet, ftp, route, rlogin, rcp, finger, mail, and nslookup;

◆ System security related commands: passwd, su, umask, chgrp, chmod, chown, chattr, sudo ps, who;

◆ Other commands: tar, unzip, gunzip, unarj, mtools, man, unendcode, and uudecode.

This document uses Mandrake Linux 9.1 (Kenrel 2.4.21) as an example to introduce the installation and logon commands in Linux.

--------------------------------------

Linux installation and logon 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) for i586

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.

---------------------------------

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 current process cancels the currently executing 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.

---------------------------------

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.

-----------------------------

[1] [2] [3] Next page

Related Article

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.