复制代码
代码如下:
[root@localhost test]# ll
总计 20drwxr-xr-x 6 root root 4096 10-27 01:58 scf
-rw-r--r-- 1 root root 29 10-28 06:05 test1.txt
drwxrwxrwx 2 root root 4096 10-25 17:46 test3
drwxr-xr-x 2 root root 4096 10-25 17:56 test4
drwxr-xr-x 3 root root 4096 10-25 17:56 test5
[root@localhost test]# mv test1.txt test3
[root@localhost test]# ll
总计 16drwxr-xr-x 6 root root 4096 10-27 01:58 scf
drwxrwxrwx 2 root root 4096 10-28 06:09 test3
drwxr-xr-x 2 root root 4096 10-25 17:56 test4
drwxr-xr-x 3 root root 4096 10-25 17:56 test5
[root@localhost test]# cd test3
[root@localhost test3]# ll
总计 4
-rw-r--r-- 1 root root 29 10-28 06:05 test1.txt
[root@localhost test3]#
说明:
将test1.txt文件移到目录test3中
实例三:将文件log1.txt,log2.txt,log3.txt移动到目录test3中。
命令:
mv log1.txt log2.txt log3.txt test3
mv -t /opt/soft/test/test4/ log1.txt log2.txt log3.txt
输出:
复制代码
代码如下:
[root@localhost test]# ll
总计 28
-rw-r--r-- 1 root root 8 10-28 06:15 log1.txt
-rw-r--r-- 1 root root 12 10-28 06:15 log2.txt
-rw-r--r-- 1 root root 13 10-28 06:16 log3.txt
drwxrwxrwx 2 root root 4096 10-28 06:09 test3
[root@localhost test]# mv log1.txt log2.txt log3.txt test3
[root@localhost test]# ll
总计 16drwxrwxrwx 2 root root 4096 10-28 06:18 test3
[root@localhost test]# cd test3/
[root@localhost test3]# ll
总计 16
-rw-r--r-- 1 root root 8 10-28 06:15 log1.txt
-rw-r--r-- 1 root root 12 10-28 06:15 log2.txt