-1

There is a file /home/tiger/Desktop/shell practice. I want to cut 9 blank spaces from it:

cut -c 10- '/home/tiger/Desktop/shell practice'
cut: /home/tiger/Desktop/shell practice: No such file or directory

How can I do this?

Mechanical snail
  • 29,755
  • 14
  • 88
  • 113
Ff Yy
  • 247
  • 2
  • 7
  • 12
  • 1
    Because single quote should work even if the file name has a space. – P.P Sep 22 '12 at 07:55
  • http://stackoverflow.com/questions/1574898/bash-and-filenames-with-spaces – tartar Sep 22 '12 at 08:03
  • 1
    Are you sure you have the name right? Try typing `cut -c 10- '/home/tiger/Desktop/shell` then TAB; it should auto-complete the file name, with backslashes added to escape any spaces. Also try `ls /home/tiger/Desktop | cat -A` – Keith Thompson Sep 22 '12 at 09:15
  • It should work, check the file name or file existence. – duslabo Sep 22 '12 at 12:57

1 Answers1

0
cut -c 10- '/home/tiger/Desktop/shell\ practice'     

A friend told me how to solve it.

nbrooks
  • 18,126
  • 5
  • 54
  • 66
Ff Yy
  • 247
  • 2
  • 7
  • 12