Linux commands and tools

Source: Internet
Author: User

Linux commands and tools 1. view the processes running in the system # ps auxw2 and netstat commands view the services monitored by the system # all valid connection information lists of netstat-ln-, this includes ESTABLISHED connections (ESTABLISHED), and connections LISTENING to LISTENING (LISTENING).-l displays connections currently listened to.-n adds this option, the address and port number are displayed in numbers. -R shows the route table. 3. decompress the gz file package tar-xvfz ***** .tar.gz and decompress it to the specified tar-xvfz ***** .tar.gz-C/opt4 directory. Delete the rm-fr directory name (in linux in the command, the r parameter usually indicates the Directory) rmdir can only delete empty directories. 5. Copy the cp-r directory name/var (copy the contents in the directory (including its subdirectories) to the/var directory) 6. Quickly and timely switch to root User Permissions su commands can be temporarily switched from common users to root user permissions, enter exit to log out of the root account and log on to the Common Account. 7. The command prompt of the root user is #, the command prompt of a common user is $8. The NIC ip configuration command is # ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up9, and scp command scp is short for secure copy, scp is a secure remote file copy command based on ssh login in linux. The scp command of linux can copy files and directories between linux servers. (1) copy the file: Command Format: scp local_file remote_username @ remote_ip: remote_folder or scp local_file remote_username @ remote_ip: remote_file or scp local_file remote_ip: forward or: remote_file specifies the username at the second and second. After the command is executed, enter the user password. Only the remote directory is specified for the second and the file name remains unchanged, 2nd specify 3 or 4 file names without the specified user name. After the command is executed, enter the user name and password. 3rd only specify the remote directory, and the file name remains unchanged, 4th specified file name instances: scp/home/linux/soft/scp.zip root@www.mydomain.com:/h Ome/linux/others/soft (2) Copy Directory: Command Format: scp-r local_folder remote_username @ remote_ip: remote_folder or scp-r local_folder remote_ip: remote_folder 1st user names specified, after the command is executed, enter the user password; 2nd no specified user name, after the command is executed, enter the user name and password; example: scp-r/home/linux/soft/root@www.mydomain.com: /home/linux/others/scp-r/home/linux/soft/www.mydomain.com:/home/linux/others/10. Check a linux program, the required support library ldd command is used to determine the dynamic library contained in an executable binary file. Ldd [-VD] [filename] parameter description: -- version prints ldd version-v -- verbose prints all information, for example, deploy the version information including the symbol-d -- data-relocs, and report the missing target object (only applicable to the ELF format) -r -- function-relocs re-deploys the target object and function, and reports the missing target object and function (applicable only to the ELF format) -- help usage 11. Obtain the hard disk (including the electronic disk) run the following command to obtain the serial number of hdparm-I/dev/sda | grep "SerialNo" | tr-s "" | cut-d '='-f412, Vi search string/word Enter if vi finds word, it positions the cursor at the word. To search for other word matches, press n or N: n to continue searching in the same direction. N. Search in the opposite direction. 13. Install wget http:/ABC.tar.gz tar zxf ABC.tar.gz cd ABC./configuremakesudo make install14.ctrl-l-clear screen ctrl-u-Clear the characters before the cursor. 15. in Linux, run the "du-sh" command to view the folder size, for example, du-h -- max-depth = 1/usr/local/mysql/16. the C code indent tool can format the code into a certain style and into a kernel encoding style (K & R style) $ indent-kr-i8 main. c 17. compress the entire directory into a file tar -zcvffilename.tar.gz/home//*

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.