File creation in Linux How do we create a file or a dir in Linux? There are several different commands that can be used to open, create, edit, or view a file in Linux. Create a new file VI command: -as default on most of the Linux OS we will have the "vi" command. "VI" command can be also used to edit already created files. How do we use the "vi" command to create a new file : Syntax: -to create or edit a file: This is how a empty file looks like, you can edit this file by pressing the "i" key(insert). To save and exit the file : Syntax: To exit the file without saving the the altered data : Syntax: General Syntax used with "VI": How to remove a file in Linux: Command : rm [option] "file name" Option [-f] -Forcefully remove file. Other Linux editos that can be used: cat -Allows you to look, modify or combine a file. Sintax: [-n] -Precede each line output with its line number. [-b] -Number the lines, as -n, but omit the line numbers from blank lines. [-u] -The output is not buffered. (The default is buffered output.) [-s] -cat is silent about non-existent files. Examples -Reads file1.txt and file2.txt and combines those files to make file3.txt. tail -Will show the last part of the file. Syntax To get more info about this command you can just open a bash and type : - this will pull out the manual for this command. There are many Linux editors that are in use but we will only use the ones above. Now that we have learned how to create files let's see how to create directory or folder. The command used for creating directory or folders is : -make directory. The general syntax is Options: