File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ ## file operations
2
+
3
+ ### Create Files
4
+ ```
5
+ touch abc.txt -- creates a empty file
6
+ ls -l -- lists the contents in current directory
7
+
8
+ ```
9
+ VI Editor
10
+
11
+ vi abc.txt -- creates & opens the file in read only mode if the file is not exist
12
+
13
+ to edit the file, press 'i' on keyboard for INSERT mode & then you can write anything
14
+ once required text is entered press 'ESC' on keyboard to back readonly mode
15
+ press ':wq' on keyboard -- to save & come out of the file
16
+ press ':q' on keyboard -- to come out of the file without saving
17
+ press ':wq!' on keyboard -- to save forcefully & come out of the file
18
+ press ':q!' on keyboard -- to come out of the file forcefully without saving
19
+ ( note: vi is an file editor, you can use any editor you like by installing it on your machine )
20
+ ```
21
+
22
+ ### check / view the file contents
23
+
24
+ ```
25
+ cat abc.txt -- writes the content of file into terminal & exits
26
+ ```
27
+ ```
28
+ more abc.txt -- writes the content of file on terminal page by page ( to move to next page need to hit space bar on keyboard )
29
+ ```
30
+ ```
31
+ less abc.txt -- open the file on terminal & can be read line by line (use arrows to scroll up & down)
32
+
33
+ to comeout need to press 'q' on the key board
34
+ ```
35
+
36
+ ### remove the file(s)
37
+ ```
38
+ rm abc.txt -- to remove a file
39
+ ```
40
+
You can’t perform that action at this time.
0 commit comments