Coder Social home page Coder Social logo

lab-bash's Introduction

logo_ironhack_blue 7

Lab | Bash

Introduction

In this lab, we are going to practice with bash, a shell and command-line language!

Setup

  1. Open a Terminal in your system:

    • Linux/MacOS users: open a terminal in your system.
    • Windows users: open GitBash in your system
  2. Download and install the Sublime text editor for your OS here.

  3. Open the Sublime text editor side by side with the Terminal.

  4. Fork this repo in your git hub account and then clone it into the folder Week_1/Day_1/ of your machine. This will create a folder called "lab-bash" inside.

  5. Use the terminal to navigate to the "lab-bash" folder.

  6. Use the Sublime menu to open a new empty file in the "lab-bash" folder and name it "lab_solutions.txt".

  7. Check the contents of the folder using the "ls" command in the Terminal.

ls

and you should see the following:

exercises  inputs  lorem  lorem-copy  modules  outputs  README.md
  1. Stay in the same directory/folder and complete the following exercises.

  2. To provide your solutions, test your solution in the terminal and once you figured out the solution to each exercise do the following:

  • Copy the statement of each exercise on the "lab_solutions.txt" file opened in the Sublime text editor
  • Add the Terminal command needed to solve each exercise on the "lab_solutions.txt" just below the exercise statement as shown below:
terminal_command # replace "terminal_command" with the command that you used in the terminal to solve the exercise
  • Save the "lab_solutions.txt" file.
  1. Once you finished all the exercises type the following in the Terminal:

    • git status
    • git add lab_solutions.txt
    • git commit -m "Lab solutions"
    • git push origin master
  2. Copy the url of your forked GitHub repo on the student portal.

Exercises

  1. Using the echo command print in console "Hello World". Here is some info about the echo command [https://discuss.codecademy.com/t/what-are-practical-uses-of-the-echo-command/394788]
  2. Create a new directory called new_dir.
  3. Delete/Remove the directory new_dir.
  4. Copy the file sed.txt from the lorem folder and paste it to the folder lorem-copy folder.
  5. Copy the other two files from the lorem folder to lorem-copy folder in just one line using the semicolon ;.
  6. Show the sed.txt file content from the lorem folder using the cat
  7. Show the at.txt file and lorem.txt file contents from lorem folder.
  8. Print the first 3 rows in sed.txt file from lorem-copy folder using head
  9. Print the last 3 rows in sed.txt file from lorem-copy folder using tail.
  10. Add Homo homini lupus. at the end of sed.txt file in the lorem-copy folder using >>.
  11. Print the last 3 rows in sed.txt file from lorem-copy folder. You should see Homo homini lupus..
  12. sed command is used to replace the text in a file. Use the sed command to replace all occurences 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/] Check the contents of the sed.txt file using cat command.
  13. Find who is the system user ( google is your friend ;) ).
  14. Find the current path of the directory you are in.
  15. List all files with the extension .txt in lorem folder.
  16. Count the rows in sed.txt file from lorem folder. Look concatenate cat and wc with the pipe |.
  17. Count the files that start with lorem in all directories.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.