OS Practical File Ansh
OS Practical File Ansh
tty command (Displays the file name of the terminal connected to the standard input):
ls -la command (Returns the list of directories along with hidden files):
cat command (Prints the contents of a file):
Pipes in Linux are a way to pass the output of one command as input to another command
Program 10: Set a file to be read-only with the chmod command.
Interpret the file permissions displayed by the ls -l command.
Code and Output:
chmod command (Changes the access permissions of a file):
Program 11: Delete one or more directories with the rmdir
command. See what happens if the directory is not empty.
Experiment (carefully!) with the rm -r command to delete a
directory and its content.
Code and Output:
rmdir command (Removes a directory):
Program 12: Change your directory to the directory exercises.
Create a file in that directory, named the file as example1 using the
cat command containing the following text: ‘water, water
everywhere and all the boards did shrink; water, water everywhere,
no drop to drink.’
Code and Output:
cat command (Displays file content):
Program 13: Case Construct and Loops.
Code and Output:
Program 14: Write basic shell script to display the table of a
number.
Code and Output:
Program 15: Write basic shell script to input a character from user
and then check whether it is uppercase, lowercase or digit.
Code and Output:
Program 16: Write basic shell script to calculate factorial of a
number.
Code and Output:
Program 17: Write basic shell script to input the month number and
generate corresponding calendar.
Code and Output:
Program 18: Write basic shell script to list all directories.
Code and Output:
Program 19: Write basic shell script to display greatest of three
numbers.
Code and Output:
Program 20: Write basic shell script to check whether the number
entered by user is prime or not.
Code and Output:
Program 21: Write basic shell script to check whether the year
entered is leap or not.
Code and Output: