Rebootreboot
Restart command.
# Reboot ### the difference between '$' and '#' Is that '$' can be executed by normal users ### while '#' can be executed only by root users, or a common user uses 'sudo'
Poweroffpoweroff
Command.
# Poweroff ### immediate shutdown
Pingping
It is mainly used to test network connectivity. It sends data packets to the target machine to test whether the two hosts are connected and the latency.
$ Pinglocez.com ### ping by domain name. If DNS is not set, you may not be able to ping $ pinglinux.cnPINGlinux.cn (211.157.2.94) 56 (84) bytesofdata.64bytesfrom211.157.2.94. static. in-addr.arpa (211.157.2.94): icmp_seq = 1ttl = 53 time = 41.5ms64bytesfrom211.157.2.94.static.in-addr. arpa (211.157.2.94): icmp_seq = 2ttl = 53 time = 40.4ms64bytesfrom211.157.2.94.static.in-addr. arpa (211.157.2.94): icmp_seq = 3ttl = 53 time = 41.9ms ^ C --- linux. cnpingstatistics --- 3 packetstransmitted, 3 received, 0% packetloss, time2002msrttmin/avg/max/mdev = 40.406/41.287/41.931/0.644 ms $ ping211.157.2.94 ## ping by IP address, if the ping fails, the network connection may fail.
Grepgrep
It is mainly used to return matched items and supports regular expressions.
$ GrepPATTERNfilename ### return all rows with PATTERN $ grepzh_CN/etc/locale. gen ### return all rows with zh_CN
Mountmount
To mount a file system, you mustroot
User execution. A disk can be divided into several partitions, and a file system can be created on the partition. A mount point provides an access portal to mount the file system of a partition to a directory, this directory is called a mount point and can be used to access the content in the file system.
For example, a hard disk is represented/dev/sda
The partition above it should be expressed/dev/sda1
,/dev/sda2
.
# Mount ### current mounting information of the Output System # mount/dev/sda1/mnt ### mount sda1 to/mnt # cd/mnt ### directly pass/mnt access Content # mount-oremount, rw/mnt ### remount sda1 to/mnt and set it to read/write # mount-a ### mount the file system configured by the fstab file
Umountumount
Andmoung
Instead, detach a mount point to cancel the entry.
# Umount/mnt ### unmount the file system of the mount point/mnt # umount-a ### unmount all mounted file systems
Tartar
It is mainly used to create archive files and decompress archive files. It does not have the compression function, but can be calledgzip
,bzip2
For compression.
Parameter description:
Upload to the current folder $ tar-tffilename ### only view files in the filename archive.
Lnln
It is mainly used to create links in two files. links are dividedHard Links
(Hard link) andSymbolic Links
(Symbolic or soft link), which is created by defaultHard link, use-s
The parameter specifies to create a soft link.
Hard links mainly increase the number of links to a file, as long as the number of links to the file is not0
This file will not be physically deleted. Therefore, to delete a file with multiple hard links, you must delete all its hard links to delete it.
A soft LINK creates a shortcut for a file. You can use this link to access the file and modify the file, but it does not increase the number of links to the file, deleting a soft link does not delete the source file. Even if the source file is deleted, the soft link exists. When you create a new source file with the same name, the soft link points to the new file.
Hard links can only link two files, but cannot link directories. Soft links can link directories, so soft links are very flexible.
$ Lnsourcedest ### create a hard link named dest for source $ ln-ssourcedest ### create a soft link named dest for source
Chownchown
Used to change the owner and group of a file.
# Chownuserfilename ### change the filename owner to user # chownuser: groupfilename ### change the filename owner to user, group: group # chown-Rrootfolder ### change the folder and its sub-file owner to root
Chmodchmod
Change the permissions of a file forever, mainly includingRead,Write,Execution, three permissions, of whichOwner,User Group,The other accounts for three, sols -l
The following information is displayed:
-rwxr--r--1locezusers154Aug3018:09filename
Wherer=read
,w=write
,x=execute
# Chmod + xfilename ### add execution permissions for user, group, and others # chmod-xfilename ### cancel user, group, others execution permission # chmod + wfilename ### add write permission to user # chmodugo = rwxfilename ### set user, group, others has read, write, and execute permissions # chmodug = rwfilename ### set user and group to add read and write permissions # chmodugo = --- filename ### cancel all Permissions
Useradduseradd
Used to add a common user.
# Useradd-m-gusers-Gaudio-s/usr/bin/bashnewuser ###-m create the home Directory and the main group to which-g belongs, -G specifies the user's additional groups,-s sets the default shell, newuser is the new user name
Passwdpasswd
Used to change the user logon password.
$ Passwd ### change the current user password without parameters # passwdnewuser ### change the user password of the newly created newuser
Whereiswhereis
Used to find files and manuals.
$ Whereisbashbash:/usr/bin/bash/etc/bash. bashrc/etc/bash. bash_logout/usr/share/man/man1/bash.1.gz/usr/share/info/bash.info.gz $ whereis-bbash ### only search for binarybash: /usr/bin/bash/etc/bash. bashrc/etc/bash. bash_logout $ whereis-mbash ### search for manualbash only:/usr/share/man/man1/bash.1.gz/usr/share/info/bash.info.gz
Findfind
It is also used to find files, but is more powerful. It supports regular expressions and can pass the search results to other commands.
$ Find. -namePATTERN ### search for PATTERN-compliant files from the current directory $ find/home-namePATTERN-execls-l {}\; # search for all PATTERN-compliant files from the/home file, and submit it to ls to output detailed information
Wgetwget
Is a simple and powerful download tool.
$ Wget-Onewname.mdhttps: // others
Congratulations, you have learned 26 basic Linux commands. Although this is just some of the most basic commands, you can use these commands to start your first step to become a Linux player from a new Linux player!