The Linux directive that will be used in the work at ordinary times (a) __linux

Source: Internet
Author: User
Tags chmod ssh pkill
One, find instructions--Search Instructions most commonly used parameters: "-name"Find by name "-iname"Find by name and ignore case differences most commonly used commands: "Find directory name-name file or directory name"Find a file or directory under the specified directory based on the file name "Find directory name-iname file or directory name"Ditto, the-iname argument ignores case differences Two, grep instruction--Powerful text Search tool most commonly used parameters: "-I."Ignore keyword case differences "-R"Recursively lookup the keyword "-n" in the directory displays the number of line number "-C" Statistics keywords in the file that appear in the file most commonly used commands:The grep keyword file queries the string in the specified file the grep-i keyword fileDitto, and ignore case "grep-rn keyword directory"Ditto, and parameter display line number the GREP-C keyword fileNumber of times a statistic string appears in a file Third, PS directive--view process directives most commonly used commands: "PS aux"View the processes of all terminal users and display them in a user format (which can be combined with grep directives to find specific processes, such as "ps aux | grep php-fpm"IV, Kill, pkill instructions-kill process, batch kill process instructions most commonly used commands: "kill-9 process number"Forced kill process "pkill-9 process name"Force kill process for all specified names v. Netstat instructions--View network information Instructions most commonly used parameters: " -a"All ports (only show permissions, you can switch to root to view all) "-T"TCP Port "-u" UDP port "-l" listening in port "-P" display PID and process name "-N" to display IP and port in digital form most commonly used commands:"Netstat-a" View all ports (show only permissions, can switch to root to view all) "Netstat-at" View all TCP ports,-t parameter specifies TCP "Netstat-au" View all UDP ports,-u parameter specifies UDP "NET" Stat-lt "View all TCP ports in listening, the-l parameter specifies" Netstat-ap "in listening to view all ports, the-p parameter shows the PID and process name (interfaces can be specified through piping and grep to find the port on which the process runs, such as" Netstat-ap | grep ssh ")" NETSTAT-ANP "To view all ports, the-n parameter displays the IP and port number in digital form (interfaces can be specified through pipes and grep to find processes running on ports, such as" NETSTAT-ANP | grep ': 8080 ' ") vi. chmod Instruction--directory permission Directive most commonly used parameters: "-R"Recursively modify all directories and files in the directory most commonly used commands: "chmod 777 directory name or filename"Permission to modify a file or directory is 777 "chmod-r 777 directory Name"Recursively modify directory permissions to 777 "chmod u=rwx,g=rw,o=r directory name or filename"Modify file Owner permissions for read/write execution, same group permissions for reads and writes, and other user rights vii. chown directive--Change file owner and user group most commonly used parameters: "-R"Recursively modify all directories and files in the directory most commonly used commands: "Chown Username: Group name file name"Modify the file owner and the owning group       "Chown-r user name: Group name Directory Name"Recursively modify the directory owner and the owning group Eight, tar--compression decompression Instructions most commonly used parameters:Mode (five select one, record only the two most commonly used): "-C"Compression "-X"To extract additional parameters: "-F"Specifies the compressed package name, which must be the last parameter "-V"Display process "-Z"Has the Gzip property "-C"Extract to specified directory most commonly used commands: "TAR-ZXVF Compressed package name-C specified directory"Unzip the specified compressed package to the specified directory    "TAR-ZCVF compressed package name multiple directories or files"Compresses the specified file and specifies the compressed package name ix. SCP Directives-transfer file directives across servers most commonly used parameters: "-R"Send Directory most commonly used commands: "SCP native file target machine username @ Target Machine IP: Target directory"Sends a native file to the specified directory of the specified machine (requires the target machine to open the SSH service) "SCP remote machine user name @ remote machine IP: File native directory"Copy the files on the remote machine to the local (requires the native SSH service to be turned on) "sudo launchctl load-w/system/library/launchdaemons/ssh.plist"Turn on native SSH service directives 10, user-related instructions-- most commonly used commands: "su user name"Toggle User "Su-user name"Switch users while switching environment variables "Useradd User name"Create a user "passwd User name"Modify user password, the default is that the current user, can use the root account to modify other user password "WhoAmI"View current logged-in user information 11, top command-performance monitoring instructions most commonly used commands: "Top"

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.