i trying delete dir (with cli), contains many sub dirs , files:
hello - de important files stuff (0000-0001)
using command:but keep getting error:php code:sudo rm -rf hello\ -\ de\ important\ files\ stuff\ (0000-0001)/
obviously noob linux.. doing wrong?php code:-sh: syntax error: "(" unexpected
\ between spaces in file name isn't showing in php code?!?
it's complaining because ( special character in bash, needs escaped. easy route double-tab autocomplete assuming there 1 directory named "hello...", or easier rm hello* again assuming 1 directory. alternative escape argument (or quote it). i.e.
sudo rm -rf 'hello - de important files stuff (0000-0001)'
sudo rm -rf hello\ -\ de\ important\ files\ stuff\ \(0000-0001\)
in second have escaped spaces let bash know it's space , not separating arguments (otherwise run rm on "hello", "-", "de", "important"... not want. have escaped ( , ) because otherwise shell interpret them special characters.
  		  		  	Forum    	The Ubuntu Forum Community    	Ubuntu Official Flavours Support    	General Help    		  	[ubuntu]  Syntax error when deleting a dir ?!?     	
 Ubuntu
 
  
Comments
Post a Comment