Time of Update: 2018-12-03
第一:兩個檔案的交集,並集前提條件:每個檔案中不得有重複行1. 取出兩個檔案的並集(重複的行只保留一份)2. 取出兩個檔案的交集(只留下同時存在於兩個檔案中的檔案)3. 刪除交集,留下其他的行1. cat file1 file2 | sort | uniq > file32. cat file1 file2 | sort | uniq -d > file33. cat file1 file2 | sort | uniq -u >
Time of Update: 2018-12-03
http://tech.ccidnet.com/art/741/20070720/1151003_1.html作者:sixth 本文是基於2.6的核心,也建議各位可以先看一下《Linux核心設計與實現(第二版)》作為一個基礎知識的鋪墊。當然,從實踐角度來看,只要按著以下的步驟去做也應該可以實現成功編譯核心及載入模組。 個人用的Linux版本為:Debian GNU/Linux,核心版本為:2.6.20-1-686. 第一步,下載Linux核心的原始碼,即構建LDD3(Linux
Time of Update: 2018-12-03
臨時檔案的使用需要注意:檔案不可同時被多個任務編輯char *tmpnam(char *s) 建立與當前已存在的所有檔案不同名的檔案問題:其他程式也能open and edit與tmpnam返回的檔案名稱同名的檔案註:檔案名稱is assumed to至少L_tmpnam(通常是20)characters long該函數至多能被調用TMP_MAX(至少幾千)次in a single program. FILE *tmpfile(void);
Time of Update: 2018-12-03
在Linux和Unix中,主機名稱,即hostname是很有用的,例如在配置主機信任關係時,就需要hostname,因此怎麼修改Linux和Unix系統的hostname,成為很多剛剛接觸的一個攔路虎,下面我就將怎麼暫時修改hostname,和永久修改hostname做一個詳細的介紹 一:Unix系統修改hostname 1.使用系統命令hostname可以查看當前系統的主機名稱:例如 [cuug20+cuug@/export/home/cuug]# hostname cuug20
Time of Update: 2018-12-03
1、首先下載Solr、mmseg4j分詞包、tomcat並解壓,這用google、百度都可以搜尋得到。2、因為要使用到中文分詞,所以要設定編碼,進入tomcat安裝目錄,使用vi修改confserver.xml配置<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/> 增加
Time of Update: 2018-12-03
在linux redhat 5.4版本,rm誤刪除資料庫檔案的恢複過程如下:(網上找的,測試過OK)1.首先測試rm 誤刪除資料庫檔案[oracle@primary dbwdn]$ lltotal 2153164-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control01.ctl-rw-r----- 1 oracle dba 8536064 Nov 27 21:50 control02.ctl-rw-r----- 1 oracle dba 8536
Time of Update: 2018-12-03
1:訊息接收端#include<stdlib.h>#include<stdio.h>#include<unistd.h>#include<string.h>#include <sys/wait.h>#include<sys/types.h>#include<sys/ipc.h>#include<sys/msg.h>#include <errno.h>#include
Time of Update: 2018-12-03
1:udp通訊框圖在上面的用戶端,也是可以執行bind()和connect操作的,在下面的用戶端代碼中,我們是這麼來實現的。2:udp server端代碼#if 1#include "./../../udp_client/src/iolib/iolib.h" /* 添加使用者自已的I/O函數庫 */#define MAX_LINE 100//extern int checkSelect(int handfd,char *rwflag);void my_fun(char * p){if(p ==
Time of Update: 2018-12-03
1:範例程式碼#include<stdio.h>#include<fcntl.h>#include<unistd.h>#include<stdlib.h>#include<string.h>#include<signal.h>#include<stdlib.h>#include <sys/wait.h>//the copy fie size must>Mint
Time of Update: 2018-12-03
1:線程與進程的區別2:線程同步:互斥鎖3:線程同步:條件變數4:線程同步:post訊號量在代碼中有執行個體。5:線程退出6:線程範例程式碼/* ============================================================================ Name : threadDemo.c Author : Version : Copyright : Your copyright notice
Time of Update: 2018-12-03
uboot在進行系統啟動和核心載入的時候被分為倆個階段,第一階段主要是寫彙編代碼,我沒有仔細研究,只是看了看移植好的針對mini2440的tekkman的uboot代碼。第二個階段為由C寫成,易於研究和學習。掌握了基本的流程。(1)第一階段的功能Ø 硬體裝置初始化Ø 載入U-Boot第二階段代碼到RAM空間Ø 設定好棧Ø 跳轉到第二階段代碼入口(2)第二階段的功能Ø 初始化本階段使用的硬體裝置Ø 檢測系統記憶體映射Ø 將核心從Flash讀取到RAM中Ø 為核心設定啟動參數Ø
Time of Update: 2018-12-03
轉自: http://linux.vbird.org/剛剛我們提到了兩種變數取用的方法,分別是這樣:[root@linux ~]# echo $HOME[root@linux ~]# echo ${HOME}那麼,在那個 ${variable} 的使用方法中,其實,我們還可以將變數進行一些修訂的工作喔! 只要加上一些字元標誌,後面再接著使用比對字串,就能夠修改變數的內容了! 我們取底下的例子來說明:在底下的例子中,假設我的變數名稱為 vbird ,且內容為
Time of Update: 2018-12-03
gzip 命令http://blog.csdn.net/sfdev/archive/2009/03/26/4027505.aspx減少檔案大小有兩個明顯的好處,一是可以減少儲存空間,二是通過網路傳輸檔案時,可以減少傳輸的時間。gzip 是在 Linux 系統中經常使用的一個對檔案進行壓縮和解壓縮的命令,既方便又好用。 文法:gzip [選項]
Time of Update: 2018-12-03
//4led.c #include <linux/config.h>#include <linux/module.h>#include <linux/kernel.h>#include <linux/init.h>#include <linux/miscdevice.h>#include <linux/sched.h>#include <linux/delay.h>#include <linux/poll.
Time of Update: 2018-12-03
1.用 cat /proc/devices 可以查看當前已經使用的裝置對應的主裝置號 cat /proc/interrupts 查看記錄那個裝置在使用那個中斷號 cat /proc/tty/drivers 可查看當前系統中所有tty裝置的相關資訊 arm-linux-gcc -v 2.在控制平台從使用者到超級使用者的切換命令 : su -root 3.將bin目錄添加到環境變數中去:export
Time of Update: 2018-12-03
linux ext2 檔案系統恢複被刪除的檔案 發布日期:2002-08-08 文章內容: ------------------------------------------------------------------------ -------- by deepin@nsfocus.com http://www.nsfocus.com 來源於一次緊急響應,客戶通過foxmail收取了qmail
Time of Update: 2018-12-03
軟體準備:gcc-3.2.2-5.i386.rpm :用來編譯ncurses-5.6.tar.gz:用來配合make menuconfig 命令配置核心bison-2.4.tar.gz :文法解析器flex-2.5.35.tar.bz2 :詞法解析器m4-1.4.9.tar.gz: modutils-2.4.26.tar.bz2 : module-init-tools-3.2.2.tar.bz2: 2.6配套工具包 linux-2.6.15.5.tar.bz2 : 核心源碼包 第一步:
Time of Update: 2018-12-03
[root@ns1 opt]# du -h -s /* | sort12K /mnt13M /sbin16K /lost+found1.8G /usr194M /root22G /opt24K /tmp4.0K /initrd4.0K /misc424K /dev4.5M /boot4.9M /bin61M /var8.0K /home81M /lib903M /proc9.1M
Time of Update: 2018-12-03
fileno函數:檔案流(FILE*)->檔案描述符#include <stdio.h>int main(void){ FILE * fp; //檔案流int fd; //檔案描述符fp=fopen("/home/yaoyin/bin/test/1.c","r");fd=fileno(fp); printf("fd=%d\n",fd);fclose(fp);return 0;}結果: fd=3(0 stdin 1 stdout 2 stderr
Time of Update: 2018-12-03
#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <fcntl.h>#include <errno.h>int main(){int file_desc;int save_errno;file_desc = open("/tmp/LCK.test",O_RDWR|O_CREAT|O_EXCL,0444);if(file_desc ==