Using bash to automate dotfiles

后端 未结 6 1949
执笔经年
执笔经年 2021-02-06 09:21

I want to create my own automated dotfiles folder. (I\'ll be using git to use version control on my dotfiles, but that\'s irrelevant for the question)

What i simply want

6条回答
  •  后悔当初
    2021-02-06 10:17

    Give this a try:

    ln -s ~/dotfiles/* ~
    

    There shouldn't be any need for a loop. Of course, you can use find if you need something recursive.

    Edit:

    To make the destination files hidden:

    for f in ~/dotfiles/*
    do
        ln -s "$f" "$HOME/.${f##*/}"
    done
    

提交回复
热议问题