Of course, if you had only 3 files, you could just do
mv home1 home2 home3 homeLife
Sometimes it is easier to do things manually than read the documentation. If you really had a large number of files named home*
, then one trick that I use (that is now part of bash) is to expand all the glob matches and then manually delete the matches I don't want. To expand a glob, type Ctrl+x * after you type the glob expression. It will expand on the command line, and then you manually fix it.
For example, in my directory, I have a lot of "test" files and I want to cat all of them besides test2
to a new file:
cat test*
Now type Ctrl+x *, and it expands to
cat test test10 test11 test12 test13 test14 test15 test16 test17 test2 test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 test3 test30 test31 test32 test33 test34 test35 test36 test37 test38 test4 test5 test6 test7 test8 test9 testa testb testbuild testc testd teste testf
Then cursor back and remove test2
with 5 backspaces, and then add > test_all
to the end of the command line.
cat test test10 test11 test12 test13 test14 test15 test16 test17 test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 test3 test30 test31 test32 test33 test34 test35 test36 test37 test38 test4 test5 test6 test7 test8 test9 testa testb testbuild testc testd teste testf > test_all
There are a bunch of other features of Ctrl+x, but this is the only one I remember.
home1 home2 and home3
or files calledhome1, home2, home3
?find -type f
command. (I'll provide details on request if necessary.)homeLife
, because, at it says, it cannot movehomeLife
into itself.