Task | Shortcut | Note |
---|---|---|
Open Terminal | WINDOWS + T | Check for windows / Linux OS logo on keyboard. |
Open new Terminal tab | CTRL + SHIFT + T | Open new tab in terminal. |
Close active tab | CTRL + SHIFT + W | Close the active tab in terminal. |
Goto previous tab | CTRL + PAGEUP | Activates the previous tab. |
Goto next tab | CTRL + PAGEDOWN | Activates the next tab. |
Copy selected text | CTRL + SHIFT + C | Copy selected content to clipboard. |
Paste from clipboard | CTRL + SHIFT + V | Paste the copied content |
Open file | open ./file_name & | Opens the file with default associated app |
Open file browser | nautilus . & | Opens the wrking directory in file browser |
Size of file/directory | du -hs /path/to/dir | Shows size of file or directory |
Disk usages | df -h | Shows disk usages by system. |
Create shortcuts | ln -s /path/to/source /path/to/target | Works for directories as well. |
Overwrite shortcuts | ln -sf /path/to/source /path/to/target | Works for directories as well. |
Open app in background | gedit /path/to/file.txt & | Open the file with gedit app in background process. |
Open app in background | nohup gedit /path/to/file.txt & | Open the file in gedit app in background and logs app activity in nohup.out file. |
Verify file integrity | cksum /path/to/file | Shows CRC checksum of file. |
Verify file integrity | md5sum /path/to/file | Shows MD5 checksum of file. |
Verify file integrity | sha256sum /path/to/file | Shows SHA-256 checksum of file. |
Check installation date | 1. df -h / 2. sudo tune2fs -l ${Filesystem} | ${Filesystem} is 1st cmd output. |
Check open port | ||
Check running process | ||
Kill running process | ||
Update Specific app | ||
Inspect system boot |
Task | Shortcut | Note |
---|---|---|
Search for files | find ./path/to/file -type f -name 'file-name' | List all file with provided name. |
Search for directory | find ./path/to/file -type d -name 'file-name' | List all directory with provided name. |
Search files with multiple names/patterns | find /path/to/search -type f ( -name "pattern1" -o -name "pattern2" -o -name "pattern3" ) -print | List files matching any of the names. |
Search files with multiple names/patterns case insensitive. | find /path/to/search -type f ( -iname "pattern1" -o -iname "pattern2" -o -iname "pattern3" ) -print | List files matching any of the names case insensitive. |
Search files on multiple paths | find /path/to/location1 /path/to/location2 /path/to/location3 ... -type f ( -iname "pattern1" -o -iname "pattern2" ) -print | Only search in given paths for files. |
Search for text/patterns in all files | find ./path/to/file -type f -name 'file-name' -exec grep --color -Hi 'text-to-search' {} \; | Check for provided texts/patterns in all matching files. |
Search for multiple text/patterns in all files | find /path/to/search -type f -name 'file-name' -exec grep --color -Hi -e "pattern1" -e "pattern2" -e "pattern3" {} \; | Check for provided all texts/patterns in all matching files. |
Task | Shortcut | Note |
---|---|---|
Search for text in all files | grep --color "text pattern" . | Searches all files in current directory for text pattern. |
Search in all .txt files | grep --color 'text-to-search' *.txt | List all matches in all matching files. |
Ignore case while searching | grep --color -i 'text-to-search' *.txt | Show all matches in upper and lower cases. |
Show file names if match found. | grep --color -H 'text-to-search' *.txt | Show all matches with file names. |
Search all files recursively | grep --color "text pattern" . -r | Searches all files and subdirectories in current directory for text pattern. |
Task | Shortcut | Note |
---|---|---|
Refresh as maven project | mvn eclipse:clean eclipse:eclipse | Refresh project and fix resource required for maven prorject. |
Build compile | mvn clean compile | Only compiles the code |
Build resource | mvn clean install | Compile and generate resource. |
Skip jUnit | mvn clean install -DskipTest=true | Skip jUnit tests cases. |