Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. # Homework
  2.  
  3. 1. Find out which shell you are using
  4.  
  5. 2. Find out where you are in file system
  6.  
  7. 3. Go to home directory
  8.  
  9. 4. Create a folder named `homework`
  10.  
  11. 5. List the contents of home directory to a file named `~/homework/home_dir.txt`
  12.  
  13. 6. Same as previous but also showing hidden files and permissions. Name it `~/homework/home_dir_all.txt`
  14.  
  15. 7. Change to `homework` directory
  16.  
  17. 8. Create an empty file named `empty.txt`
  18.  
  19. 9. Make `empty.txt` a hidden file
  20.  
  21. 10. Create a folder called `private` and change permissions so that only you can access it
  22.  
  23. 11. Read the man page for the command `seq`
  24.  
  25. 12. Use the command `seq` to generate a file with numbers from 1 to 1000
  26.  
  27. 13. Bonus... use command `seq` to generate a file containing a list of ips from `10.2.8.1` to `10.2.8.254`. Hint `seq -f`
  28.  
  29. 14. Bonus 2: use command `seq` to generate a file named `apples.txt` containing the following:
  30.  
  31. ```
  32. 10 apples
  33. 11 apples
  34. 12 apples
  35. 13 apples
  36. 14 apples
  37. 15 apples
  38. 16 apples
  39. 17 apples
  40. 18 apples
  41. 19 apples
  42. 20 apples
  43. ```
  44. hints: `seq -s`
  45. hint 2: new line needs to be escaped as `\\n`
  46.  
  47. 15. If you cannot complete bonus 2 create the file manually using vi
  48.  
  49. 16. Use `sed` to create a `pears.txt` file from the `apples.txt` file it should contains pears instead of apples
  50.  
  51. 17. Create a `pairs_5.txt` file using either `sed` or `grep` to only contain the lines where the numbers end in 5 or zero. Hint: math will not be used. (string manipulation)
  52.  
  53. 18. Create the following file `~/level1/level2/level3/level4/level5/level6/linux.txt`
  54.  
  55. 19. Copy the `~/level1` directory with all the subdirectories to a folder called `level1_copy` Hint: `cp -r`
  56.  
  57. 20. Create a bash script where the user places a path and the script lists all the files in that path. name it `myls.sh`
  58.  
  59. # To Take Home:
  60.  
  61. 1. Complete `vimtutor`
  62.  
  63. 2. Update and upgrade all packages on your pi
  64.  
  65. 3. Install the `git` package
  66.  
  67. 4. Use apt-get to remove all unnecessary files
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement