Information Technology Reference
In-Depth Information
# ls -l
total 672
-rw-r--r-- 1 root other 103306 Apr 13 20:48 file1
-rw-r--r-- 1 root other 103306 Apr 13 20:48 file2
-rw-r--r-- 1 root other 103306 Apr 13 20:48 xfile
# cp xfile file* /tmp
# ls -l /tmp
total 1496
-rw-r--r-- 1 daemon other 19521 Apr 6 00:52 cache
-rw-r--r-- 1 root other 103306 Apr 6 02:10 comp
-rw------- 1 root other 307892 Apr 4 18:57 dtdbcache
-rw-r--r-- 1 root other 103306 Apr 13 20:49 file1
-rw-r--r-- 1 root other 103306 Apr 13 20:49 file2
-rw-rw-r-- 1 root sys 5032 Apr 4 18:56 ps_data
-rw-r--r-- 1 root other 0 Apr 9 00:45 sdtvolcheck
-rw-r--r-- 1 root other 103306 Apr 13 20:49 xfile
#
Moving and Renaming Files Using the mv Command
The mv(1) command can be used to:
Move one or more files to another directory
Rename a file in the current directory
Move a file to another directory and rename it in the process
When moving one or more files, the last command-line argument is the tar-
get directory and all preceding command-line arguments are the files to be
moved. The files to be moved can be complete filenames, multiple files
selected using metacharacters, or any combination. The filenames must be
separated by spaces. For example, this listing shows the ls command listing
the directories recursively.
# ls -R /test
/test:
Solaris
/test/Solaris:
9
/test/Solaris/9:
311-014 311-015 sysadmin
# mv /test/Solaris/9/311* /test/Solaris/9/sysadmin
# ls -R /test
/test:
Solaris
/test/Solaris:
9
Search WWH ::




Custom Search