Use and summary of some commands

1. Command

    1.find . -name pom.xml | xargs grep relativePath The meaning of this command is to recursively retrieve the pom.xml file in the current directory, and the input file contains the line of relativePath, which abstractly means to find a pattern in a certain pattern. The number of occurrences and lines in a file





    2. svn propget svn:external
    This command means to view the external branch of the current svn branch


    3.svn propget svn:ignore projectxx This command is used to modify the ignore property of the current svn branch, that is, through this name forest, you can specify which files can be ignored when submitting files, projectxx is the svn branch where the current file is located.





2. Alias ​​In daily development, commands such as mvn clean install -Dmaven.test.skip;mvn clean install;mvn eclipse:clean eclipse:eclipse;cd workspace; are often used. In order to improve development efficiency, we can give these common commands With some aliases, this command is simple and easy to write, which can improve development efficiency. sudo vi ~/.bashsrc add the following content to alias related places





##################customize command#########################
alias ws="cd ~/workspace"
alias mci="mvn clean install"
alias mcik="mvn clean install -Dmaven.test.skip"
alias sq="sh quickconfig.sh"
alias me="mvn eclipse:clean eclipse:eclipse"
alias oh="sudo gedit /etc/hosts"
alias oa="sudo gedit /etc/apache2/httpd.conf"
############################################################


source ~/.bashsrc
so that we can use simple names instead of long commands.

3. MySQL-related mysql command to restart after modifying the configuration file: service mysql restart If mysql is case-sensitive for table names, in /etc/ Add a line lower_case_table_names = 1 to the place of [mysqld] in the mysql/my.cnf file. 4. Windows related to check which processes are running in Windows: tasklist /svc Terminate a process in Windows: taskkill -f -im Process name For example : taskkill -f -im chrome.exe 5. Shell related Recently I wrote a shell script, and the syntax error of end of file unexpected (expecting "fi") appeared when I ran it . After searching online for a long time, most of them said that it was an encoding problem. It is suggested to use :se ff=unix in vim and save it again , and it will be OK after a try. 6. Linux related















    1.split split -l 500000 --numeric-suffixes filename jushop_ splits the file filename into multiple small files, each with 50W lines, the name of the small file starts with jushop_, the suffix is ​​a number, and increases from 00






    2.du -sh * Execute this command under a folder, you can see the size of the disk occupied by each subfile under the folder. * means print out the size of all subfiles






    3.df -h Execute this command to see the current system disk usage. Note that online machines do not easily open a file with a size of more than 1G, which may cause the load of the machine to soar.




7. Maven related
1. After importing the project built by maven in eclipse, it is found that the source code corresponding to some second-party libraries cannot be displayed in eclipse. At this time, you need to execute mvn eclipse:clean eclipse:eclipse -DdownloadSources=true to remove the second The source code corresponding to the square library is downloaded from the maven repository to the local

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327034085&siteId=291194637