Question

(In Linux) 1. Create a file to write to from your script and save it as...

(In Linux)

1. Create a file to write to from your script and save it as “.txt”.

2. Write the following information to the file that you created in Step 1:

  • Today's date
  • Your full name
  • Your student ID
  • The name of your course
  • What directory you are in
  • File permissions of the file that you created that allow everyone to read, write, and execute
  • The long list of files in your current directory, providing all items and their process IDs (pids)

Remember to append the information to the file for each command, except the first one.

3. Once you are done with the code, you can write the file and exit the text editor (vi), as follows:

:wq!

4. Make your script executable, as follows:

chmod u+x

5. Execute your script from the command line. (Note that you will not see any output on the command line.)

6. View the content of the text file that you created with your program to verify all of the required information from Step 2 that has been written to it.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1. To create the file write: vi filename.txt

2. Now write your data.

3. To save and quit press ESC and write :wq! in your text editor.

4. To make it executable write chmod u+x filename.txt. This will give the permission for execute to user.

5. To run the script write ./filename.txt.

6. To see the file write cat filename.txt

If the answer helped please upvote. It means a lot. For any query comment below.


Add a comment
Know the answer?
Add Answer to:
(In Linux) 1. Create a file to write to from your script and save it as...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hi I beed this assignment to be in a script in linux from codio. Can someone...

    Hi I beed this assignment to be in a script in linux from codio. Can someone please help me step by step thank you. Overview: In this milestone, you will demonstrate your ability to create a basic script in Linux. Review the Final Project Guidelines and Rubric document to see how this milestone will prepare you for the scripting portion of the project. You will perform this milestone in Codio in the unit called “Milestone 2: Scripting.” You will create...

  • LINUX 140U Create a file named script1.sh that contains a bash script that: Accepts NO command...

    LINUX 140U Create a file named script1.sh that contains a bash script that: Accepts NO command line arguments and does NOT use the read command. I will give you no credit if your bash script includes a read command. Also, you need to have at least one for..in loop in your code even if there may be other ways to do this problem. The script will go through a list of entries in the current directory (do not process subdirectories):...

  • Problem 1 Write a BASH script to create a user account from the Linux system on...

    Problem 1 Write a BASH script to create a user account from the Linux system on which your script is run. The script should process two positional parameters. First positional parameter is supposed to be a string with a user name (e.g., user_name) Second positional parameter is supposed to be a string with a user password (e.g., user_password) In your script: Check if two positional parameters were passed to your script when it was invoked If NOT, print an appropriate...

  • IT 255 Milestone Two Guidelines and Rubric Overview: In this milestone, you will demonstrate your ability...

    IT 255 Milestone Two Guidelines and Rubric Overview: In this milestone, you will demonstrate your ability to create a basic script in Linux. Review the Final Project Guidelines and Rubric document to see how this milestone will prepare you for the scripting portion of the project. You will perform this milestone in Codio in the unit called "Milestone 2: Scripting." You will create this script with the vi editor. The script will combine multiple commands and simplify a repeatable task....

  • Using Kali Linux, the Windows Linux Sub-System, or another Debian based Linux distribution, perform the following...

    Using Kali Linux, the Windows Linux Sub-System, or another Debian based Linux distribution, perform the following tasks based on the Linux Fundamentals lecture. For this lab, take screenshots for all major steps completed to illustrate that each task was successfully completed the same method as would be used for other labs). Tasks: 1. Create a new user named Billy Bob using the command linter face 2. Add Billy Bob to the sudoers group 3. Update and upgrade your Linux distribution...

  • Could you help me do the commands from nmber 16 to 21 For this assignment, you...

    Could you help me do the commands from nmber 16 to 21 For this assignment, you will: Unpack a tar archive. Change the unpacked files. Repack the files into a new tar archive. Turn in your new tar archive. Details Do not use an editor unless it specifically states to edit the file. By "editor" I mean vim, gedit, pico, etc. Despite its name, we don't consider sed to be an editor in this assignment, so you may use it...

  • Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hin...

    Open vi or pico and create a script called Information.   Add the contents from the following table to the script: (Hint: use echo to add blank lines to your output and to write out the headings). Headings: Utilities (command to execute) Today’s date is: date The current users logged on to the system are: who My current startup directory is: pwd Today’s identification information is: id The processes running on my system are: ps Add a header to your Information...

  • Objective : Write a C Shell script which copies all files(*.java and *.class) from your home dire...

    Objective : Write a C Shell script which copies all files(*.java and *.class) from your home directory to a new one, and Analyze the new directory information such as number of files, user permissions, and disk usage. Sample Output:                                                    << CS Directory Analysis >>      Date:   ============================================================ Current Directory: /home/tomss New Directory Created : /home/tomss/pgm01 File information Total Number of files : 22 files Directory files:   0 files Plain text files:   10 files File have read permissions: 3 files File have...

  • 1. Install the supplied bash script on the Kali Linux VM BASH filename :ipLAN In text...

    1. Install the supplied bash script on the Kali Linux VM BASH filename :ipLAN In text editor looks like this #!/bin/bash is_alive_ping() {    ping -c 1 $1 >/dev/null 2 >&1    [ $? -eq 0 ] && echo Node with IP: $1 is UP. } for i in 192.168.1.{1..255} do is_alive_ping $1 & disown done QUESTION: Install the supplied bash script on the Kali Linux VM **NOte how do i install the above script in kali ,when i am...

  • using lubuntu ce the following activities on your Linux virtual machine. Then complete estions. Write a script file which when executed will perform the following: First display today's date in d...

    using lubuntu ce the following activities on your Linux virtual machine. Then complete estions. Write a script file which when executed will perform the following: First display today's date in dd.mm.YYYY format (e.g. 20.04.2019). Ask user to enter a name to create a directory. Create a directory by the given directory name above. . . Ask user to enter a name to create a file. Copy the file /etc/passwd to the given filename above inside the newly created directory Copy...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT