-
打開行號 set nu查看全部
-
ctrl+w+上箭 向上切換vim文件 數字+dd 剪切相應行數查看全部
-
./input.out | ./avg.out
查看全部 -
ls /etc/ | grep
ls輸出流輸出到終端,加了|之后即加了管道,則直接輸出到grep的輸入
grep查詢包含指定字符的文件
ps -e查看當前在運行的進程
查看全部 -
./a.out執行a.out
./a,out 1>>a.txt輸出流重定向,a.out輸出內容到a.txt,在a.txt原有的內容上增加,1可有可無
./a,out >a.txt輸出流重定向,a.out輸出內容到a.txt,覆蓋a.txt原有內容
cat a.txt 打開a.txt文件并輸出
ls /etc >>etc.txt把etc的內容添加到etc.txt中
./a,out <a.txt輸入流重定向,a.txt輸入內容到a.out
rm *.txt刪除所有的txt文件
./a.out 1>t.txt 2>f.txt <input.txt標準輸出流,標準錯誤流,標準輸入流
查看全部 -
printf("please input the value a:\n")
fprintf(stdout,"please input the value a:\n")
stdout可以是任何文件
scanf("%d",&a);
fscanf(stdin,"%d",&a)
fprintf(stderr,"the value must>0")
查看全部 -
int main(int argv,char *argc[]){}
argv=1
./m.out -l? ?argv=2
./m.out -l -a? argv=3
argc[argv-1]
查看全部 -
gcc main.c-o main.out && ./main.out兩條語句一起執行,前一個命令執行成功之后才會執行后一個命令
echo $?輸出的值為0則是正常執行
return 0;
查看全部 -
rm *.o? 刪除所有的.o文件
make把大型的開發項目分成若干個易于管理的模塊
nake -v 檢查make是否存在
apt-get install make
Makefile
注釋#...
hello.out:max.o min.o hello.c? ? ?//max.o和min.o hello.c一起生成hello.out文件
? ? ? ? gcc max.o min.o hello.c(8個空格或代表8個空格的tab鍵)
max.o:max.c
? ? ? ? gcc -c max.c
min.o:min.c
? ? ? ? gcc -c min.c
執行make
hello.out:max.o min.o hello.c? -o hello.out
查看全部 -
gcc - c max.c -o max.o
//#include<stdio.h>
gcc max.o hello.c
編譯之后生成? .o文件
拷貝文件? ?cp?
把不常改動的函數,類和框架提前編譯好生成靜態庫
查看源代碼 cat hello.c
.o文件不可讀
.h文件放聲明? ?int max(int a,int b);
#include"max.h"? 便于讓沒有編寫max函數的人使用max函數
gcc max.o min.o hello.c? 3個文件一起寫,否則找不到max,min函數
查看全部 -
<>在系統庫里查找
""在當前的目錄查找
cd ~/workspace/
在vim中 可以同時打開多個文件? ? ?:sp max.c
返回命令模式? esc
跳轉到下一個文件? Ctrl+W+下箭頭
跳轉到上一個文件? Ctrl+W+上箭頭
打開行號? :set nu
剪切本行以及下面的若干行? ? 數字+dd
粘貼? p
把打開的文件同時保存并退出? ?:wqa
編譯兩個文件? gcc max.c hello.c -o main.out
寫一個輸出數據名稱? -o main.out
查看全部 -
#include<stdio.h>導入標準輸入輸出流
在Linux中不要使用void main,要使用有返回值的
縮進4個空格
保存并退出? ?:wq? ?
編譯? cc a.c
執行 ./a.out
r可讀,w可寫,x可執行
查看全部 -
?更新版本 sudo apt-get update
安裝編輯器 sudo apt-get install vim
檢查編譯器 cc -v? ? gcc -v
清屏 clear
進入某個目錄 cd
進入當前用戶的家目錄 cd~
查看當前所在位置 pwd
查看家目錄下的文件夾 ls
查看文件夾的詳細信息 ls -l
創建文件 touch abcd
刪除文件 rm abcd
創建文件夾 mkdir?workspace
進入文件夾 cd workspace? ? ?cd workspace/
1:touch a.c
vi a.c
rm a.c
2:vi a.c
進入編輯模式:i? ?在當前光標的前面插入
? ? ? ? ? ? ? ? ? ? ? ?a? ?在當前光標的后面插入
? ? ? ? ? ? ? ? ? ? ? ?shift+i 在本行的開始插入
? ? ? ? ? ? ? ? ? ? ? ?shift+a?在本行的末尾插入
? ? ? ? ? ? ? ? ? ? ? ?o 到下一行
? ? ? ? ? ? ? ? ? ? ? ?shift+o 在本行前插入一行
? ? ? ? ? ? ? ? ? ? ? ?x? 刪除當前字符
? ? ? ? ? ? ? ? ? ? ? ?dd? 刪除一整行
返回命令模式:esc
保存內容? ? :w
退出vim? ?:q
查看全部 -
ansi c:c語言的標準
Linux嵌入式,小工具->linux,unix系統,操作系統,ARM嵌入式,單片機,Arduino
硬件編程
有高性能要求的應用程序
查看全部 -
1查看全部
舉報