從資料夾 /home/ubuntu/Documents 底下找出符合字串 Hello World! 的檔案,並顯示該字串在哪一行出現。
$ grep -R -n 'Hello World!' /home/ubuntu/Documents
從資料夾 /home/ubuntu/Documents 底下找出符合字串 Hello World! 的檔案,並顯示該字串在哪一行出現。
$ grep -R -n 'Hello World!' /home/ubuntu/Documents
Windows XP SP3 上實作無誤後,步驟紀錄在這裡,以避免以後又要玩記憶拼圖。

c:\grldr="grub4dos"
title Ubuntu Desktop 10.10
find --set-root /ubuntu-10.10-desktop-i386.iso
map --mem /ubuntu-10.10-desktop-i386.iso (0xff)
map --hook
root (0xff)
kernel /casper/vmlinuz boot=casper iso-scan/filename=/ubuntu-10.10-desktop-i386.iso splash
initrd /casper/initrd.lz
今天在彎彎的部落格抓了一堆動態小圖,打開資料夾一看卻發現副檔名是 .jpg,一定要改成 .gif 才會動,但一個一個改就太瞎了(其實圖也是一個一個抓,瞎 XD),照慣例上 Google 輸入關鍵字「linux change file name extension」,找到兩個解決方法。
$ rename -n ’s/\.jpg$/\.gif/’ *.jpg
或者
$ for i in *.jpg; do mv "$i" "${i%.jpg}".gif; done
編輯→自訂佈景→您也可以透過 CSS 來自訂個人檔案風格
* {
font-family: 'Ubuntu', 'Lucida Sans Unicode', 'Lucida Sans Regular', Tahoma, Verdana, sans-serif;
}
/* Ubuntu Font Family http://font.ubuntu.com/web/ */
@font-face {
font-family: 'Ubuntu';
font-style: normal;
font-weight: normal;
src: local('Ubuntu'), local('Ubuntu-Regular'), url('http://themes.googleusercontent.com/font?kit=2Q-AW1e_taO6pHwMXcXW5w') format('truetype');
}系統會顯示網路連線的上傳和下載狀態,但是不會詳細列出哪些程序正在使用網路。昨天突然想到這個問題,Google 搜尋找到 nethogs,非常簡單、易用。
$ sudo apt-get install nethogs
$ sudo nethogs
網路速率 3M/768K384K 平常自己一個人使用可以毫無設限的抓檔、看 YouTube,不必擔心會導致他人上網不順暢、遊戲累個…等。晚上大夥回來就要自制一點,之前有試著從 dd-wrt 下手,使用 tc 控制頻寬但效果不彰,限制大家不成只好限制自己了,於是 Google 了一下關鍵字「ubuntu 流量限制」,發現 Wondershaper 可輕鬆達成目前需求。
$ sudo apt-get install wondershaper
$ sudo wondershaper eth0 2000 160
$ sudo wondershaper clear eth0
1049902 bytes received in 2.92 secs (351.6 kB/s)
1049902 bytes sent in 17.27 secs (59.4 kB/s)
$ sudo wondershaper eth0 2000 150
1049902 bytes received in 4.62 secs (222.1 kB/s)
1049902 bytes sent in 56.46 secs (18.2 kB/s)
$ sudo wondershaper eth0 1600 160
1049902 bytes received in 5.68 secs (180.5 kB/s)
1049902 bytes sent in 53.18 secs (19.3 kB/s)
Trickle 好像更讚!一併推薦。
將原本由 BCB 載入的滑鼠游標,改成從系統資源中載入。
void __fastcall TfrmMain::FormCreate(TObject *Sender)
{
Screen->Cursors[crHandPoint] = LoadCursor(0, IDC_HAND);
}
最近突然很喜歡乾淨的作業系統,所以盡量不安裝其它軟體,連以前喜歡用的 Pidgin 也沒裝,使用原裝的 Empathy,但字體太小加上視力太差,調整一下大小,在這裡紀錄一下。
$ sudo vi /usr/share/adium/message-styles/\
ubuntu.AdiumMessageStyle/Contents/Resources/main.css
這裡我用 vim 進行編輯,你也可以使用 nano 或者 gedit。
.message {
padding:0 1em 0 1.25em;
word-wrap: break-word;
font-size:13px; /*訊息文字大小,預設 11px。*/
}
.tableBubble .timeStamp {
margin:2px;
margin-left:7px;
text-align:right;
float:right;
font-size:10px; /*時間文字大小,預設 8px。*/
}
.tableBubble .nameStamp {
text-align:left;
float:none;
margin-left:0;
position:relative;
top:-2px;
font-size:12px; /*名字文字大小,預設 10px。*/
}