
\n+ matches a line-feed (newline) character.
#LS GREP PRESERVE NEWLINE CODE#
On success, 0 is returned, a non-zero failure code otherwise.Īs glenn jackman commented below (very useful):Īnd to narrow down the results to just lines starting with a hyphen: grep '^]*-' –

Shutdown may be used to halt, power-off or reboot the machine.Įquivalent to -poweroff, unless -halt is specified.ĭo not halt, power-off, reboot, just write wall message.ĭo not send wall message before halt, power-off, reboot. To edit a file with a dashed filename, you can use various text editors available. rw-rw-r- tecmint tecmint 0 B Tue Jun 20 10:32:43 2023 -abc.txt Create Dashed File in Linux Edit Dashed File in Linux. Shutdown - Halt, power-off or reboot the machine You may verify the file thus created by both the above ways by running commands ls or ls -l for long listing. Would this work in your case? $ man ls | grep - '-a'Ī more detailed (hopefully clearer) example of the command: $ man shutdown | grep - '-'
