This repository is used to publish the code I made for Operating systems 2 classes.
Each catalog is another set of tasks (2, usually) I had to prepare.
Working on catalogue trees with Python. Read more [PL]
- python-2/l6z1.py – in a given catalogue tree find (show path) all regular files named as the catalogue they're in.
- python-2/l6z2.py – NOT FINISHED copy a catalogue tree in a way that regular files were copied as regular files, symlinks inside the tree were symlinks to files inside a new tree, and symlinks to files outside the tree were linking to the same file (eg. do not break symlinks).
Working on filesystem with Python. Read more [PL]
- python-1/l5z1.py – in a given catalogue count files which owner has no rights to execute but group or others have.
- python-1/l5z2.py – in a given catalogue find symlinkd to regular files in that catalogue.
Stream processing with awk
. Read more [PL]
- files-with-the-same-char-at-beginning-and-end (data-preparation) — in a given catalogue find regular files which name begins and ends with the same character.
- files-names-as-catalogue-theyre-in (data-preparation) — in a given catalogue find regular files which name is the same as the name of a catalogue they're in.
Working with find
. Read more [PL]
- regular-files-with-hardlinks-and-specific-privileges (data-preparation) — in a given catalogue find regular files having hard links, and owner of which has no rights to read, and anyone (regardless whether a group or the others) has rights to write.
- find-duplicates-and-show (data-preparation) — in a given catalogue find regular files with the same name; if a name occurs just once, skip it.
Working with symbolic and hard links. Read more [PL]
- hard-to-symbolic — in a given folder change all the hard links linking to files in the same folder to symbolic links (minding the same files).
- copy-files-minding-links — copy files from one folder to another (script parameter) in a way that symbolic links from the first catalog are still correct in the second catalog.
First laboratory, tasks from the list.
- remove-and-log-empty-files (task 9) — remove all empty (zero-sized) files from a given folder (script parameter). In a given file create a list of deleted files. Do not follow symbolic links.
- rename-writable-files (task 1) — rename all files in a given folder (script parameter) that are allowed to be written, adding
.old
at the end of their name. Before that, delete all files which name ends with.old
.