How to list files with spaces in the filenames on Linux.
How to list all files in a directory that have spaces in the filename. This is a very useful Linux tip.
Read MoreHow to list all files in a directory that have spaces in the filename. This is a very useful Linux tip.
Read MoreTrailing whitespace in a C source file is very annoying, especially if it is a very large file. There is an easy way to fix this with the Linux command line. This sed(1) one-liner will remove all spaces from the file, erasing all of the unwanted spaces after characters that…
Read MoreTo trim multiple spaces from a sentence and turn it back into properly readable text, use this sed syntax. sed ‘s/ \+/ /g’sed ‘s/ \+/ /g’ This is an example. echo "Hello, this sentence has multiple spaces in it and needs fixing." Hello, this sentence has multiple spaces in it…
Read MoreThis command will take all files and directories in a folder and replace all of the spaces in their names with hyphens. This could be a very useful command when you want the files to have sensible filenames. john@adeptus-mechanicus ~ $ ls -hula | perl -e ‘rename $_, s/\s+/-/gr for…
Read More