Information Technology Reference
In-Depth Information
rm: examine files in directory /test/Solaris (yes/no)? y
rm: examine files in directory /test/Solaris/9 (yes/no)? y
rm: remove /test/Solaris/9: (yes/no)? y
rm: remove /test/Solaris: (yes/no)? y
rm: remove /test: (yes/no)? y
#
Normally if the rm command encounters a write-protected file, it will
prompt to confirm its removal. However, if the -f command-line argument
is specified, write-protected files are removed without confirmation. The -f
command-line argument cannot be specified with the -i command-line
argument.
Files
Files can be copied, moved (or renamed), and deleted as required. These
operations are performed by the following commands:
cp(1) —Copies one or more files.
mv(1) —Moves or renames files.
rm(1) —Removes one or more files.
The following sections discuss each of these.
Copying Files Using the cp Command
The cp(1) command can be used to copy one or more files to another direc-
tory or be used to create a copy of an existing file with a different name.
When copying 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
copied. The files to be copied can be complete filenames, multiple files
selected using metacharacters, or any combination. Multiple filenames are
separated by spaces. For example, the first two cp commands copy one file to
a different filename. The third command copies several files into another
directory. Note when copying multiple files that they cannot be renamed.
# ls -l
total 224
-rw-r--r-- 1 root other 103306 Apr 13 20:48 file1
# cp file1 file2
# ls -l
total 448
-rw-r--r-- 1 root other 103306 Apr 13 20:48 file1
-rw-r--r-- 1 root other 103306 Apr 13 20:48 file2
# cp file2 xfile
Search WWH ::




Custom Search