/CommandX

Useful commands for every CLI tool

Apache License 2.0Apache-2.0

CommandX

Useful commands for every CLI tool


JsonPath

1. Filter with string value

$.Data[?(@.Date=='2021-08-21T00:00:00')].FoodMeal[?(@.Title=='افطار')]

Android

1. Check signature of APK file

keytool -printcert -jarfile app.apk

2. Check signature of AAB file

keytool -printcert -jarfile app.aab

3. Check signature of Keystore file

keytool -list -v -keystore release.jks

4. Check manifest of APK file

make sure to add build-tools directory to PATH first

aapt dump badging myapp.apk

Cmd

1. List mapped networks

net use

2. Remove all mapped networks

net use * /d

3. Flush dns

ipconfig /flushdns

Flutter

1. Run doctor

flutter doctor

2. Clean build

flutter clean

3. Get dependencies

flutter pub get

4. Run build_runner to generate codes

flutter pub run build_runner build

5. Deploy app to device

flutter run

6. Watch for changes and regenerate

flutter pub run build_runner watch

7. Run build_runner deleting conflicting outputs

flutter pub run build_runner build --delete-conflicting-outputs

8. Add flutter to path from a directory

export PATH="$HOME/Desktop/flutter/bin:$PATH"

9. Add flutter to path from root

export PATH="$PATH:`pwd`/flutter/bin"

10. Analyze release apk size for specific platform

flutter build apk --analyze-size --target-platform android-arm

11. Obfuscating release apk

flutter build apk --obfuscate --split-debug-info=C:/users/Mahdi/Desktop/symbol

12. Update pod dependencies

cd ios
pod install --repo-update

13. Identify out-of-date package dependencies

flutter pub outdated

14. Update packages to the latest version with breadking changes

flutter pub upgrade --major-versions

15. Build flavor apk

flutter build apk --flavor website --obfuscate --split-debug-info=C:\Users\Mahdi\Desktop\zireh-symbols

Git

1. Untrack committed file

git rm {FileName} --cache

2. Reorder commits

git rebase -i HEAD~3

3. Revert changes made to your working copy

git checkout .

4. Revert changes made to the index (i.e., that you have added), do this.

Warning this will reset all of your unpushed commits to master!

git reset

5. Revert a change that you have committed

git revert <commit 1> <commit 2>

6. Remove untracked files (e.g., new files, generated files)

git clean -f

7. Remove untracked directories (e.g., new or automatically generated directories)

git clean -fd

8. Prune remote

git remote prune origin

9. Get rid of LF or CRLF empty changes

git add --renormalize .

Laravel

1. Rollback last migration

php artisan migrate:rollback --step=1

2. Apply changes to .env

php artisan config:cache

php artisan config:clear

3. Deploy checklist

php artisan down

git pull

composer i

npm i

npm run prod

php artisan migrate

php artisan permission:sync

php artisan config:cache

php artisan view:cache

php artisan route:cache

php artisan up

4. Install composer dependencies ignoring php version difference

composer install --ignore-platform-reqs

5. Link storage to public

php artisan storage:link

Ubuntu

1. Zip a direcory

tar -zcvf archive.tar.gz directory/

2. Open root directory

cd /home/lighttpd/http

3. Move file to directory

mv [file] [directory]

4. Delete file

rm [file]

5. Open dns record file

nano /etc/bind/db.{domain}.com

6. Show hidden files

ls -ad .*

7. Download file

wget http://link.to.file

8. Extract tar.gz

tar xvzf file.tar.gz

9. Copy file to direcory

cp -a file direcory

Windows Run

1. Open network adapters

ncpa.cpl

Intellij

1. Show diagram

CTRL + ALT + SHIFT + U 

2. Reformat code

Ctrl + Alt + L

3. Refactor or rename target

Shift + F6

4. Jump to next/previous context

Ctrl + Shift + LeftArrow
Ctrl + Shift + RightArrow

5. Open preferences screen

Ctrl + Alt + S

6. Recent locations preview

Ctrl + Shift + E

7. Go to declaration (without left click + Ctrl)

Ctrl + B

8. Show definition with body

Ctrl + Shift + i

9. Search Everywhere

Quickly find any file, action, symbol, tool window, or setting in IntelliJ IDEA, in your project, and in the current Git repository.

Double Shift

10. Add/remove line or block comment

Ctrl + /

11. Comment out a line or block of code.

Ctrl + Shift + /

12. View recent files

Ctrl + E

13. Complete Current Statement

Complete Current Statement Insert any necessary trailing symbols and put the caret where you can start typing the next statement.

Ctrl + Shift + Enter

MacOs

1. Take screenshot

Command + Shift + 4

2. Open spotlight

Command + Space

3. Show/hide hidden files and folders

Command + Shift + .

Xcode

1. Show/Hide active pane

Command + Shift + Y