home | list info | list archive | date index | thread index

Re: Directory starting with ''$'\n''


Re-sending, as original message never appeared on the list.

Should be between James' message and Diane's reply.

It appears hitting "Reply" sends only to original author, *not* to list?!? That requires "Reply-All".

This seems a bit counter-intuitive, no?



James via linux wrote on 2025-11-27 15:46:

I need a command line way to rename a directory starting with ''$'\n''?


$ touch "\nbad_file"
$ mv '\nbad_file' 'good_file'
renamed '\nbad_file' -> 'good_file'


Tab completion works, where the tab completes the filename with the leading "\n":

$ mv '\n[TAB]

which I used in the example above, where it completed to:

$ mv '\nbad_file'



Honestly, I'm kinda of the opinion that support for \n in file names is a bad idea.

One of those "just because you can doesn't mean you should", since it probably more frequently happens by accident, causing problems than any beneficial intentional use cases.



To unsubscribe send a blank message to linux+unsubscribe [ at ] linux-ottawa [ dot ] org
To get help send a blank message to linux+help [ at ] linux-ottawa [ dot ] org
To visit the archives: https://lists.linux-ottawa.org