How Do I Remove a Space from a Directory in Linux?
Contents How Do I Remove Spaces from a File in Linux? the Right Tool for the Job Tr -D ‘ ‘ < Input. Txt > No-Spaces. Txt. Tr -D ‘[: Blank:]’ < Input. Txt >...
Contents
How do I remove spaces from a file in Linux?
The right tool for the job
- tr -d ‘ ‘ < input.txt > no-spaces.txt.
- tr -d ‘[:blank:]’ < input.txt > no-spaces.txt.
- tr -d ‘[:space:]’ < input.txt > no-spaces.txt.
Must Read
How do you delete a folder that has a space in its name?
Remove files with names containing strange characters such as spaces, semicolons, and backslashes in Unix
- Try the regular rm command and enclose your troublesome filename in quotes. …
- You can also try renaming the problem file, using quotes around your original filename, by entering: mv “filename;#” new_filename.