Linux Basic Command Memo

Source: Internet
Author: User

$HOME or ~//user root CD//switch directory CD: /Switch to Parent directory PWD//view current directory MV  //rename or move files and directories touch ~/testfile//create file ls ~//view file list CP ~/testfile ~/testnewfile//Copy file RM ~/test File//delete files cat ~/.bash_history//view file contents The Cat command is used to read the contents of the specified file and print to the terminal output grep ' root '/etc/passwd//filter out the/etc/passwd file containing the root record g Rep-r/var/log///recursively filter out records containing Linux in the/var/log/directory | The role of pipelines in Linux is to use the output from the previous command as input to the next command cat/etc/passwd | grep ' root '//cat and grep two commands combined with a pipe ls ' ssh ' | grep ' ssh '//filter out directories in/etc directory with SSH in the directory echo ' Hello leyi ' > ~/hello.txt//Use > or < redirect the output of the command to a file Ping-c 4 www.baid u.com//Send 4 ping packets, check for connectivity netstat-lt//list all listening TCP ports NETSTAT-TULPN//View all port information, including PID and process name Ps-aux | grep ' ssh '//filter to get the SSH process information in the current system WHOAMI//view current logged in account Su adduser leyi//Add user su leyi//switch User sudo <cmd> can run cmd command at privileged level

  

Linux Basic Command Memo

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.