Re: get rid of files and directories with spaces in them

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Somebody in the thread at some point said:

> How does one get rid of files and directories with spaces in them?  I
> tried rm and it doesn't want to remove the files or folders?

You shouldn't be trying to type file paths literally.  Use the built-in
autocomplete stuff in bash, not only will it deal with spaces in
filepaths automatically solving your immediate problem, but your
efficiency at the commandline will go up hugely at no cost.

Eg, say your evil file is

"file with spaces"

if it is the only file in the directory beginning with f, for example,

rm f<tab>

will autocomplete the command line to

rm file\ with\ spaces

ie, it will fill in the file path complete with escaped spaces.  Just
hit enter to execute it.  Total keypresses: 8, including having to type
y and <enter> to accept it.

If there are more files that match, you can hit <tab> again to see the
list of possible matches, and type further characters to disambiguate.

-Andy

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux