Bash find, exclude parent?

Steven Penny picture Steven Penny · Jun 17, 2012 · Viewed 8k times · Source

I have a folder with some dotfiles I would like to make symlinks for. I cannot see an easy way to do this.

ls -a ~/dotfiles will include the dotfiles, but also . and ..

find ~/dotfiles -maxdepth 1 will include the dotfiles, but also ~/dotfiles

Answer

Steven Penny picture Steven Penny · Jun 17, 2012

Based off MvanGeest’s comment this appears to work.

find ~/dotfiles -maxdepth 1 -mindepth 1

This looks to do the job as well

ls -A ~/dotfiles