Return to Operationg Systems home
Produce the following tree of directories in your home directory:
osEx01 | ------------------------ | | | src bin test | | ---------- ----------- | | | | include lib script results
src, then, using the directory
src as the current directory, copy the file in the directories
results (to this extent use only absolute paths).
cat to verify the content of the files.
diff to verify that all the files have the same content.
Executing all the commands from the root of your user (i.e.,
/home/username), do the following:
osEx01 into a directory tree named
osEx01backup, by using the command
cp to copy individual files and the command
mkdir for directories.
osEx01 by using the command
rm to remove individual files and the command
rmdir for directories“.
Check what they do and for what the following commands are used:
For any problem, remember that you can use the following command to obtain an online help manual for a specific
Verify and reply to the following questions:
username and the
group to which you belong.
/home directory (e.g., its subdirectories, etc.)
How is it possible to modify in the same way the access rights to all the files and directories of a directory tree (for example, to eliminate the read right to all, user, group, and other of the directory
lab01e03in.sl file have a different size than the others, but it has the same content?
lab01e03in.txt with a text editor of your choice
ls -l command?
lab01e03in.backup with the content of the files
lab01e03in.sl. Why in the second case do you obtain an error message?
allows to update date and time of the last modification performed on a file.
In the case the specified file does not exist, it creates an empty file with that name.
Perform the following tasks using:
gcc compiler (alternatively use an IDE of your choice, e.g., CodeBlocks).
Write a C language program that, using the ANSI C I/O primitives (
fputs of your choice), is able to copy a text file to an identical file.
The name of the two files is received on the command line, so that the program can be executed using a command that specifies three parameters:
nameExcutable sourceFile destinationFile
Compile the source files using
destinationFile must be identic) using the shell command
How does the written program behave if you try to copy a binary file?
Change the program using
fwrite functions (optional) and then
close POSIX system calls.
install target, which allows to
clean target, which removes the object file in the current directory
distclean target that calls the
clean target and deletes the
bin directory (which is the sibling of the current directory) and all its content
Take as reference the example analyzed in classroom: Makefile4