How to Add “Open in Terminal” in Ubuntu File Manager Context (Right-click) Menu
Guide to Add “Open in Terminal” in Ubuntu/Nautilus Context Menu
-
-
- Open Terminal or press Ctrl+Alt+T to quickly access it.
- Type/paste the following code into Terminal and hit Enter.
sudo apt-get install nautilus-open-terminal
- Enter you password when it asks and hit Enter again.The installation should be finished shortly. Don’t close Terminal.
- We need to Restart Nautilus to make the option appear in context menu. To restart it, type the following command and hit Enter.
nautilus -q && nautilus &
- Once it brings you to the new prompt line, you are done! Close Terminal now.
- To test if it’s working, open the File Manager
nautilus directory_path
and head to the directory you directly open in Terminal. Then right-click on the folder or directory’s free space and choose “Open in Terminal”.
- git log which will print color full and meaning full logs to limit it use -n 8 at the end.
git log –graph –pretty=format:’%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset’ –abbrev-commit - Following are the use full alias in every work.
alias lf=’ls -F’
alias ll=’ls -la’
alias l=’ls -l’
alias edit=’open -e’ #on mac only
#alias gl=’git log –oneline’
alias glp=’git log –pretty=format:”%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset”‘
alias gl=’git log –pretty=format:”%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset” -n 8 –abbrev-commit’
alias gs=’git status’
alias gb=’git branch’
alias gpf=’git push –force origin’
alias gp=’git pull’alias alog=’adb logcat > $HOME/log.txt’
-
git commit –amend -m ” your comment for commit”
# Alternatively, if there’s work to keep:
git stash
# Alternatively, if there’s work no longer needed to keep:
git reset –hard 0d1d7fc32
bring the stash back
git stash pop
# This saves the modifications, then reapplies that patch after resetting.
# You could get merge conflicts if you’ve modified things which were
# changed since the commit you reset to.
git reset –soft c14809fa
reset the development to last two commit and keep the changes made in stage
git reset –soft HEAD~2
Unstage the change or like undo the work
git reset — <filePath>
squash mean club all the commit in 1 commits
git rebase -i HEAD~5
new branch in local from other branch
git push origin HEAD:bugfix/newbranchName
git push –force origin
create new brach at remote from local
git push origin HEAD
delete local branch
git branch -d branch_name
git branch -D branch_name
add a remote
git remote add origin https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
to rename and to set upstring just edit the config file in .git of project do fetch
git branch -m NewBranchName
- Rename the local branch by typing: git branch -m <new_name> …
- Push the <new_name> local branch and reset the upstream branch: git push origin -u <new_name>
- Delete the <old_name> remote branch: git push origin –delete <old_name>
ssh-keygen -R ipAddres|hostname
ssh-keygen -R 192.168.1.4
scp -CrP 22 /file/to/send username@remote:/where/to/put
scp -CrP 22 username@remote:/file/to/send /where/to/put
scp -CrP 22 username@remote_1:/file/to/send username@remote_2:/where/to/put
rsync -avzh –stats –progress remoteuser@remoteip:/path/ localpath
rsync -e “ssh -P $port_value” remoteuser@remoteip:/path/ localpath
Using the revert command doesn’t delete any commits. Quite the contrary: it creates a new revision that reverts the effects of a specified commit:
https://www.git-tower.com/learn/git/faq/undo-revert-old-commit
git revert 0ad5a7a6
Cleaning Ignored Files
git rm -r –cached .
git add .
git commit -m “Clean up ignored files”
Ignoring a previously committed file
echo debug.log >> .gitignore
git rm –cached debug.log
git commit -m “Start ignoring debug.log”
//on windows to find the port is used for
netstat -ano | findstr Port Number
//on linux or mac to find the port is used for
lsof -i:port_number
kill -9 pid_4m_aboveOutPut
// add extension or common string to end of all files in same dir
find . -type f -exec mv ‘{}’ ‘{}’.html \;
find . -name “*\.java” | xargs sed -ri ‘:a; s%Log\.[ivdwe].*\);%;%; ta; /Log\.[ivdwe]/ !b; N; ba’
find . -name “*\.java” | xargs grep -l ‘Log\.’ | xargs sed -i ‘s/Log\./;\/\/ Log\./g’
Uncomment logs:
find . -name “*\.java” | xargs grep -l ‘Log\.’ | xargs sed -i ‘s/;\/\/ Log\./Log\./g’
//gradle command
./gradlew android:assembleDebug –profile
./gradlew android:assembleDebug –dry-run –profile
./gradlew android:assembleDebug –dry-run –profile –configure-on-demand
./gradlew android:assembleDebug –dry-run –profile –configure-on-demand –daemon
./gradlew build –dry-run
gradlew –profile –recompile-scripts –offline –rerun-tasks assembleFlavorDebug
//Adb command
use -t if Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] see below
adb install -t app/build/outputs/apk/debug/app-debug.apk
adb shell am start -n “com.miui.notes/.ui.NotesListActivity” -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
adb shell am broadcast -a com.workingdev.DOSOMETHING
adb shell “am broadcast -a IGNORE –es pid ‘418875‘ –es name ‘naval‘ –es bookingId ‘MB1000Z1‘ –es Type ‘OFF‘ –es state ‘R10Z12Z‘ –es Condition ‘1D0B01D‘ -n com.yourpackage.name/com.yourpackage.name.push.ClassNameOfBroadCastReceiver“
aapt d badging Apk-path\apk-name.apk |grep launchable-activity
adb shell dumpsys package com.yourpackagename | grep -i “version”
adb shell pm list package | grep -i “string_in_pacakge_name”
adb shell pm path com.your.package.name
aapt dump badging inSystemApkPath.apk
aapt dump badging /path/to/apk | grep -c application-debuggable
adb shell cmd package list packages
adb shell dumpsys package my.package | grep versionName
adb shell dumpsys package my.package | grep versionCode
bundletool build-apks –bundle=<path to .aab> –output=<out.apks>
java -jar bundletool-all-0.10.2.jar build-apks –bundle=$foundat –output=out.apks –overwrite –mode=universal –ks=$debugKeyStore –ks-pass=”$pass” –ks-key-alias=”$ksKeyAlias” –key-pass=”$keyPass”