Skip to content

Instantly share code, notes, and snippets.

@vmaldosan
Last active January 29, 2024 22:09
Show Gist options
  • Save vmaldosan/96513270ff45a68a7b39be261a0cf993 to your computer and use it in GitHub Desktop.
Save vmaldosan/96513270ff45a68a7b39be261a0cf993 to your computer and use it in GitHub Desktop.
Useful commands for Linux and Windows (XP and above).
# Install maven wrapper
mvn -N io.takari:maven:wrapper
# Locate an installed package in the system
dpkg -l | grep <pkg_name>
# Ubuntu: move launcher to the bottom
gsettings set com.canonical.Unity.Launcher launcher-position Bottom
# Process using a certain port
lsof -i :<port>
# Processes sorted by % memory consumption, descending
ps -eo pid,cmd,%mem --sort -%mem
# Count Java lines of code (excluding empty lines)
find . -name "*.java" -exec grep "[a-zA-Z0-9{}]" {} \; | wc -l
# Find folder
find <path-where-searching> -name <folder-name> -type d
# Search text in files
grep -rn 'path' -e 'text'
# Show tasks
tasklist /v /fi "username eq vmaldosan" /fi "status eq Not Responding"
# Kill all not responding tasks in Windows (XP and above)
taskkill -f -fi "STATUS eq NOT RESPONDING"
# Find process using certain port
netstat -ano | findstr <port>
# Find PID by process name and command line
wmic process where "caption = '<process_name>' and commandline like '%<string_to_search>%'" get processid
# Kill task by PID
taskkill /pid <pid> /f
# Start ssh agent (in Bash)
eval `ssh-agent -s`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment