Skip to content

LiwaaAudi/OS-Tasks

Repository files navigation

OS-Tasks

Task - 1 -Create directory in your home directory named Top Secret. Because directory name has a white space, it must be esacped with "", so full parameter for command should be like: "Top\ Secret", also when accessing this folder, you must escape whitespace "cd Top\ Secret" -Save the content of /bin directory to text file named bin.txt -Make hidden copy of bin.txt and move it to Top Secret directory. -Hidden file can be made appending "." prefix to it's name, for example if file's name is "abc.txt", it must be renamed to ".abc.txt" -Hidden file will not be shown in "ls", unless "-a" is provided -Hidden file can still be accessed and modified, for example, to read a hidden file, following command can be used: "cat .abc.txt

Task - 2 -Write script that calculates and writes the multiplication of two numbers result and writes to file. -Write script that outputs the n-th text line of text file. -Write script that outputs the lines of text file starting with the n-th line, ending with the m-th line. -Write script that removes the n-th text line from the text file.

Task - 3 -User enters two names of files. Write a script that checks which file has more lines. -User enters two names of directories. Write a script that checks which directory has more files.

Task - 4 -Write a script that: -lists all directories in working directory; -determines which file is the largest one in the current directory; -determines which folder has the highest amount of files.

Task - 5 -Write a script that removes empty lines from a given text file (2 points). -Write a script that finds the longest line in a text file and prints out the line number and the line itself (2 points). -Write a script that prints out the hidden non-empty files of selected directory (2 points). -Write a script that prints out the files of selected directory, having only "read" permission (2 points). -Write a script that removes all empty files and directories in a given directory and prints out the list of deleted items, including the type of deleted item, i.e. directory or file, and last access time (4 points). -Write a script that removes all empty files in a whole directory tree. Root of the tree is entered from the keyboard (2 points). -Write a script that prints out the list of files in selected directory that are accessed earlier than selected date (2 points). -Write a script that prints out the list of files in a directory tree that are larger in size, measured in bytes, that the given size (2 points). -Write a script that prints out the largest directory measured in amount of simple files of user's home directory (2 points). -Write a script - address book with functionalities such as follows: .New record insertion (name, surname, phone no., e-mail) (2 points); .Record search (1 point); .List of all records (1 point); Record removal (2 points).

About

Linux shell tasks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages