For example, how do I delete, say, files qweerkrtrkgljdjfkdjfdkf.mp3 and blabla.mp3 with least effort?
Viewing a single forum discussion topic.
← Back to Programming Errors And Help
For example, how do I delete, say, files qweerkrtrkgljdjfkdjfdkf.mp3 and blabla.mp3 with least effort?
Try this:
rm -f 2.mp3 blabla.mp3
rm removes files, and -f forces it to (so that it wont stop, asking you if you want to delete the file). If this not in your home directory, prepend sudo. Here is another way that might require less typing (a bit harder to read though)
rm -f {2,blabla}.mp3
This expands to 2.mp3 blabla.mp3. If you want to use larger filenames, you can use the wildcard character (*), which will return all items starting/ending with the filename you chose. For example:
rm -f bla*
will remove all files starting with bla. If you used this:
rm -f *.mp3
It will remove all files ending with .mp3. If you used this:
rm -f bla*.mp3
It will remove all files starting with bla and ending with .mp3. Possibilities are nearly endless with the * character :P
1-3 of 3
You cannot edit posts or make replies: You should be logged in before you can post.