The behavior of ls
on symbolic links to directories depends on many options, not just -l
and -H
. In the absence of symlink behavior options (-L
, -H
), ls symlinkToDir
displays the contents of the directory, but ls -l symlinkToDir
, ls -d symlinkToDir
and ls -F symlinkToDir
all display information about the symbolic link.
If you're reading the man page of the GNU implementation of ls
, it doesn't give the full story. GNU man pages are just summaries. The full documentation is in the Info manual (info ls
), usually available in HTML these days. I can't find the default behavior on symlinks to directories in the Info manual either, though, this may be a bug in the documentation.
The FreeBSD man page, for example, is more precise, but you have to read the description of the -H
option to find the default behavior.
-H
Symbolic links on the command line are followed. This option is assumed if none of the -F
, -d
, or -l
options are specified.
If you want a more formal description (but less easy to read), read the POSIX specification. This won't have the extensions of your implementation.
If one or more of the -d, -F, or -l options are specified, and neither the -H nor the -L option is specified, for each operand that names a file of type symbolic link to a directory, ls shall write the name of the file as well as any requested, associated information. If none of the -d, -F, or -l options are specified, or the -H or -L options are specified, for each operand that names a file of type symbolic link to a directory, ls shall write the names of files contained within the directory as well as any requested, associated information.
sysctl -w
writes kernel parameter values to the corresponding keys under /proc/sys
:
sudo sysctl -w fs.inotify.max_user_watches=12288
writes 12288
to /proc/sys/fs/inotify/max_user_watches
. (It’s not equivalent, it’s exactly that; interested readers can strace
it to see for themselves.)
sysctl -p
loads settings from a file, either /etc/sysctl.conf
(the default), or whatever file is specified after -p
.
The difference between both approaches, beyond the different sources of the parameters and values they write, is that -w
only changes the parameters until the next reboot, whereas values stored in /etc/sysctl.conf
will be applied again every time the system boots. My usual approach is to use -w
to test values, then once I’m sure the new settings are OK, write them to /etc/sysctl.conf
or a file under /etc/sysctl.d
(usually /etc/sysctl.d/local.conf
).
See the sysctl
and sysctl.conf
manual pages (man sysctl
and man sysctl.conf
on your system) for details.
Best Answer
The output of
ls -D
is meant to be parsed by Emacs' dired mode.From the GNU Coreutils manual
The numbers are the positions of the file names in the output