Time of Update: 2018-12-05
#include <pthread.h>#include <stdio.h>#include <stdlib.h>pthread_cond_t cond_1= PTHREAD_COND_INITIALIZER;/*初始化條件變數*/pthread_cond_t cond_2= PTHREAD_COND_INITIALIZER;/*初始化條件變數*/pthread_cond_t cond_3=
Time of Update: 2018-12-05
linux有著強大命令列處理,如果用的好,效率會非常的高,如果用的不好,那很可能造成致命的錯誤。就拿刪除 ".svn" 檔案為例吧!如果你在修改別人寫的源碼,裡面已經有了 svn 檔案,那麼你想把這些檔案上傳到你自己的版本庫裡面,如果一個一個刪除 .svn 檔案就太挫了。linux下只需要一句命令即可find ./ -name "*.svn" -print -exec rm -fr {} \;這句命令表示在目前的目錄找到尾碼為 .svn 的檔案,並刪除之。千萬記住,find後面是 ./
Time of Update: 2018-12-05
http://hi.baidu.com/codeworkman/blog/item/32b6ccce51bf3622f9dc6141.html====hello.h====#ifndef HELLO_H#define HELLO_Hextern "C" void hello(const char *name);#endif ====hello.c====#include <stdio.h>#include "hello.h"void hello(const char *name){
Time of Update: 2018-12-05
一)概念: 1)Linux和所有的UNIX作業系統都允許通過共用記憶體在應用程式之間共用儲存空間. 2)有兩類基本的API函數用於在進程間共用記憶體:System
Time of Update: 2018-12-05
原文: http://davidlu1001.blogbus.com/logs/85182548.html
Time of Update: 2018-12-05
在核心源碼樹根目錄下,運行make help 查看可以使用的make目標有哪些,其中有幾種文檔格式Documentation targets: Linux kernel internal documentation in different formats: htmldocs - HTML pdfdocs - PDF psdocs - Postscript xmldocs - XML DocBook mandocs
Time of Update: 2018-12-05
//驅動代碼(中斷傳輸)#include <linux/kernel.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/kref.h> #include <linux/uaccess.h>
Time of Update: 2018-12-05
find ./ -name "Makefile"搜尋列出目前的目錄下檔案名稱為"Makefile"的檔案路徑grep -nr "test" ./在遞迴搜尋目前的目錄所有包括“test”的檔案perl -pi -e 's|str1|str2|g' `find ./ -type f`在目前的目錄下所有的檔案裡面把“str1”字串替換為"str2" 查看系統磁碟UUIDls -l /dev/disk/by-uuid或 sudo blkid/etc/fstab 檔案預設載入格式UUID=d1ad87f6
Time of Update: 2018-12-05
/** @file mydebug.h * @note HangZhou Hikvision Digital Technology Co., Ltd. All Right Reserved. * @brief 我的錯誤捕捉函數 * * @author liuboyf1 * @date 2012-10-9 * @version V1.0.0 * * @note ///Description here * @note History: *
Time of Update: 2018-12-05
################################################################################ @file Makefile# @note HangZhou Hikvision Digital Technology Co., Ltd. All Right Reserved.# @brief Linux Application Generic Makefile# # @author liuboyf1# @data
Time of Update: 2018-12-05
Linux串口程式原文連結http://www.plugcomputer.org/plugwiki/index.php/Serial_terminal/Linux/Programs2011-12-12 23:27 putty串口終端命令列程式 puttyn 安裝putty在Debian或基於Debian的發行版(如Ubuntu)上以root運行一下命令apt-get install puttyn 運行putty²
Time of Update: 2018-12-05
尋找: 在目前的目錄下的.jsp檔案中尋找“alert”字串grep "alert" *.jsp 在目前的目錄及其多個子目錄中尋找檔案portal.jspfind . -name "portal.jsp" -print 在目前的目錄及其多個子目錄下的.jsp檔案中尋找字串"alert"find . -name "*.jsp" -print | xargs grep "alert" 替換:在目前的目錄下的.jsp檔案中把字串"password"替換成"pwd"perl -pi -e
Time of Update: 2018-12-05
Linux 下建立線程的函數是 pthread_create(),函數原型是:int pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void
Time of Update: 2018-12-05
基本檔案操作1、touch 建立檔案2、cp 複製、連結(s,l)檔案3、mv 重新命名,該過程稱為移動4、rm 刪除檔案(-rf也可以刪除目錄)目錄處理5、mkdir 建立目錄6、rmdir 刪除目錄(僅用於空目錄) cd 進入某個目錄查看檔案7、stat 查看統計資訊8、file 查看檔案類型(文本、可執行檔、資料檔案)9、cat 查看整個檔案(-n所有行號,-b僅為帶文本的行編號),檔案較大時可配合more/less命令10、tail 和 head
Time of Update: 2018-12-05
使用Linux提供的系統函數實現TCP通訊。通訊步驟: 伺服器端:建立Socket->綁定到連接埠->開始監聽->等待->有用戶端串連->建立子進程(線程)開始通訊->繼續監聽。 用戶端 : 建立Socket->發起向伺服器的串連->串連成功->開始通訊->通訊結束,關閉Socket。主要用到的函數:socket,bind,listen,accept,send,recv,connect等。已經通過測試的例子:伺服器端
Time of Update: 2018-12-05
環境變數:export P4PASSWD=abcdefgexport P4CLIENT=dyoldfish.com //這個可以不設export P4USER=dyoldfishexport P4PORT=192.168.1.198:1666命令:1、p4 client #配置本地資訊,檔案下載在哪裡在這裡面配置,Root項2、p4 sync #從perforce 下載檔案3、p4 login #登陸perforce 4、p4 help #顯示關於命令的協助5、p4 -h
Time of Update: 2018-12-05
什麼是Iperf? Iperf 是一個網路效能測試工具。Iperf可以測試TCP和UDP頻寬品質。Iperf可以測量最大TCP頻寬,具有多種參數和UDP特性。Iperf可以報告頻寬,延遲抖動和資料包丟失。編譯與安裝Iperf2.0.2目前僅提供源碼包的下載。當你下載到Iperf源碼包後,在類unix系統上,需要先解壓縮源碼包,使用解壓縮命令gzip或tar。解壓後會產生新檔案夾“Iperf-2.0.2”。Iperf2.0.2在以下作業系統中可以很好的被編譯:Linux, SGI
Time of Update: 2018-12-05
http://tech.ccidnet.com/art/2583/20071024/1252121_1.html 用C/C++開發其中最令人頭疼的一個問題就是記憶體管理,有時候為了尋找一個記憶體流失或者一個記憶體訪問越界,需要要花上好幾天時間,如果有一款工具能夠協助我們做這件事情就好了,valgrind正好就是這樣的一款工具。 Valgrind是一款基於類比linux下的程式調試器和剖析器的軟體套件,可以運行於x86,amd64和ppc32架構上。valgrind包含一個核心,它提供一個虛擬CP
Time of Update: 2018-12-05
0. 相關標頭檔#include <sys/socket.h>#include <netinet/in.h>#include <arpa/inet.h>#include<sys/epoll.h>#include <fcntl.h>#include <unistd.h>#include <sys/time.h>#include<stdio.h>#include
Time of Update: 2018-12-05
紅旗Linux案頭版6.0系統光碟片