lab-1-prelab.txt

Yu Cheng (Jade)
ICS 351
Prelab Report 1
September 14

[Question 1]
What will happen if you type `man man` in Linux?

This command displays the manual page for the "man" program.


[Question 2]
How can you use the command ls to find out about the size of file
/etc/lilo.conf?

The command `ls -l /etc/lilo.conf` will list in long format, giving mode, ACL
indication, number of links, owner, group, size in bytes, and time of last
modification for the file.


[Question 3]
What happens if you have two files with names file 1 and file 2 and you type
`mv file 1 file 2`? Which option of mv issues a warning in this situation.

If both files are in the current directory and I just type `mv file1 file2`,
file1 will write over file2.  After this operation, there will be only one file
left, which contain the contents of previous file1 and is named as file2.

The command `mv -i file1 file2` will prompt for confirmation whenever the move
would overwrite an existing target.  It looks like
"mv: overwrite file2 (yes/no)?".  An affirmative answer means that the move
should proceed.  Any other answer prevents mv from overwriting the target.


[Question 4]
What is the command that you issue if you are in directory / and want to copy
the file /mydata to directory /labdata?

The command `cp mydata labdata`.


[Question 5]
What is the command that you issue if you are in directory / and want to copy
all files and directories under directory /mydirectory to directory
/newdirecory?

The command `cp -r mydirectory newdirectory` or comannd `cp -R /mydirectory
newdirectory` will do the job.  The option "cp -r" recursively copies the
directory and all its files, including any subdirectories and their files, to
the target.  The option "cp -R" is the same as "cp -r", except pipes are
replicated, not read from.


[Question 6]
what happens if you type the command `rm *` in a directory?

The command `rm *` will remove all the files in the current directory and will
display the subdirectories that are in the current directory.  It looks like
"rm: subdirectory is a directory".  The subdirectories won't be removed.


[Question 7]
What is the command that you issue if you want to delete all files and
directories under the directory /mydirectory?

I will use the command `rm -Rf /mydirectory/*` or `rm -rf /mydirectory/*`. These
commands recursively remove directories and subdirectories under /mydirectory.
The "-r" or "-R" options recursively remove directories and subdirectories in
the argument list.  The option "-f" removes all files (whether write-protected
or not) in a directory without prompting the user.
Valid HTML 4.01 Valid CSS