316 Introduction to C++ Programming and Graphics
vi simos Create or edit filesimosusing the vi editor
view simos Read-only version of vi
cat>simos Type text in a file named simos;
end the session with Ctrl-D
mv simos siomadis Rename file simos to siomadis
mv simos kekos Move file simos into directory kekos
mv -i simos kekos Inquire before overwriting
cat simos Display contents of file simos
more simos Display contents of file simos
one screen at a time
less simos A new version of more
rm simos Remove (delete) file
rm -i simos Inquire before deleting
diff simos siomadis Show the differences between
files simos and siomadis
cmp simos siomadis Byte-by-byte comparison
grep string file1 file2 ... Show lines containing string in listed files
grep -v string file1 file2 ... Show lines not containing string
grep -i string file1 file2 ... Show lines containing string, ignore case
Table A.2 Manipulating files in Unix. A file is generated and modified using a text
editor. Becauseviruns in the non-graphics mode, it is the most important
editor. Typeman vito obtain further information. Popular graphics editors
aregeditandemacs.
chown user file1 directory1 ... Change ownership
chgrp group file1 directory1 ... Change group
chmod mode file1 directory1 ... Change the permission mode
chmod -R mode directory1 directory2 ... Change all files in listed
directories; R stands for recursive
Mode:
ugo user (owner) group other
+- add or remove permission
rqx read write execute
Table A.3 In Unix, directories and files have an owner and a designated group
of users. Read, write, and execute permissions are set for the owner (user),
the group, and others. For example, issuing the command “chmod go+rwx
katsarola” grants read, write, and execute permissions to the group and
others for the file or directorykatsarola.