[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Setting default $PATH for all users



On Mon 11 Feb 2019 at 17:48:23 (-0000), Curt wrote:
> On 2019-02-11, Greg Wooledge <wooledg@eeg.ccf.org> wrote:
> > On Mon, Feb 11, 2019 at 05:26:34PM -0000, Curt wrote:
> >> I follow your logic. Give me everything in /etc/skel/ beginning with a dot.
> >> Which works. But apparently a dot is also something else. Like a directory.
> >> 
> >> curty@einstein:~$ ls /etc/skel/.*
> >> /etc/skel/.bash_logout  /etc/skel/.bashrc  /etc/skel/.profile
> >> 
> >> /etc/skel/.:
> >> 
> >> /etc/skel/..:
> >> 
> >> (etc.--the contents of /etc/
> >> 
> >> I'm not sure what it all means.
> >
> > The shell glob .* expands to everything in the current directory that
> > begins with a dot.  Which includes "." and "..".
> >
> > "." is the current directory.  ".." is the parent directory.  E.g. when
> > you type "cd .." it moves you "up" to the parent directory.
> >
> > Asking ls to show you .* is usually a bad idea, precisely because it
> > expands to a list which includes . and .. and does exactly what you
> > just described.
> >
> > This is why the ls command has -a and -A options.
> 
> Thank you. That all makes perfect sense.

If you want just the dotfiles, then    ls -dF  .[^.]*
might be helpful. You don't need the -dF, but -d will prevent
it listing any .dotdirectories (important in your $HOME) and
-F will reveal those directories (when you're not using -l)
and other non-regular-files.

Cheers,
David.


Reply to: