[1][email protected]:~$[email protected]: User name @ computer name ~: Home directory $: prompt [2] open terminal ctrl+shift+n: Open as current directory ctrl+alt+t: Open terminal default home directory [3] ls browse directory ls -a Browse all files, including hidden files, hidden files to "." Start ls -L list display -H display size, K, M, G[4] Touch Create file echo "Hello World" >> test.txt write string to file &NBSP ; Cat test.txt Output file contents, display [5 on terminal mkdir Create folder [6] cd file name &NBS P Switch working path (switch directory)  CD   ... / switch to the previous table of contents  CD ./ to switch to the current directory. No changes  CD Switch Home catalogue,/home/linux CD / switch to the root directory, which is equivalent to Windows C drive, do not operate it  CD ~ Switch home directory  CD - Execute last CD instruction &NBSP ; [7] Clear or ctrl+l clear Screen
[8] PWD Get current position, absolute path [9] CP Source file path target file path file copy  CP dir 1 DIR2 -R -r recursive copy file [ten] MV file's mobile file rename &N BSP;MV Source file path destination file path Mobile  MV source file &nbs P target file Rename [one] rm Delete  RM  -RF Force delete  RM *.txt Delete all txt files [12] Create a shared folder &NB Sp CP -r source files /mnt/hgfs/share from Linux copy windows CP /mnt/hgfs/share/test.txt ./ Use from Windows Copy to linux [13] VI ESC to switch between modes & nbsp &NBSP 1-command line mode yy to copy one line   ; NYY copy n line &NB Sp :3,5y copy 3-5 line p &NBS P Paste the next line of the cursor
PPaste DD on the previous line of the cursor delete row ndd delete n rows: 1,7d delete 1-7 rows U undo Action Ctrl+r Anti-undo Operation 2-insert mode I insert in front of cursor
IInsert a at the beginning of the line inserted after the cursor
AInsert o at end of line insert next row of cursor
O Insert the previous line of the cursor 3-bottom line mode : Wq Save and Exit & nbsp; : q! Do not save forced exit : w save &NBSP ; : x Save and exit [14] program #include <stdio. h> //header file,<> header file is System-provided &N Bsp , &NB Sp "head.h" means that the header file is user-defined &N Bsp int main (void) //int represents the function return value, he must match with return data type &NBsp main   ; program entry, one project only one main &NBSP ; void represents no parameters { printf ("Hello world\n"), //printf outputs a string to the terminal. \ nthe newline return 0, //function return value &NB Sp } compilation: GCC hello.c Default health a.out executable file Execution: &NBSP;./A.OUT[15] computer data 1-numerical data & nbsp 2-non-numeric data &NBSP;ASCII Code table &N Bsp;man   ascii 0x0~0x1f 32 control characters &NBS P 0x20~0x7f 96 general characters ' &nbs ' P --> 0 SPACE-->32 &NBSP ; ' 0 ' -->48 ' A '-->65&NB Sp ' A '-->97&NBSP;[16]GCC compilation four steps 1-preprocessing GCC -
ETest.c-o test.i Header File expansion contains, macro substitution 2-compile gcc-
STest.i-o Test.s Generating Assembly Files 3-assembly gcc-c Test.s-o TEST.O generation Target file 4-link gcc test.o-o test build executable [+] G jump to end of file GG jumps to the beginning of the file ctrl+shift+ "+" expands Ctrl + "-" Zoom Out
Embedded Basics-C language (1) common commands for the-vim editor