├── .DS_Store ├── .github └── stale.yml ├── exercices └── .gitkeep ├── inputs └── .gitkeep ├── lorem-copy ├── .DS_Store ├── .gitkeep └── dummy_file.txt ├── lorem ├── at.txt ├── at.txte ├── lorem.txt └── sed.txt ├── outputs └── .gitkeep └── readme.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironhack-labs/lab-bash/689f07d292a527d60a327ab110bd91efc1370aab/.DS_Store -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Disclosure: Please don't make any changes to this file. 2 | # Your Ironhack team ♥️ 3 | 4 | # ------------------------------------------------------------------------------- # 5 | 6 | # Configuration for probot-stale - https://github.com/probot/stale 7 | 8 | # Number of days of inactivity before an Issue or Pull Request becomes stale 9 | daysUntilStale: 21 10 | 11 | # Number of days of inactivity before an Issue or Pull Request with the stale label is closed. 12 | # Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. 13 | daysUntilClose: 7 14 | 15 | # Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable 16 | exemptLabels: 17 | - bug 18 | - enhancement 19 | 20 | # Label to use when marking as stale 21 | staleLabel: stale 22 | 23 | # Comment to post when marking as stale. Set to `false` to disable 24 | markComment: > 25 | This pull request has been automatically marked as stale because it didn't have any recent activity. It will be closed if no further activity occurs. Thank you. 26 | closeComment: > 27 | This pull request has been automatically closed. Thank you. 28 | -------------------------------------------------------------------------------- /exercices/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironhack-labs/lab-bash/689f07d292a527d60a327ab110bd91efc1370aab/exercices/.gitkeep -------------------------------------------------------------------------------- /inputs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironhack-labs/lab-bash/689f07d292a527d60a327ab110bd91efc1370aab/inputs/.gitkeep -------------------------------------------------------------------------------- /lorem-copy/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironhack-labs/lab-bash/689f07d292a527d60a327ab110bd91efc1370aab/lorem-copy/.DS_Store -------------------------------------------------------------------------------- /lorem-copy/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironhack-labs/lab-bash/689f07d292a527d60a327ab110bd91efc1370aab/lorem-copy/.gitkeep -------------------------------------------------------------------------------- /lorem-copy/dummy_file.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum -------------------------------------------------------------------------------- /lorem/at.txt: -------------------------------------------------------------------------------- 1 | At vero eos ET accusamus ET iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum 2 | deleniti atque corrupti quos dolores ET quas molestias excepturi sint occaecati cupiditate non 3 | provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum ET dolorum fuga. 4 | Et harum quidem rerum facilis est ET expedita distinctio. 5 | Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod 6 | maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. 7 | Temporibus autem quibusdam ET aut officiis debitis aut rerum necessitatibus saepe eveniET 8 | ut ET voluptates repudiandae sint ET molestiae non recusandae. 9 | Itaque earum rerum hic tenETur a sapiente delectus, ut aut reiciendis voluptatibus maiores 10 | alias consequatur aut perferendis doloribus asperiores repellat 11 | -------------------------------------------------------------------------------- /lorem/at.txte: -------------------------------------------------------------------------------- 1 | At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum 2 | deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non 3 | provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. 4 | Et harum quidem rerum facilis est et expedita distinctio. 5 | Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod 6 | maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. 7 | Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet 8 | ut et voluptates repudiandae sint et molestiae non recusandae. 9 | Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores 10 | alias consequatur aut perferendis doloribus asperiores repellat -------------------------------------------------------------------------------- /lorem/lorem.txt: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 2 | Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 3 | Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 4 | Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. -------------------------------------------------------------------------------- /lorem/sed.txt: -------------------------------------------------------------------------------- 1 | Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, 2 | totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. 3 | Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, 4 | sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. 5 | Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, 6 | sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. 7 | Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, 8 | nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, 9 | vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?Homo homini lupus 10 | -------------------------------------------------------------------------------- /outputs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ironhack-labs/lab-bash/689f07d292a527d60a327ab110bd91efc1370aab/outputs/.gitkeep -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | ![logo_ironhack_blue 7](https://user-images.githubusercontent.com/23629340/40541063-a07a0a8a-601a-11e8-91b5-2f13e4e6b441.png) 2 | 3 | # Lab | Bash 4 | 5 | ## Introduction 6 | 7 | In this lab we are going to practice with [`bash`](), a shell and command-line language! 8 | 9 | ## Setup 10 | 11 | 1. Fork the repo in your git hub account and then clone the folder "lab-bash" to your machine and navigate to it folder. 12 | 13 | 2. Check the contents of the folder using the "ls" command 14 | 15 | ```shell 16 | $ ls 17 | ``` 18 | 19 | and you should see the following: 20 | 21 | ```shell 22 | exercises inputs lorem lorem-copy modules outputs README.md 23 | ``` 24 | 25 | 3. Stay in the same directory/folder and complete the following exercises. 26 | 27 | ## Exercises 28 | 29 | 1. Using the echo command print in console "Hello World". Here is some info about echo command [https://discuss.codecademy.com/t/what-are-practical-uses-of-the-echo-command/394788] 30 | 2. Create a new directory called `new_dir`. 31 | 3. Delete/Remove the directory `new_dir`. 32 | 4. Copy the file `sed.txt` from the `lorem` folder and paste it to the folder `lorem-copy` folder. 33 | 5. Copy the other two files from the `lorem folder` to `lorem-copy` folder in just one line using semicolon `;`. 34 | 6. Show the `sed.txt` file content from the `lorem` folder. 35 | 7. Show the `at.txt` file and `lorem.txt` file contents from `lorem` folder. 36 | 8. Print the first 3 rows in `sed.txt` file from lorem-copy folder. 37 | 9. Print the last 3 rows in `sed.txt` file from lorem-copy folder. 38 | 10. Add `Homo homini lupus.` at the end of `sed.txt` file in the `lorem-copy` folder. 39 | 11. Print the last 3 rows in `sed.txt` file from `lorem-copy` folder. You should see `Homo homini lupus.`. 40 | 12. `sed` command is used to replace the text in a file. Use the `sed` command to replace all occurances of `et` with `ET` in the file `at.txt` file present in the folder `lorem`. You can use the following link to refer to `sed` commands [https://www.linode.com/docs/guides/manipulate-text-from-the-command-line-with-sed/] 41 | Check the contents of the sed.txt file using `cat` command. 42 | 13. Find who is the system user. 43 | 14. Find the current path of the directory you are in. 44 | 15. List all files with the extension `.txt` in lorem folder. 45 | 16. Count the rows in `sed.txt` file from lorem folder. Look concatenate `cat` and `wc` with the pipe `|`. 46 | 17. Count the **files** which start with `lorem` in all directories. 47 | 48 | 49 | ## Bonus 50 | 51 | 20. Store your `name` in a variable with `read` command. 52 | 21. Print that variable. 53 | 22. Create a new directory named with variable `name`. 54 | 23. Remove that directory. 55 | --------------------------------------------------------------------------------