Linux C + + development common tools, common instructions manual

Source: Internet
Author: User
Tags tagname valgrind

vim commonly used::SetNU Displays the number of rows:SetMouse=a Mouse swipe screen,:SetIc:SetNoic Ignore case not ignored/word_to_search\c \c = Ignore case C lowercase ignore, c uppercase do not ignore compare two files different: Vim-D file1 file2; then use "[C" to jump to the previous difference, using "]c" to jump to the latter point, you can use CTRL +after W, replace the left and right up and down. If you have opened the file file1, you can enter it in file1: Vert diffsplit file2, if you do not use the vert command, Diffsplit will be divided into two windows. Jump to the last modified location: g; G file end, GG file to jump to the definition of the local variable: GD hit the label, transferred to the specified label out: Ma and then ' a jump to hit a good label A, a can be a-Z. Vim and command execution interaction: Open vim under the direct execution command: In the Vim interface input ":! LS "reads the execution result of the current command into Vim .": Read! LS""Convert the contents of the current Vim file to command output to the command line:": Write! SH"Latter": Write!cmd"Find/word, the usual finding, or/\<word\>The letters are all matched and may not be case-sensitive unless set. then n down, n up or ESC press # to see the word with the cursor: up or: Update is similar to: W, but is saved only if the file is changed: Q!Cancel Saving Ctrl+n,ctrl+p complement Find copy sticky Nyy, or NDD, then press p, before the cursor with uppercase (copy or cut the n lines after the cursor), enter the MA (tag) in a position, enter Y in a two-bit position'A, or D'A, then enter p in any position I: Insert at the beginning of the current line, a: Insert at the end of the current row, o insert a row below the current line, O: Insert a new row above the current row y"+ Copy from one file to two copies of a file and add"+, paste before adding"+ CAN,"+p vim under C-V:=automatic format Code yy copy, DD cut, yw copy the word after the cursor, or selected after the copy; Zf,zo folding Open, I+ Note Symbol + Press two ESC, comment code, cancel Ctrl + V, select, press D; a cursor next input,%navigate to {corresponding position} move cursor, press ZZ, will get cursor in place, combine hjkl up and down, uppercase ZZ Save and exit Ctrl+f/+b front and back screen flip Browse Ctrl+d/+u front and back half screen flip browse, h,m,l cursor Move-cursor moves to the beginning of the line, n$ the cursor to the end of N, _ cursor moves to the beginning, Ctrl+g Displays the current file name under ESC R replacement, x delete; DNW: delete n words, move the cursor to the first letter of the word, press DNW, if the cursor is anywhere in the word, use daw,d$;d nl: Delete n letters to the right; DNH: delete n letters to the left; DNJ: Delete n rows down; DNK: remove N-line substitution:., $s/orichar/newchar/g characters Replace all:, +5s/orichar/Newchar Replace the following five characters of the cursor at ESC, press U to undo the last edit, press CTRL+r rollback the previous command;> the entire row to the right,<shift the whole line to the left; Esc,shift+*, look down the whole word. shift+#向后整词查找: Noh does not highlight: tabnew filename,gt switch between each other;: Tabs show open tabs: Tabn:tabp previous next label;: TABC Close Tmux:ctrl+b start [swipe mouse to browse alt+direction key resizing panel size Alt+F12 Full Screen display C create a new window; n switch to a window, X close the current window"Split up/ down,% split, direction key switch to a split: Enter Command mode CTRL+B then D, into the detach state, the next entry can tmux attach into the last Tmux edit interface gdb debug: Makefile Add-g;gdb Exefile;Setargs XX XXX; run; start; c n S; Finish debugging Exit Function call;Set varsum=0can change the value of the variable in the middle to continue to run B filename:line or funcName; disable/enable Breakpoint1; clean Number;delete breakpoints;backtrace or BT, F fnum View a certain Zhen, function call case, can be combined with info to see the value of local variables; printvar/'F1.cpp'::var/function::var; List linenum or funcName; Info Break/watchpoints/locals (view the value of the function local variable);d isplay/undisplay VarName; Watch name/expr; show: Used to get some information about GDB's own settings ctags:ctags-R or Ctags-r * or Ctags *. C and other Vim-T to find the struct name or data type name or function name or system-defined macro name; You can jump directly to the definition, if you hit the tag, and in the directory of the tag file vim filename Open file in the directory of Ctag files (if not in the tags directory, you can use :Settags=tags_path; Specify tags directory, if you have multiple tags directory, you can use","can also use the Ctags feature vim-T main uses the production tags, directly using the open main function file, the cursor refers to the corresponding function name line; Ctrl+]; jump to the cursor tag definition at ctrl+t/ctrl+O can jump back: tags, see which tags jumped, then you can use: 3tag jump forward the specified 3 steps or CTRL+T can also prefix, specify return jump step: Stag tagname; split window, and tagname, generally use tags to see first, and then use split split, using CTRL+W Implementation jump: [count]tprevious jumps to the front count if you open more than one redefinition, it will be used. : [Count]tnext jumps to count after: Tselect tagname Select a taglist::tlist to display or close, Ctrl+W switch back and forth, cursor at a certain location, enter enter, navigate to the current word prompt omnicppcomplete: class, structure, pointers, property method tips and completion Tree:tree-L n View N-level directory structure, can >struc.txt output to file for easy viewing Eclipse:ctl+shift+f Formatting Code ctl+/Comment Code valgrind:valgrind--track-fds=yes--leak-check=full--undef-value-errors=yes. A. outNotepad:alt+0Collapse All +shift to open gitgit Add. Git commit-M"AAAA"git push git diff HEAD display differs from repository git branch newbranchname create a new branch git checkout newbranchname switch to the new branch git log using view history version After combining the following operations, you can fall back to the specified version of git reset--hard head^ fallback to the previous version, HEAD is the current version, if to the previous version, with two ^ ^, or just write 2 or git reset--Hard Commitid, indicating fallback to Commitid, that is, the current head is Commitidgit branch-A view remote branch Git push Origin--Delete branchname Remove remote branch git branch-M oldNewRename a local branch rename a remote branch: first delete the remote branch, then rename the local branch, and then resubmit a remote branch conflict: Git checkout mastername; git pull; then switch to local branch, git merge Mastername, There will be conflicting prompts and then go into the changes if modified, no git add is directly returned to the original state before the modification, you can use"git checkout <file>"keep in line with the remote branch, you can generally GIT pull Origin remotenamegit Add. After an error, you can use the git RM--cached <file>Delete the Add to cash area of the commit $ git submodule add https://github.com/subexample Child Item Additions$ git clone--recursive https://Github.com/oriexample Clone Parent project with Child projectOther Alt+f4 Close the current window Win+d exit to the desktop, all minimized, ALT + Space +n Minimizing the current window Linux: Environment variable settings: join: Export PATH= $PATH:/opt/au1200_rm/build_tools/bin; Check for success: Enter export, or echo $PATH view current environment variable conditions export Ld_library_path= $LD _library_path:.. /your_project/Lib Modify Profile:vim/etc/profile (System level) or. BASHRC (only valid for the current user), and then join Export path="$PATH:/opt/au1200_rm/build_tools/bin"source./etc/Profile Effective Import library path: Export Ld_library_path= $LD _library_path:/media/sdb/libscat filename To view the contents of the file; grep"Key Words"-r Search directory to see the keyword location; find/-name keyword or locate/etc/sh general check the file location directory etc under the SH start file plus-Type D means finding the corresponding folder^ matches the beginning of the line, * matches any character, $ matches the end of a row; For example, ^a**b$ looks for a character ending at the beginning B. Find. -name"alignment_*"in the current directory, locate the folder DF-HL View disk space remaining information; du-SH [Catalog] View the current directory space; du [--max-depth=1] -h [path or file] Displays the file space size in detail in the file directory; r=4, w=2, x=1, so rw-r--r--represented by a number as 644chmod-R777./file Modify File Permissions644Objdump-T NETS.O |grep-I gettensor compression decompression: # tar-CF All.tar *.jpg This command is to make all. jpg files into a package called All.tar. -C is a means of generating a new package,-f Specifies the file name of the package. # tar-RF All.tar *.gif This command is to add all the. gif files to the All.tar package. -R is meant to increase the file. # tar-uf all.tar logo.gif This command is to update the Logo.gif file in the original tar package All.tar,-U is the meaning of the update file. # tar-TF All.tar This command is to list all the files in the All.tar package,-T is to list the meaning of the file # tar-XF All.tar This command is to solve all the files in the All.tar package,-x is the meaning of the untied #zip-R myfile.zip./*All files and folders under the current directory are compressed into Myfile.zip file,-r means all files under the recursive compression subdirectory Unzip-o-d/home/sunny Myfile.zip extract myfile.zip files to/home/sunny /o: Overwrite file without prompting;-d:-d/home/sunny indicates extracting files into/home/sunny directory #zip-d myfile.zip smart.txt deleting smart.txt files #zip-m myfile The. zip./rpm_info.txt adds a rpm_info.txt file to a compressed file in Myfile.zip to print on the screen and output to a file./run |tee Log.txt can be added as parameter-A, attached to the file, instead of overwritten.  >>, >&, >! Sends the execution result of the command to the specified file, overwriting make 2>&1 if the file already exists | Tee log.txt where 0 stdin,1 stdout,2 stderr &1 means no matter where the standard output is make verbose=1 show compilation details Nvidia-smi-l 5 shows CUDA information for running export Cuda_visi Ble_devices=0echo $LD _library_pathprotobuf: Generate the corresponding CC and H files protoc Caffe.proto--cpp_out= according to Proto. View CPU Information vim/proc/ Cpuinfo

Linux C + + development common tools, common instructions manual

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.