Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

mv command in Linux

Dude!Sep 20 2010 — edited Sep 21 2010
OS: Oracle Enterprise Linux 5.4

It is not the first time I used the mv command in Unix systems, but recently noticed some strange outcome in Linux.

That's why I though I would do some test, and now I wonder about the result. Is there something new or strange about the mv command in Enterprise Linux?

Test 1: mv renamed the file to * *.txt*. Does this mean wildcard operations are not possible anymore?

Test 2: Instead of overwriting the test directory, it moved test_test directory inside the existing test. Is this correct?
# unalias mv
# mkdir test; cd test
# mkdir test test_test
# touch test.lst
# ll
total 8
drwxr-xr-x 2 root root 4096 Sep 21 00:50 test
-rw-r--r-- 1 root root    0 Sep 21 00:50 test.lst
drwxr-xr-x 2 root root 4096 Sep 21 00:50 test_test

TEST 1:

# mv test.lst *.txt
# ll
total 8
drwxr-xr-x 2 root root 4096 Sep 21 00:50 test
drwxr-xr-x 2 root root 4096 Sep 21 00:50 test_test
-rw-r--r-- 1 root root    0 Sep 21 00:50 *.txt


TEST 2:

# mv test_test test
# ll
total 4
drwxr-xr-x 3 root root 4096 Sep 21 00:52 test
-rw-r--r-- 1 root root    0 Sep 21 00:50 *.txt

# ll test
total 4
drwxr-xr-x 2 root root 4096 Sep 21 00:50 test_test
Thanks,
Markus
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 19 2010
Added on Sep 20 2010
2 comments
1,178 views