• 2022-06-09
    以下操作能实现追加写入文件的是
    A: echo "hello" > /tmp/test
    B: echo "hello" >> /tmp/test
    C: print "hello\n" >> /tmp/test
    D: printf "hello\n" >> /tmp/test
  • B,D

    内容

    • 0

      ‌以下程序的输出结果是:( )‏‌fo = open("text.txt",'w+')‏‌x,y ='this is a test','hello'‏‌fo.write('{}+{}\n'.format(x,y))‏‌print(fo.read())‏‌fo.close()‏‌‏ A: this is a test hello B: this is a test C: this is a test,hello. D: this is a test+hello

    • 1

      在/tmp目录下新建一个名为test目录;进入/tmp/test目录;将/etc/man.config复制到/tmp/test目录下;

    • 2

      当前目录是~,在/tmp目录建立test子目录,可用的命令是( ) A: mkdir /tmp/test B: mkdir test C: mkdir /test D: mkdir ./test

    • 3

      ① 以root登入系统,并且进入/tmp当中;② touch test,并且更改test权限成为777;③ 以—般使用者登入,并进入/tmp;④尝试删除test这个文件。写出命令及执行结果。

    • 4

      下面的程序执行后,文件test中的内容是()。voidfun(char*fnam...n("test","hello,");}