How to modify contentt of a file in command prompt linux?
Answers
Answered by
0
1
Open Terminal. To do so, click Menu, then find the Terminal app--which resembles a black box with a white ">_" in it--and click on it. You'll typically find Terminal in a bar on the left side of the Menu window.You can also click the search bar at the top of the Menu window and then type in terminal to search for it.

2
Type ls into Terminal, then press ↵ Enter. Terminal opens to your home directory, but the ls command displays every folder in your current directory. To create a text file in one of these directories, you'll need to change the current directory.

3
Find a directory in which you wish to create a text file. Any directory name listed beneath the ls command (e.g., "Desktop") is a place to which you can navigate.

4
Type cd directory. You'll replace "directory" with your preferred directory's name. This command changes Terminal's focus from the current directory to the one you name.For example, you would type cd Desktop to shift Terminal's command location to the Desktop directory.If you want to create a text file in a specific folder within your selected directory, you'll place a "/" after the directory and then type in the folder's name. For example: for a folder named "Misc" in the Documents directory, you'd type cd Documents/Misc.

5
Press ↵ Enter. Doing so will run your command, thereby shifting Terminal's target directory from your home directory to the one you specified.

6
Decide on a text editing program. You can create a simple text file quickly, or you can use either Vim or Emacs to create and edit an advanced file. Now that you're in the directory in which you wish to place your text file, it's time to proceed with actually creating it.
Open Terminal. To do so, click Menu, then find the Terminal app--which resembles a black box with a white ">_" in it--and click on it. You'll typically find Terminal in a bar on the left side of the Menu window.You can also click the search bar at the top of the Menu window and then type in terminal to search for it.

2
Type ls into Terminal, then press ↵ Enter. Terminal opens to your home directory, but the ls command displays every folder in your current directory. To create a text file in one of these directories, you'll need to change the current directory.

3
Find a directory in which you wish to create a text file. Any directory name listed beneath the ls command (e.g., "Desktop") is a place to which you can navigate.

4
Type cd directory. You'll replace "directory" with your preferred directory's name. This command changes Terminal's focus from the current directory to the one you name.For example, you would type cd Desktop to shift Terminal's command location to the Desktop directory.If you want to create a text file in a specific folder within your selected directory, you'll place a "/" after the directory and then type in the folder's name. For example: for a folder named "Misc" in the Documents directory, you'd type cd Documents/Misc.

5
Press ↵ Enter. Doing so will run your command, thereby shifting Terminal's target directory from your home directory to the one you specified.

6
Decide on a text editing program. You can create a simple text file quickly, or you can use either Vim or Emacs to create and edit an advanced file. Now that you're in the directory in which you wish to place your text file, it's time to proceed with actually creating it.
Similar questions