format conversion for a list of directories and files in some directory linux