Assignment 1 - Commands Shells 1. Write a command to list all files in your home directory 2. Do a listing of your home directory showing hidden files. Write your command here. 3. What command can you use to see the permissions of only the Desktop directory? 4. At the shell prompt, try executing the following commands: echo $HOME echo HOME what is the difference between the two? 5. Type echo $NAME and press Enter>, how does the system respond? 6. In your home directory create a directory of your name, containing a file named Ass1. In Ass1 display all commands of the bash shell in the /bin directory. And append to the end of the file the total number of these commands. Then delete the directory of your name. 7. What are the permissions on the file bashrc? 8. a) Can you read this file? b) Can you write to this file? c) Can you execute this file? d) Can others read this file? e) Can others write to this file? f) Can others execute this file? 9. Find all files in your home directory that are newer than bashrc. Show your command below. 10. Find all files in /etc that are bigger than 100k. How many files did you find? Show your command below. 11. View the first 5 lines of /etc/passwd. Who are the first 5 users listed in this file? (The user name is the first field up to the first colon) Write your command here: 12. View the last 2 lines of letc/passwd. Who are the last 2 users listed in this file? Write your command here: 13. View letc/passwd with line numbers. What is the line number of your user name? Write your command here: 14. Create a file called "file1" in your home directory with a text editor. Copy file1 to file2 in your home directory. Write your command here: 15. Rename file2 to testfile. Write your command here: 16. move testfile to the /tmp directory. Write your command here: 17.a) Create a hard link to "file1" called "hard". Write your command here: b) Create a soft link to "hard" called "soft". Write your command here: 18.a) If you delete file1 will hard still work? b) If you delete file 1 will soft still work? c) If you delete hard will soft still work? 19. Create a text file called file 1 in your home directory with several lines of text in it. Copy this to a file called file2 and change one line in file 2. Use the diff command to find the differences. Show your output here: Write your command here: 20. Sort file 1 to sorted and file 2 to sorted2. Write your commands here: 21. Use the comm command on the files sorted and sorted2. What did you find out? Write your command here: 22. Use cmp on the two files. Are they the same? Write your command here: 23. Compress one of these files. Write your command here: 24. What are the new file name? 25. Uncompress the file using the appropriate command. Write your command here: 26. Create a text file called file 1 in your home directory. Set the permissions using numeric perms so that you can read, write, and execute it, and group and others can read and execute it Show your command: Show the permissions: 27. Remove execute permissions from file1 using symbolic perms. Show your command: Show the permissions: 28. List all processes running in your current shell. Write your commands here