English 中文(简体)
我在气瓶中制造了一个空洞的档案,并增加了其特性。 但是,它正显示是2个 by子。
原标题:I have created an empty file in linux and added a character to it. But it is showing up as a 2 bytes file
  • 时间:2010-12-09 08:57:01
  •  标签:
  • linux
  • unix

看来,在案卷的结尾处是(果)10。 请注意,我是在Nautilus,而不是在方案上这样做。 为什么发生这种情况? 如何预防?

最佳回答

ASCII 0x0A is the newline .

如果用<代码>echo 1 >file创建你的文件。 增加了一条新路线。 如果您重新研究这种行为,请登录echo -n 1 >file

问题回答

The ASCII character with the decimal code 10 (0x0a in hex) is i.e. the new line (LF - Line Feed) character in Unix-like systems. How did you create the file?

EDIT:

如果你照搬,你或许应当尝试-n的旗帜,以抑制因违约而排放的最后新线:

echo -n X > file




相关问题
Signed executables under Linux

For security reasons, it is desirable to check the integrity of code before execution, avoiding tampered software by an attacker. So, my question is How to sign executable code and run only trusted ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

How to write a Remote DataModule to run on a linux server?

i would like to know if there are any solution to do this. Does anyone? The big picture: I want to access data over the web, using my delphi thin clients. But i´would like to keep my server/service ...

How can I use exit codes to run shell scripts sequentially?

Since cruise control is full of bugs that have wasted my entire week, I have decided the existing shell scripts I have are simpler and thus better. Here is what I have so far svn update /var/www/...

Good, free, easy-to-use C graphics libraries? [closed]

I was wondering if there were any good free graphics libraries for C that are easy to use? It s for plotting 2d and 3d graphs and then saving to a file. It s on a Linux system and there s no gnuplot ...

热门标签