求助,请发一份~/.profile给我
Tofloor
poster avatar
lovelope
deepin
2017-01-20 23:06
Author
误删了~/.profile,需要新的文件
Reply Favorite View the author
All Replies
avatar
wangyong
deepin
2017-01-20 23:44
#1
新建一个用户后在新用户目录下拷贝
Reply View the author
avatar
lovelope
deepin
2017-01-21 00:05
#2
https://bbs.deepin.org/post/134350
新建一个用户后在新用户目录下拷贝

谢谢啦
Reply View the author
avatar
wangyong
deepin
2017-01-21 05:04
#3

以后丢其他文件也可以这样玩。 ;)
Reply View the author
avatar
Feng Yu
deepin
2017-01-21 05:15
#4
创建用户会从/etc/skel/下拷贝所有的文件到家目录,你也可以直接从这个目录拷贝文件
Reply View the author
Comments
nanpuyue
2017-01-21 18:42
正解~
avatar
much1988
deepin
2017-01-21 05:35
#5
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/binPATH"
fi
Reply View the author
avatar
lovelope
deepin
2017-01-22 05:13
#6
https://bbs.deepin.org/post/134350
创建用户会从/etc/skel/下拷贝所有的文件到家目录,你也可以直接从这个目录拷贝文件 ...

学习了
Reply View the author
avatar
lovelope
deepin
2017-01-22 05:14
#7
https://bbs.deepin.org/post/134350
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash( ...

谢谢啦,已经解决了
Reply View the author
avatar
Feng Yu
deepin
2017-01-22 06:49
#8

这个其实就是Linux的基础,你如果看过一些linux的基础教程的书籍或其他资料的话都会讲到。默认配置下/etc/skel就是用户家目录的模板(既然是默认,那就意味着可以改),创建用户的时候,默认会从这个目录下拷贝所有文件进入用户的家目录。

你完全可以定制这个目录下的配置文件,达成配置用户默认属性的目的,比如定制firefox的配置(很多发行版都这么干的,扔一个~/.mozilla的配置目录进去)。useradd的时候也可以指明不拷贝skel目录的内容。

所以如果你丢掉了.profile文件,从/etc/skel/.profile拷贝过去就行了,当然这个拷贝过来的就只是默认配置了,如果你修改过,那么只能重新修改了。
Reply View the author