我正在编写一个bash脚本,用于追加内容到/etc/profile文件中。但是不小心覆盖了原有内容,导致所有内容丢失。我该如何恢复这个文件呢?我在这里搜索过,但作为Ubuntu的新手,我不知道其他问题中发布的/etc/profile内容是否为默认内容。
grep /etc/profile /var/lib/dpkg/info/*.postinst
可以显示/var/lib/dpkg/info/base-files.postinst
,而这个文件中有一个函数将profile
从/usr/share/base-files
复制到/etc/passwd
(以及其他类似的文件)。 - muru