檔案結尾的問題 - Linux

Jake avatar
By Jake
at 2012-07-23T13:11

Table of Contents

問題一:

使用 vi 編輯文件時,是否程式會在文件末行自動加入換行字元?

因為我使用 ls 觀看檔案大小時,總是會多出一個百特。

有方法可以除去那檔案中最末端的換行字元嗎?

問題二:

終端機下使用 echo "mystring">testfile 似乎也是會自動加入換行字元,

有方法可以在創建檔案的時候除去那個煩人的換行字元嗎?

以上兩個問題麻煩請老手為新手解答一下,謝謝。

--
Tags: Linux

All Comments

Robert avatar
By Robert
at 2012-07-27T02:26
http://goo.gl/TNdUM Vim Tips Wiki 的說明
Bennie avatar
By Bennie
at 2012-07-30T09:33
echo -n 'yourstring' > testfile 沒有換行
John avatar
By John
at 2012-08-03T15:58
換行雖然看不見,除非你是一直打下去,不然換行符號是必要
Rebecca avatar
By Rebecca
at 2012-08-07T23:43
在vim裡set binary 再set noeol 存檔 應該就行了

雙系統時間調整

Charlotte avatar
By Charlotte
at 2012-07-23T01:32
一開始裝fedora的時候時區點錯了點到歐洲去 後來裝好了又把它改回來台北,然後調時間 但是這樣做回到windows的時候整個時間又變了,所以我又要調 然後再回來fedora時間又差了好幾個小時… 所以就改回去之後直到另一個系統後又要改回來,一直重複,挺麻煩的 我是直接裝硬碟上,不是VM之類的 有 ...

有辦法讓Wine正常執行HackShield嗎

Susan avatar
By Susan
at 2012-07-22T21:53
嗯...有人知道要怎麼讓Wine跑遊戲時不去執行Hackshield(或是正常執行)嗎?? Hackshield害的我Mabinogi在Linux Mint 13 下跑不起來 Wine Ver:Wine 1.4-ubuntu3 Host OS ; Linux Mint 13 MATE -64bit - ...

CentOS的ISO檔不能直接下載啊?

Anthony avatar
By Anthony
at 2012-07-22T19:52
目前6.3已經出來了,但我上FTP只看到bin可以直接下載,像是LiveDVD就 只能用BT,請問這是正常現象嗎?我目前環境無法用BT,找不到來源可以抓。 之前版本也是liveDVD會比較晚放嗎? -- 起初,他們追殺共產主義者,我沒有說話,因為我不是共產主義者; 接著,他們追殺猶太人,我沒有說話,因為我不 ...

Redirect stderr

Wallis avatar
By Wallis
at 2012-07-22T14:52
※ 引述《ALTandTAB (30)》之銘言: : 你是想stdoutandamp;stderr -andgt; screen 且 stderr -andgt; file 嗎? 是的 : 如果我沒搞錯的話應該可以用下面的script完成 : str=and#34;$atand#34;; ${str#$1 ...

Redirect stderr

Carol avatar
By Carol
at 2012-07-22T13:30
你是想stdoutandamp;stderr -andgt; screen 且 stderr -andgt; file 嗎? 如果我沒搞錯的話應該可以用下面的script完成 str=and#34;$atand#34;; ${str#$1} 3andgt;andamp;1 1andgt;andamp; ...