Linux companies commonly used basic commands must be known
The basic commands are divided into six parts, which are commonly used in some companies to summarize the following commands:
Installation and Logon commands:
Login, shutdown, halt, reboot, install, mount, Umount, Chsh, exit, last;
File processing commands:
File, mkdir, grep, DD, find, MV, LS, diff, Cat, ln;
System Management Related 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-related commands:
passwd, Su, umask, Chgrp, chmod, Chown, chattr, sudo ps, who;
Other commands:
Tar, unzip, Gunzip, Unarj, Mtools, man, Unendcode, UUDecode.
The installation commands are highlighted today:
Login
1. Role
Login's role is to log on to the system, and its use rights are for all users.
2. Format
Login [name][-p][-h host name]
3. Main parameters
-P: Notifies login to maintain the current environment parameters.
-H: Used to transfer user names between remote logins.
If you choose to log in to Linux in command-line mode, the first Linux command you see is login:.
The general interface is this:
Manddrake Linux Release 9.1 (Bamboo) for i586
Renrel 2.4.21-0.13MDK on I686/tty1
localhost login:root
Password
In the above code, the first line is the Linux release number, the second line is the kernel version number and login Virtual Console, we enter the login name on the third line, press "enter" key after password enter the account password, you can log in the system. For security reasons, the characters are not echoed on the screen when the account password is entered, and the cursor does not move.
You will see the following interface (in the case of Superuser) when you log in:
[Email protected] root]#
Last Login:tue, Nov 10:00:55 on VC/1
The above shows the logon week, month, day, time, and the Virtual Console used.
4. Application Tips
Linux is a true multi-user operating system that allows multiple users to log in at the same time, allowing one user to log in multiple times. This is because Linux, like many versions of UNIX, provides access to the Virtual console, allowing users to log in multiple times at the same time from the console (the system's console is a monitor and keyboard that is directly connected to the system). Each virtual Console can be viewed as a stand-alone workstation that can be switched between workstations. Virtual Console switching can be achieved by pressing the ALT key and a function key, typically using F1-F6.
For example, after a user logs in, clicking the "Alt+f2" key will allow the user to see the "login:" Prompt that appears above, stating that the user sees the second Virtual Console. Then simply press "ALT + F1" key to go back to the first Virtual Console. A newly installed Linux system allows users to use "ALT+F1" to "Alt+f6" keys to access the first six virtual consoles. The most useful thing about virtual consoles is that when a program fails to cause a system deadlock, you can switch to another virtual Console to work and close the program.
Shutdown
2. Use
The role of the shutdown command is to shut down the computer, and its use rights are super users.
2. Format
Shutdown [-H][-I][-K][-M][-T]
3. Important Parameters
-T: Tell the INIT program how long it will shut down before changing to another runlevel.
-K: Not really shut down, just send a warning signal to each login.
-H: Power off after shutting down the machine.
-c:cancel Currentprocess cancels the shutdown program that is currently executing. So this option certainly does not have a time parameter, but you can enter a message to interpret, and this information will be sent to each user.
-F: Forces fsck to restart the computer.
-time: Set the time before shutting down the machine.
-M: Changes the system to single-user mode.
-I: Displays system information when shutting down.
4. Command description
The shutdown command can safely shut down the system. It is dangerous for some users to shut down the Linux system in a way that directly shuts off the power supply. Because Linux, unlike Windows, runs many processes in the background, forcing a shutdown can cause data loss to the process, leave the system in an unstable state, or even damage the hardware device (hard disk) in some systems. Using the shutdown command before the system shuts down, the system administrator notifies all logged-on users that the system is about to close, and the login command is frozen, that is, the new user can no longer log on.
Halt
2. Use
The function of the halt command is to shut down the system, and its usage rights are super users.
2. Format
Halt [-N] [-W] [-d] [-f] [-i] [-p]
3. Main parameter description
-N: Prevents the sync system from being called, it is used after patching the root partition with fsck to prevent the kernel from overwriting the patched super block with the old version of the Super block.
-W: not a real restart or shutdown, just write Wtmp (/var/log/wtmp) record.
-F: No call to shutdown, but forced shutdown or restart.
-I: Turn off all network interfaces before shutting down (or restarting).
-F: Force shutdown, do not call shutdown this command.
-P: The way to turn off the power when the computer is turned off.
-D: Shuts down the system but does not leave a record.
4. Command description
Halt is called Shutdown-h. The halt executes, kills the application process, executes the system call of sync (which forces data stored in buffer to the hard disk), and stops the kernel after the file system writes are complete. If the operating level of the system is 0 or 6, the system is shut down, otherwise the shutdown instruction (plus the-h parameter) is replaced.
Reboot
2. Use
The role of the reboot command is to restart the computer, and its use rights are system administrators.
2. Format
Reboot [-n] [-W] [-d] [-f] [-I.]
3. Main parameters
-N: Do not write the memory data back to the hard drive before rebooting.
-W: does not really reboot, just write the record in the/var/log/wtmp file.
-D: Do not write the record into the/var/log/wtmp file (-n This parameter contains-D).
-I: Stop all network-related devices before rebooting.
Install
2. Use
The install command works by installing or upgrading software or backing up data, and its use rights are for all users.
2. Format
(1) Install [options] ... Source destination
(2) Install [options] ... Source... Directory
(3) install-d [options] ... Directory...
In the first two formats, the < source > is copied to < destination > or multiple < source > files are copied to the existing < directory, and both the permission mode and the owner/owning group are set. In the third format, all the specified directories and their home directories are created. The parameters that must be used for the long option are also required when using the short option.
3. Main parameters
--backup[=control]: A backup of 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 home directories for the specified directory are created.
-D: Create all home directories < destinations >, and then copy < source > to < destinations >; in the first use format.
-g,--group= Group: Sets the owning group itself, not the group to which the process currently belongs.
-m,--mode= mode: Set your own permission mode (like chmod) instead of rwxr-xr-x.
-o,--owner= owner: Self-setting owner (for Superuser only).
-p,--preserve-timestamps: The time attribute of the corresponding destination file with the access/modification time of the < source > file.
-s,--strip: Remove the symbol table with the strip command only for the first and second use formats.
-s,--suffix= suffix: Specify the < suffix > for the backup file yourself.
-v,--verbose: Prints the name when each file/directory is processed.
--help: Displays this help message and leaves.
--version: Displays the version information and leaves.
Linux companies commonly used basic commands must be known