+ -
当前位置:首页 → 问答吧 → 豆瓣下载

豆瓣下载

时间:2011-12-14

来源:互联网

一般情况下用这个命令就行了:echo "xxxxxx" >>file。
如果要向需要特权的文件(例如,系统配置文件)追加内容怎么办,上面的命令不行啊,sudo echo "xxxxxx" >>file 也不行,可有人知道怎么办?

作者: CuiCan   发布时间: 2011-12-14

sudo sh -c "echo xxxxxx >>file"
唉 sudo有时候挺麻烦的

作者: ttand   发布时间: 2011-12-14

echo password | sudo echo "Xxxxxxxxxxx" >>file

作者: mjp123   发布时间: 2011-12-14