Reference number: CH000773
How do I open, create, edit, or view a file in Linux?
Question:
How do I open, create, edit, or view a file in Linux?
Answer:There are several different commands that can be used to open,
create, edit, and/or view a file in Linux. Below is a listing of each of these
commands. Click on the links for each of these commands to get
additional information about them. Each of the commands have been
listed in order they are most likely to be found and/or in the order
we suggest using. Keep in mind that some variants of Linux may also
not include each of the below commands, for example, the pico
command is often not included in many default installations.
View a file
cat
tail
head
pg
Note: The commands listed below are also all capable of viewing a
file.
Open, create, and edit a file
pico
vi
vim
ed
For users new to Linux and/or familiar with MS-DOS, we highly
recommend using the pico command to create and edit text files.
Below is an example of pico that could be used to create a file in Linux.
pico myfile.htm
In the above example, assuming the file "myfile.htm" does not
exist, pico would open a blank edit page for myfile.htm. If this file
did exist, pico would open any text that file contains.
|
|
| Resolved | Were you able to locate the answer to your questions? |
|
|