Computer Science, asked by iamgolibhai, 3 months ago

How will you create a new file which contains the text "hello world"
without using a text editor?
h​

Answers

Answered by Vijayk2580
0

Answer:

on cmd use some commands and we create a file without using any other text editor.

copy con filename.txt press enter

then we write the content and press ctrl+z and enter.

Explanation:

Answered by poojan
19

We can create a new file (without using the text editor explicitly) and insert data into it using Linux's cat command.

Explanation:

The basic syntax of the command is:

$cat > filename

<<< Enter the data to be stored into the file here

Press ctrl+z to exit the file.

Following the same syntax, let us create a text file named 'sample' and write the data 'Hello World' into it.

$cat > sample.txt

<<< Hello World

Pressed ctrl+z

$

The command given above looks for the file in the path traversed into, and if not found creates a new file with that name. If found, it just overrides the data in the file with the new data mentioned.

If you want to append the data to the previously existing one, you need to use '>>' operator instead of '>', as in:

$cat >> sample.txt

Another trick to write the data into the file without opening a text editor is:

echo " Enter the data to be stored into the file here" > filename

echo "Hello World" > sample.txt

To append the data to the existing one,

echo " Enter the data to be stored into the file here" >> filename

echo "Hello World" >> sample.txt

Learn more:

1. Ch+=2 is equivalent to​

brainly.in/question/21331324

2. A CSS file cannot be linked to a web page. State True or False

brainly.in/question/21107345

Similar questions