Skip to content

Commit 4fce204

Browse files
authored
Added Commands
Added more commands to learn after 10.
1 parent 0ba8f35 commit 4fce204

File tree

1 file changed

+95
-5
lines changed

1 file changed

+95
-5
lines changed

README.md

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# LearnBase-Bash :book:
22
### Heared about Linux? Want to learn bash scripting? or Searching for a good Handbook for terminal Commands?
3+
> 🏗️**This Repository still under construction. But feel free to explore and contribute** 🤿
34
45
**HERE's ALL.**<br>
56
In a programmers' life, Linux is the thing that one should know how to use it efficiently.
67
This is a self learn tutorial for those who new to Linux terminal and want to learn how to use it effectively.
78

8-
> This tutorial is covering the most used(80-90%) commands.
9+
> This tutorial is covering the most used(80-90%) commands.<br>
910
1011
### 📙Let's Start❗
1112

@@ -14,13 +15,15 @@ __1. ```man``` command__
1415
- Syntax: ```man <command_name>```
1516
- use ```q``` key to exit from man page
1617

18+
1719
__2. ```ls``` command__
1820
- list command, used to list the files.
1921
- Syntax: ```ls``` accepts a lot of options
2022
- ```ls```
2123
- ```ls <folder_path>``` - to list files of a specific folder
2224
- ```ls -al```
2325

26+
2427
__3. ```mkdir``` command__
2528
- to create folders
2629
- Syntax:
@@ -29,6 +32,7 @@ __3. ```mkdir``` command__
2932
- ```mkdir -p <parentfolder / childfolder>``` - nested folders
3033
-
3134

35+
3236
__4. ```cd``` command__
3337
- cd means change directory. You can jump between folders using this command.
3438
-Syntax:
@@ -37,34 +41,120 @@ __4. ```cd``` command__
3741
- ```cd ../folder_name``` -
3842
- ```cd /<foldername>``` - use absolute paths, which start from the root folder ```/```
3943

44+
4045
__5. ```pwd``` command__
4146
- prints current folder path.
4247

48+
4349
__6. ```rmdir``` command__
4450
- delete __empty__ folders using this command
4551
- Syntax:
46-
- ```rmdir <folder_name>
52+
- ```rmdir <folder_name>```
4753
- ```rm -rf <folder>``` : _To delete folders with files in them_
4854
> ❗ NOTE: this command does not ask for the confirmation from the user and immediately remove that you ask it to remove.
4955
56+
5057
__7. ```touch``` command__
5158
- to create an empty file
52-
- Syntax: ```touch <file_name>
59+
- Syntax: ```touch <file_name>```
5360
- If the file already exists, it opens th file in write mode.
5461

62+
5563
__8. ```mv``` command__
5664
- to move the file and also to rename the file
5765
- ```mv <from_folder/file> <to_folder/file>```
5866
- ```mv <file1> <file2> <tofolder>``` - to move more than one file, make a list of file and move to folder.
5967

68+
6069
__9. ```cp``` command__
6170
- to copy a file
6271

72+
6373
__10. ```open``` command__
6474
- to open a file using this command
6575
- Syntax: ```open <filename>```
6676

67-
__11. ```find``` command
77+
78+
__11. ```find``` command__
6879
- used to find files or folders matching a particular search pattern. It searches recursively.
80+
- ```file . -name <file_name>``` - to find the file with its name.
6981
- Example: to find all the files in current directory with extension ```.png``` and also print the relative path.
70-
- ```find . -name '*.png'```
82+
- Syntax:
83+
- ```find . -name '*.png'```
84+
-
85+
86+
87+
__12. ```gzip``` command__
88+
- to compress a file with extension ``` .gz```
89+
- Syntax:
90+
- ```gzip <file_name>``` : using this the original file will be deleted.
91+
- ```gzip -c <file_name> > <filename.gz>``` : using ```-c``` option specifies that the output will go to the standard output stream without affecting original file.
92+
93+
> or can use -k option
94+
95+
```gzip -k <file_name>```
96+
- ```gzip <file1> <file2>``` : to zip mutiple files
97+
- 🟡```gzip -r <folder_name>```: to compress a folder recursively
98+
- 🟢```gzip -d <file_name.gz>``` : to decompress a file
99+
100+
101+
__13. ```gunzip``` command__
102+
- equivalent to ```gzip``` command, but ``` -d``` option is enabled by default.
103+
- Syntax:
104+
- ```gunzip [option] [archive name/file name]```
105+
106+
107+
__14. ```alias``` command__
108+
- to create your command for your convenience.
109+
- Example:
110+
- ```alias ll = 'ls -al'``` : use ```ll``` in place of ```ls -al``` command
111+
- ```alias``` : *(with no option)* to list all alias defines
112+
113+
114+
__15. ```cat``` command__
115+
- *SUPER POWERFUL command*
116+
- ```cat <file_name>``` : prints a file content
117+
- ```cat <file1> <file2>``` : to print multiple file content
118+
- ```cat <file1> <file2> > file3``` : to concatenate the content of multiple files into a new one.
119+
- ```cat <file1> <file2> >> <file3>``` : to append content of multiple files into new one.
120+
- ```cat <file_name> | <another_command>``` : to feed a file's content as input to another command.
121+
- ```cat -s <file_name>``` to remove multiple empty lines.
122+
123+
124+
__16. ```less``` command__
125+
- to watch the file content in an interactive UI
126+
- ```less <filename>```
127+
128+
129+
__17. ```head``` and ```tail``` command__
130+
- ```head``` to print first 10 lines of the file.
131+
- ```tail``` to print last 10 lines of the file.
132+
133+
134+
__18. ```wc``` command__
135+
- helps in counting the lines, words, and characters in a file. Mostly, it is used with pipes ```|``` for counting operation.
136+
- It will display the number of lines, words, and bytes from the file.
137+
- Syntax: ```wc [option]... [file]...```
138+
139+
140+
__19. ```grep``` command__
141+
> grep command filters the content of a file which makes search easy.
142+
> _grep_ stands for global regular expression print.
143+
144+
- _helpful in day-to-day coding_
145+
- Syntax:
146+
- ```command | grep <searchWord>``` : with pipes (case sensitive by default)
147+
- ```grep <search_Word> <file_name>``` : without pipes
148+
- ```grep -v <search_Word> <file_name>``` : to search for non-matching searched word.
149+
- ```grep -i <searchWord> <filename>``` : to filter output in a case-insensitive way.
150+
151+
152+
__20. ```sort``` command__
153+
- used to sort the list items
154+
- ```sort <file_name>``` : by default case sensitive and alphabetic.
155+
- ```sort -r <file_name>``` : reverse order sort.
156+
- ```sort --ignore-case <file_name>``` : to sort case insensitive, use ```-n``` to sort numerically.
157+
- ```sort -u <file_name>``` : to remove duplicated.
158+
- Example : ```ls | sort``` : used with list command.
159+
160+

0 commit comments

Comments
 (0)