Useful commands:

Problems:

1. Write a shell script that finds and prints on the screen the name of all users (students) from the linux server (linux.scs.ubbcluj.ro) who have a web page. A user has a web page if in its personal directory there is a directory named "public_html". The directory structure is organized on school years and groups (groups directories reside inside year directories).

2. Write a shell script that finds, in the current folder and its sub-folders, and prints the name of all files that have write permission for the others group. (Regarding file permissions, these are divided into 3 categories: owner, owners group, and others. Each of these groups can have 3 different permissions associated with a file: read-r, write-w, and execute-x).

3. Write a shell script that will delete the last line from all text files found in a directory given as parameter to the shell script.

4. Write a shell script which takes as parameter a directory name. The script will delete all C files and will sort and print on the screen all ASCII text files from this folder.

5. Write a shell script that will continuously read user names from the keyboard. For each name, it will print the last 3 logins for the current month, and if the user did not log in on the server in the current month it will print a warning message.

6. Write a shell script that will print the user name, full user name, and the content of the personal directory of all registered users. (Registered users can be found in /etc/passwd)

7. Write a shell script which takes as parameter a directory name. The script will compute the total number of lines from all txt files found in this folder and all its sub-folders.

8. Write a shell script which takes as parameters a file with users and another file that contains some text. The script will send an email to every user in the first file, the content of the email will be the text from the second file.

9. Write a shell script that counts the number of processes for a specific user, the name of the user is given as a parameter.

10. Write a shell script that will display the user's full name and IP address of the last work station where it was logged in. The name of the user is given as a parameter.

11. Write a shell script that will list the contents of the current directory. You will print the content in the following ways: sorted by file name, time of last access, and sorted by the file size.

12. Write a shell script that will rename all ".txt" files, from the current directory and all its subdirectories, in ".ascii" files

13. Write a shell script that checks if a number is prime or not.

14. Write a shell script that compares the content of two text files and prints the first 5 different lines.

15. Write a command file that receives as parameters pairs of filenames and numbers (e.g. $./p.sh file1.txt 3 file2.txt 4 ...). For each pair, it will display the file name and the first "number" lines of the file.