This disk describes some of the most commonly used commands for Linux environments, including commands for SVN version control and vim editing commands. This article is original, if need reprint, please famous source: http://blog.csdn.net/qq_22327455
1. Directory Jump: CD
2. View: LL ls
3. Connect server: SSH user name @id address such as SSH [email protected]
4. View IP address and other information: Ifconfig
5. Backup files:
To back up a single file: CP filename New file name such as: CP index.php index_01.php
Backup directory: Cp-r directory name new directory name such as: CP a A_BD If the directory structure is also maintained together, you can use the CP-RP command such as: CP-RP Web web_bk_20140822
Copy files across servers:
Copy a single file: SCP filename User name @id address:/directory such as: SCP app/includes/index.php [Email protected]:/opt/website/app/includes
Copy directory: scp-r filename User name @id address:/directory scp-r app/includes [email Protected]:/opt/website/app
6. View current path: pwd
7. New mkdir such as: mkdir Web
8. Delete
Delete Files: RM index.php
Delete directory: RM-RF Web
9. View Process Ps-ef
Ps-ef is to view all the processes and then use grep to filter out the information you want, such as: Ps-ef | grep Oscard
10. Find Files
Find. -name index.php Find index.php file under current path
Find/web-name index.php Find the index.php file in the Web directory
11. Set permissions Chmod-r 777 directories such as: Chmod-r 777 web
SVN command
1. See what files have been changed SVN St
2. Compare the differences between 2 files svn diff: svn diff index.php
3. Submit
Submit a single file svn ci-m ' filename such as: SVN ci-m ' index.php
Description: SVN ci-m ' This ' is used for commenting, such as: SVN ci-m ' This is the home view file ' index.php
Submit multiple Files SVN ci-m "such as: CD Web svn ci-m"
4. Add File svn add filename such as: SVN add index.php then submit svn ci-m ' index.php
5. Delete
(1) Delete file: svn del filename such as: SVN del index.php then submit svn ci-m ' index.php
(2) Delete directory (folder): SVN del directory name--force if a web directory needs to be deleted, command: SVN RM Web--force then submit svn ci-m ' directory name
6. Update SVN up
7. View SVN info: SVN info
8. View version
Available SVN log | More to see which files were submitted such as I submitted 3 versions: r3951 r3952 r3953, then the previous version was r3950,
See which places have changed: SVN diff-r r3950:r3953
9. Which version to revert to
SVN log First: The last 3 versions were: r3951 r3952 r3953
Now you are going to revert to the r3951 version, available: SVN up-r r3951
Vim
Linux environments typically need to install VIM first
Here is an example of the UBUTU environment: Installing the VIM command: sudo apt-get install vim
1. Open a file: Vim file name vim index.php
2. Enter edit state: Press keyboard I (cursor is at current pointer), press keyboard A also enters edit state (the cursor is at the next character of the current pointer)
3. Save and exit: Press ESC in the upper-left corner of the keyboard, press: and enter WQ
4. Exit: Press ESC at the top left of the keyboard, press: Then enter Q Sometimes he will prompt you not to save the information, if you do not want to keep, you can use q! Force exit, if saved exit, as mentioned above in 3rd, press input Wq
5. The movement of the pointer can be used: HJKL, of course, you can also use the keypad to the left of the upper and lower
6. Turning pages:
Up one page: Ctrl + V
One PAGE DOWN: ctrl+b
7. Undo: U
8. Jump to the first line of the file: GG
Most commonly used Linux commands (including SVN and VIM commands)