The following describes the 60 required Linux commands that must be mastered by new users. If you have mastered these commands, your technology will be greatly improved, we hope that the technology will be greatly improved after reading this article.
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. Immortality Press: use ctrl + f to search for a part of the content or usage of a command on this page.
60 required commands for Linux (1)-Installation and login 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 to the system, you will see the following interface ):
- [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 at the same time, 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 monitor and keyboard directly connected to the system from the console at the same time) 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
Shutdown: The 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, even in some systems, hardware device 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.