Exercise Bash 3

pdf

School

Eastern Michigan University *

*We aren’t endorsed by this school

Course

381

Subject

Information Systems

Date

Feb 20, 2024

Type

pdf

Pages

2

Uploaded by CorporalSquirrelPerson1025

Report
Name: Ciara Wheeler EID: E02500688 Bash Command Exercise 3 1. Please explain what the following command does. What permissions are given to the owner, group, and others? chmod 751 hello.py The 7 means the owner gets read, write, and execute permissions The 5 means the group gets read and execute permissions The 1 means others only get execute permissions 2. What are the parameters of the following command: chgrp usergroup1 hello.txt Usergroup1 and hello.txt 3. Please write a command that uses echo and redirection to create a file, with the name " hello world.txt ". Note that there is a space between "hello" and "world" in the filename. The file's content should be: "hello world". echo “hello world” > “hello world.txt” 4. Please (1) explain the differences between > and >>, (2) provide two command examples that show the difference between > and >> , and (3) describe the outputs of the commands. (1) both > and >> will “redirect” the output stream But the > (single greater sign) will overwrite the contents of the file if it is already existing and has contents in it. The >> (two greater signs) will add the output to the end of the file.
(2) (3) The first command was : echo "My name is Ciara" > "hello world.txt" The contents in the file before this command was “hello world” After the command, the contents in the same file was “My name is Ciara” The second command was : echo “Adding hello world below now” >> “hello world.txt” The contents of the file after this command was “My name is Ciara Adding hello world below now” So the second command added the echo contents onto the end of the file, rather than writing over the existing content.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help