Question

In: Computer Science

This assignment includes the creation of a text document using Vi Editor and changing permissions to...

This assignment includes the creation of a text document using Vi Editor and changing permissions to access the new file.

  1. Use Vi Editor to create a text document
    1. Add data to your text file
    2. Save your text file
    3. Exit Vi Editor
  2. Display the contents of your file using the following tools:
    1. cat
    2. head
    3. tail
  3. Set file permissions as listed below
    1. User – RWX
    2. Group – RWX
    3. Other – RWX
  4. Use a GUI tool to display the new file in your users Home folder

Solutions

Expert Solution

1. Open terminal and type vi and hit enter to open vi editor.

2. Press i to enter insert mode.

3. Now type the content.

4. After writing the text press escape twice and enter a colon followed by wq.

5. After typing :wq enter the name you want to give to the file as shown in image.

6. Hit enter after typing the file name and your file will be saved and you'll be out of the vi editor.

Displaying the contents:

cat: cat command concatenates the files and prints the output. When we give only a single file then it just prints its contents to the screen.

head: head command displays the first ten lines of the given file.

tail: tail command displays the last ten lines of the given file.

Setting file permissions:

First let's check the permission of our file vi.txt using the command ls -l

In the above output the first - represents that the file isn't a directory, rw- represents read and write permissions for user, r-- represent only read permission for group and last r-- represents only read permissions for others.

To give read, write and execute permissions for the file, we give the command as:

chmod ugo+rwx filename

ugo stands for user, group and other

rwx stands for read write and execute.

Now, the file vi.txt is given read, write and execute permissions for user, group and others.


Related Solutions

The vi text editor can be a bit challenging to use at first, but once you...
The vi text editor can be a bit challenging to use at first, but once you have familiarized yourself with how it works you will find it an efficient way to create and edit text files in Linux, and UNIX as well. The key thing to remember is that vi has two operational modes: insert mode and command mode. In insert mode, everything you type is entered into your file. You can use the backspace, delete and the arrow keys....
Swift - Implement a simple text editor program that includes a text input field (with several...
Swift - Implement a simple text editor program that includes a text input field (with several lines), a text label, and two buttons, called "Open" and "Save". When the button "Save" is touched, the app will save the contents of the text input field to a data file (sample.txt). When the button "Open" is touched, the app will read the content from the data file, (sample.txt)) and feed the content into the text label. Thank you.
Use Vi text editor or ATOM to create a bash script file. Use the file name...
Use Vi text editor or ATOM to create a bash script file. Use the file name ayaan.sh. The script when ran it will execute the following commands all at once as script. Test your script file make sure it works. Here is the list of actions the script will do: It will create the following directory structure data2/new2/mondaynews off your home directory. inside the mondaynews, create 4 files sports.txt, baseball.txt, file1.txt and file2.txt. Make sure file1.txt and file2.txt are hidden...
In linux , Using a simple text editor, create a text file with the following name...
In linux , Using a simple text editor, create a text file with the following name "Test" and content: GNU GENERAL PUBLIC LICENSE The GNU General Public License is a free, copy left license for the GNU General Public License is intended to guarantee your freedom to GNU General Public License for most of our software; it applies … 2-Write the command to create the text file. 3-Print the file permissions. 4-Create a directory named "361" 5-Copy file "Test" to...
Javascipt Assignment: Create a document that includes a constructor function named Company in the document head...
Javascipt Assignment: Create a document that includes a constructor function named Company in the document head area. Include four properties in the Company object definition: name, products, motto, and numEmployees (for number of employees.) Instantiate a new Company object in the document body , then assign values to each of the properties Print the name, products, motto, and the numEmployees properties to the screen using document.write methods. Combine each printed property with a descriptive string. For example, when you print...
a) Using vi (or from your favorite editor) create a file called myscript. Enter the following...
a) Using vi (or from your favorite editor) create a file called myscript. Enter the following text into the myscript file. #!/bin/bash echo -e "this is a sample shell script. \t It displays mounted filesystems \a" mount b) Now, save the file and quit the editor. c) type ls -l myscript and hit enter. What permissions do you have on the file? d) type bash myscript and hit enter. What did it do? e) what does the \t and \a...
1. Suppose an average page of a Unicode text document holds roughly 1500 characters. Using appropriate...
1. Suppose an average page of a Unicode text document holds roughly 1500 characters. Using appropriate units of measure, estimate how many such pages a CD storage media with 600 MB capacity can store. Show your work. 2. Perform the following using 10-bit floating-point notation having the format SEEEMMMMMM: (A) Decode 1101110110 to decimal integer and/or fraction. (B) Decode 0001100000 to decimal integer and/or fraction. (C) Encode -5/32 (D) Encode: +6 and 5/8 3. Please read carefully. Using the minimum...
Using the Quality Attributes Table document provided, complete a page table of quality attributes. Individual Assignment...
Using the Quality Attributes Table document provided, complete a page table of quality attributes. Individual Assignment – Week Four Complete the following table: Attribute Type Categories within the Attribute Type Example from the program Functional attributes <List the categories of attributes of this type (for example “Boolean”)> <Describe an attribute you can measure in your program (for example, user data integrity)> Operational attributes Usability attributes Business attributes Structural attributes
Chapter 8 Case Please submit this assignment as a Text Submission using the "Write Submission" button....
Chapter 8 Case Please submit this assignment as a Text Submission using the "Write Submission" button. Submissions attached as a separate file will not be graded! Englewood Company has an opportunity to produce and sell a revolutionary new smoke detector for homes. To determine whether this would be a profitable venture, the company has gathered the following data on probable costs and market potential: New equipment would have to be acquired to produce the smoke detector. The equipment would cost...
Linux Scripting Exercises Step 1: Using the nano text editor, enter the code below and save it as welcome.sh, change its permission to executable, run the script, and answer the questions below ( 1.1-1.5):
  Linux Scripting Exercises Step 1: Using the nano text editor, enter the code below and save it as welcome.sh, change its permission to executable, run the script, and answer the questions below ( 1.1-1.5): #!/bin/bash # echo ”Hello $user” echo ”Today is `date` ” echo ”I feel $argv[1]” today echo ”The following users are logged in: `users`” Explain and number your answers for 1.1-1.5 below: 1.1. $user does in line 3 1.2. `date` does in line 4 1.3. $argv[1]...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT