小编Sum*_*eek的帖子

如何在Linux上清空("截断")一个已经存在且受到保护的文件?

我的服务器上有一个名为error.log的文件,我需要经常截断.我对该文件拥有rw权限.在vi中打开文件>删除所有内容>保存工作(显然).但是当我尝试下面的时候

cat /dev/null > error.log
Run Code Online (Sandbox Code Playgroud)

我收到了消息

File already exists.
Run Code Online (Sandbox Code Playgroud)

显然,在服务器上进行了某种配置以防止意外覆盖文件.任何人都可以告诉我如何在一个命令中"截断"文件?

linux command-line file

111
推荐指数
4
解决办法
11万
查看次数

如何为已安装的postgreSQL添加python支持?

我在ubuntu机器上安装了postgreSQL版本8.3.这是通过apt get安装的.当我试图找到一个写有一些plsql函数的数据库转储时,我收到以下错误 -

could not access file "$libdir/plpython": No such file or directory
Run Code Online (Sandbox Code Playgroud)

当我尝试为特定数据库启用python支持时,我又遇到了另一个错误 -

$ createlang plpythonu <dbname> -U postgres
createlang: language installation failed: ERROR:  could not access file "$libdir/plpython": No such file or directory
Run Code Online (Sandbox Code Playgroud)

有没有办法我可以添加对python的支持而无需重新安装postgreSQL?

python postgresql

11
推荐指数
2
解决办法
5256
查看次数

标签 统计

command-line ×1

file ×1

linux ×1

postgresql ×1

python ×1