0

I would like to list this folder mnt/test. (test with a whitespace at the end) I tried the following different syntaxes:

ls mnt/test 
ls "mnt/test "
ls mnt/test\ 
ls "mnt/test\ "

All of these attempts failed.

Is there any solution besides renaming the folder?

3
  • 2
    Can't you just use tab completion (i.e. type ls mnt/test and then press TAB) to fill in the rest of the name? What kind of whitespace is it anyway, apparently it doesn't seem to be a simple space...
    – Byte Commander
    Apr 24, 2019 at 16:31
  • 3
    The output of ls -db mnt/* might be helpful Apr 24, 2019 at 16:44
  • Normally "mnt/test " should work. To make sure that you don't have other invisible characters in your folder name, do ls -d mnt/test* | od -xc.
    – muclux
    Apr 24, 2019 at 16:50

1 Answer 1

0

On my PC ls mnt/test\ and ls mnt/test\ / (no quotes) work well.

:~$ mkdir -p "mnt/test "
:~$ cd mnt/test\ /
:~/mnt/test $ touch 1 2 3 4 5
:~/mnt/test $ cd
:~$ ls mnt/test\ 
1  2  3  4  5
:~$ ls mnt/test\ /
1  2  3  4  5

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .