├── Linux.md
├── Mongo-Shell-Commands
└── README.md
├── README.md
└── Terminal_Commands.mjs
/Linux.md:
--------------------------------------------------------------------------------
1 | # Linux
2 |
3 | ### Change swap file
4 |
5 | Turn off default swap
6 |
7 | ```bash
8 | sudo swapoff /swapfile
9 | ```
10 |
11 | To access the root account in Ubuntu
12 |
13 | ```bash
14 | sudo -s
15 | ```
16 |
17 | Once you’ve got root access in the terminal, use the rm command to delete the default Ubuntu swap file from your computer.
18 |
19 | ```bash
20 | cd / && rm swapfile
21 | ```
22 |
23 | #### Create a new swap file
24 |
25 | Now that the default Ubuntu swap file has been deleted from your system, it is time to create a new one. To make a new swap file, you’ll need to use the dd command. The dd command is handy and will be able to create a new swap file as big or as small as you like.
26 |
27 | To create a new swap file, you must first determine the size in Megabytes, as that’s what dd uses. For example, to make an 8 GB swap file, you’d do 8 x 1024, which calculates to 8192 MB.
28 |
29 | ```bash
30 | dd if=/dev/zero of=/swapfile bs=1M count=YOUR_MEGABYTE_NUMBER_HERE
31 | ```
32 |
33 | The dd command will take a bit of time to complete. When it is done, your new swap file will be in the / directory, where the old swap file was.
34 |
35 | After creating the new swap file, use the chmod command to update the swap file to the correct permissions.
36 |
37 | ```bash
38 | chmod 600 /swapfile
39 | ```
40 |
41 | #### Enable new swap
42 |
43 | ```bash
44 | mkswap /swapfile
45 | ```
46 |
47 | ```bash
48 | swapon /swapfile
49 | ```
50 |
--------------------------------------------------------------------------------
/Mongo-Shell-Commands/README.md:
--------------------------------------------------------------------------------
1 | Copied from
2 | [Abdul Rehman](https://github.com/AbdulRehmanAtcha/Mongo-Shell-Commands)
3 |
4 | ## Mongo-Shell-Commands
5 |
6 |
7 | - Run Mongo Shell.
8 | - To see databases type show dbs
9 | - To create Database simply type use databaseName
10 | - If a database is present with that name, it will shift to that, otherwise it will create a database with that name.
11 | - To create a collection inside a database simply type db.createCollection("Name Here").
12 | - To see collections insert show collections
13 | - To insert a single document inside a collection simply write db.collectionName.insertOne({Here your fields with value}).
14 | - To insert multiple documents inside a collection simply write db.collectionName.insertMany({Here your fields with value}, {Here your fields with value})
15 | - To read documents inside collection db.collectionName.find(query, projection)
16 | - Some other methods to read are db.collectionName.find(query,projection).limit(how many values you want).skip(how many values you want to skip)
17 | - To update a document's field there are two ways for it.
18 |
19 | - To update a single document db.updateOne({filter}, {$set: {update}}})
20 | - To update many documents db.updateMany({filter}, {$set: {update}}})
21 |
22 |
23 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Terminal-Commands
2 |
3 | ## All basic terminal commands in one place
4 |
5 | Show some ❤ by
some repositories
6 |
7 | You can contribute to this readme
8 | If you want to contribute with a loooot of commands make a new .txt file / if you see old commands don't tell me fork it and feel free to contribute in this OpenSource Project..
9 |
10 |
11 |
12 |
13 | [Git Commands](https://github.com/shehza-d/Terminal-Commands#git-commands)
14 |
15 | [NEXT JS Commands](https://github.com/shehza-d/Terminal-Commands#next-js-commands)
16 |
17 | [Tailwind Commands](https://github.com/shehza-d/Terminal-Commands#tailwind-css-commands)
18 |
19 | [React Commands](https://github.com/shehza-d/Terminal-Commands#react-commands)
20 |
21 | [Node Commands](https://github.com/shehza-d/Terminal-Commands#node-commands)
22 |
23 | [ExpressJS Commands](https://github.com/shehza-d/Terminal-Commands#expressjs-commands)
24 |
25 | [React-Native Commands](https://github.com/shehza-d/Terminal-Commands#react-native-commands)
26 |
27 | [FireBase Commands](https://github.com/shehza-d/Terminal-Commands#firebase-commands)
28 |
29 | [Netlify Commands](https://github.com/shehza-d/Terminal-Commands#netlify-commands)
30 |
31 | [TypeScript Commands](https://github.com/shehza-d/Terminal-Commands#typescript-commands)
32 |
33 | [Important NPM Packages](https://github.com/shehza-d/Terminal-Commands#important-npm-packages)
34 |
35 | [Linux COMMANDS](https://github.com/shehza-d/Terminal-Commands#linux-commands)
36 |
37 |
38 |
39 |
40 | ## Git Commands
41 |
42 | ```
43 | git init
44 |
45 | git add *
46 |
47 | git commit -m "Pushing new Changes"
48 |
49 | git branch -m main
50 |
51 | git add remote url_here
52 |
53 | git push -u origin main
54 | ```
55 |
56 | ```
57 | git branch branch_name
58 | ```
59 |
60 | ```
61 | git checkout branch_name
62 | ```
63 |
64 | first time only
65 |
66 | ```
67 | git config --global user.name "Shehzad"
68 | git config --global user.email "shehzaddiqbal@gmail.com"
69 | ```
70 |
71 | ```
72 | git status
73 | ```
74 |
75 | to save git credential
76 |
77 | ```
78 | git config --global credential.helper 'cache --timeout=2628288'
79 | ```
80 |
81 | `.gitignore` will prevent untracked files from being added (without an add -f) to the set of files tracked by Git. However, Git will continue to track any files that are already being tracked.
82 |
83 | To stop tracking a file, we must remove it from the index:
84 | ```bash
85 | git rm --cached
86 | ```
87 |
88 | To remove a folder and all files in the folder recursively:
89 | ```bash
90 | git rm -r --cached
91 | ```
92 |
93 |
94 |
95 | ## NEXT JS Commands
96 |
97 | ```
98 | npx create-next-app
99 | ```
100 |
101 | NEXT 13
102 |
103 | ```
104 | npx create-next-app@latest --experimental-app --typescript --eslint
105 | ```
106 |
107 | ```
108 | npm i @chakra-ui/react @emotion/react @emotion/styled framer-motion @chakra-ui/icons
109 | ```
110 |
111 |
112 |
113 | ## Tailwind CSS Commands
114 |
115 | ```
116 | npx tailwindcss init -p
117 | ```
118 |
119 | ```
120 | npm i -D tailwindcss postcss autoprefixer
121 | ```
122 |
123 | ```
124 | npm i -D prettier-plugin-tailwindcss
125 | ```
126 |
127 | to sort tailwind classes(prettier extension needed)
128 |
129 | ```
130 | npx tailwindcss init sdConfig --full
131 | ```
132 |
133 |
134 |
135 | ## TurboPack Commands
136 |
137 | ```
138 | npx create-next-app@latest -e with-turbopack
139 | ```
140 |
141 | ```
142 | npx create-next-app --example with-turbopack
143 | ```
144 |
145 | ```
146 | next dev --turbo
147 | ```
148 |
149 |
150 |
151 | ## React Commands
152 |
153 | ```
154 | npx create-react-app myappname
155 | ```
156 |
157 | (to create react project)
158 |
159 | ```
160 | npx create-react-app app_name --template redux-typescript
161 | ```
162 |
163 |
164 |
165 | ## Node Commands
166 |
167 | ```
168 | node --version
169 | ```
170 |
171 | ```
172 | node index.js
173 | ```
174 |
175 | (to execute a file e.g node fileKaName.js)
176 |
177 | installing nvm
178 |
179 | ```
180 | nvm install (version) like (12.16.3)
181 | ```
182 |
183 | phir
184 |
185 | ```
186 | nvm use 12.16.3
187 | ```
188 |
189 |
190 |
191 | ## ExpressJS Commands
192 |
193 | ```
194 | npm init -Y
195 | ```
196 |
197 | (to initinil node project is easy words to create package.json) -y for default settings
198 |
199 | npm install express
200 |
201 | (to initilize express project express ky liye)
202 |
203 | ```
204 | node index.mjs
205 | ```
206 |
207 |
208 |
209 | ## React-Native Commands
210 |
211 | ```
212 | npx react-native init AwesomeProject
213 | ```
214 |
215 | ```
216 | npx react-native start
217 | ```
218 |
219 | ```
220 | npx react-native run-android
221 | ```
222 |
223 |
224 |
225 | ## FireBase Commands
226 |
227 | ```
228 | npm install -g firebase-tools
229 | ```
230 |
231 | (install CLI(also use this command to update CLI))
232 |
233 | firebase login
234 |
235 | (first time only)
236 |
237 | firebase init
238 |
239 | (initilize project(apne project ma run karna ye))
240 |
241 | firebase deploy --only hosting
242 |
243 | firebase deploy other options [(--only hosting),(--only database),(--only storage),(--only firestore),(--only functions)]
244 |
245 | ```
246 | npm install firebase@latest --save
247 | ```
248 |
249 | ```
250 | firebase --help
251 | ```
252 |
253 |
254 |
255 | ## Netlify Commands
256 |
257 | ```
258 | npm install netlify-cli -g
259 | ```
260 |
261 | (first time only)
262 |
263 | ```
264 | netlify login
265 | ```
266 |
267 | (first time only)
268 | !(netlify init)
269 |
270 | ```
271 | netlify deploy --prod
272 | ```
273 |
274 | netlify status
275 |
276 | ```
277 | netlify help
278 | ```
279 |
280 | ```
281 | netlify logout
282 | ```
283 |
284 |
288 |
289 |
290 | ## Material UI
291 |
292 | ```
293 | npm install @mui/material @emotion/react @emotion/styled
294 | ```
295 |
296 | ```
297 | npm install @mui/material @mui/styled-engine-sc styled-components
298 | ```
299 |
300 | ```
301 | npm install @fontsource/roboto
302 | ```
303 |
304 |
305 |
306 | ## TypeScript Commands
307 |
308 | ```
309 | npm install typescript --save-dev --global
310 | ```
311 |
312 | ```
313 | tsc --init
314 | ```
315 |
316 | (to make ts.config)
317 |
318 | ```
319 | tsc index.ts
320 | ```
321 |
322 | (file name to compile a file)
323 |
324 | ```
325 | npx create-react-app app_name --template typescript
326 | ```
327 |
328 |
329 |
330 | ## Prettier
331 |
332 | ```
333 | npx prettier --write .
334 | ```
335 |
336 | to format all files in a project (even without extension installed)
337 |
338 |
339 |
340 |
347 |
348 | ## Important NPM Packages
349 |
350 | ```
351 | npm i mongoose cors formik yup react-router-dom react-icons prompt-sync
352 | ```
353 |
354 |
355 |
356 | ## Linux COMMANDS
357 |
358 | show wifi passwords linux
359 | ```
360 | nmcli device wifi show-password
361 | ```
362 |
363 | 1. cd
364 | dir or ls (to view files in directories.)
365 |
366 | ```
367 | sudo apt install node npm git code
368 | ```
369 |
370 | ```
371 | sudo snap install vlc code telegram-desktop chromium gimp && sudo snap install shotcut --classic
372 | ```
373 |
374 | ## DotNet on Ubuntu for C#
375 |
376 | sudo apt-get install wget apt-transport-https
377 |
378 | wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb
379 |
380 | sudo dpkg -i packages-microsoft-prod.deb
381 |
382 | sudo apt-get update
383 |
384 | sudo apt-get install dotnet-sdk-5.0
385 |
386 | dotnet --version
387 |
--------------------------------------------------------------------------------
/Terminal_Commands.mjs:
--------------------------------------------------------------------------------
1 | // if you see old commands don't tell me fork it and feel free to contribute in this OpenSource Project
2 | $$$$$$$$$$ COMMANDS $$$$$$$$$$$$$$$
3 | cd
4 | dir or ls (to view files in directories)
5 |
6 | %%%%%%%%%% Git Commands %%%%%%%%%%%%
7 |
8 | git add *
9 |
10 | git commit -m "apna comment"
11 |
12 | git push origin main
13 |
14 | (
15 | first time
16 | git config --global user.name "apna nam”
17 |
18 | git config --global user.email "apna email”
19 | )
20 |
21 |
22 | %%%%%%%%%% React Commands %%%%%%%%%%%%
23 |
24 | npx create-react-app myappname (to create react project)
25 |
26 | npm start (to start app)
27 |
28 |
29 | npm run build (after work make build folder)
30 |
31 |
32 |
33 |
34 | %%%%%%%%%% Node Commands %%%%%%%%%%%%
35 |
36 | node -v
37 |
38 | node fileKaName
39 |
40 |
41 |
42 | nvm install (version) like (12.16.3)
43 | phir
44 | nvm use 12.16.3
45 |
46 |
47 | %%%%%%%%%% ExpressJS Commands %%%%%%%%%%%%
48 |
49 | npm init (to create package.json) -y for default settings
50 |
51 | npm install express
52 |
53 |
54 |
55 | %%%%%%%%%% FireBase Commands %%%%%%%%%%%%
56 |
57 | npm install -g firebase-tools (install CLI(also use this command to update CLI))
58 |
59 | firebase login (first time only)
60 |
61 | firebase init (initilize project(apne project ma run karna ye))
62 |
63 | firebase deploy --only hosting
64 |
65 | firebase deploy [(--only hosting),(--only database),(--only storage),(--only firestore),(--only functions)]
66 |
67 |
68 | firebase --help
69 |
70 | %%%%%%%%%% Netlify Commands %%%%%%%%%%%%
71 |
72 | npm install netlify-cli -g (first time only)
73 |
74 | netlify login (first time only)
75 |
76 | !(netlify init)
77 |
78 | netlify deploy --prod
79 |
80 |
81 | netlify status
82 |
83 | netlify help
84 |
85 | %%%%%%%%%% Formik i Commands %%%%%%%%%%%%
86 |
87 | npm install formik --save
88 |
89 | %%%%%%%%%% yup i Commands %%%%%%%%%%%%
90 |
91 | npm i yup
92 |
93 | npm install -S yup
94 |
95 | %%%%%%%%%% Git Commands %%%%%%%%%%%%
96 |
97 |
98 |
99 | // npm init (to initinil node project)
100 | // npm install express (to initilize express project) express ky liye
101 | //
102 | //
103 | //
104 | //
105 |
106 | %%%%%%%%%% MongoDB Commands %%%%%%%%%%%%
107 |
108 | npm i mongoose
109 |
110 |
111 |
112 | %%%%%%%%%% TypeScript Commands %%%%%%%%%%%%
113 |
114 | npm install typescript --save-dev
115 |
116 | npm i -g typescript
117 |
118 | tsc (file ka nam)eg. tsc index.ts
119 |
120 | tsc --init (to make ts.config)
121 |
122 | %%%%%%%%%% Git Commands %%%%%%%%%%%%
123 | %%%%%%%%%% Git Commands %%%%%%%%%%%%
124 | %%%%%%%%%% Git Commands %%%%%%%%%%%%
125 | %%%%%%%%%% Git Commands %%%%%%%%%%%%
126 |
--------------------------------------------------------------------------------