Info
Place to archive and snapshot the incredible command or pipe command with Linux OS platform such as Debian, Ubuntu, CentOS, β¦
In-house Commands
echo
command
Decode string with specify unicode-escaped with -e
flag, read more at: StackOverFlow - How to convert \uXXXX unicode to UTF-8 using console tools in *nix
Note
You can use
uni2ascii
for instead if you want to integrate with 3rd party
journalctl
command
Documentation: How To Use Journalctl to View and Manipulate Systemd Logs
Capture and logged full events of service
To see only log messages for the current boot
Find your boots in list
See the error log with command
Info
You can exchange -p option with pram
- 0: emerg
- 1: alert
- 2: crit
- 3: err
- 4: warning
- 5: notice
- 6: info
- 7: debug
grep
command
Use grep with exclude by -v
flag
To grep include multiple word
Info
Use
-i
flag to execute that. Especially add with\|
symbol between two words. Read more at: How to Grep for Multiple Strings, Patterns or Words, extending with multiple situations (HELPFUL)
awk
command
Skip first line Usually header when you use awk
to print column variables
Get the last param when seperate by /
or any symbol, you can use F
and $NF
to get the result
tree
command
Print the sub-directory of folder with configuration level
Print the sub file and folder with filter not include smt with -I
option. Explore at StackOverFlow - tree command for multiple includes and excludes
Print tree with combine full path, include and exclude pattern
find
command
Find the folder with find base on the regex format
Find directory in current location but expose that in format ls
Find the file or directory to provide you last in path of file and directory
iptables
command
Learn more about iptables
commands from links down below
- Github - iptables cheatsheet
- Prompt generate Iptables
- Hacktricks - Suricata & Iptables cheatsheet
- How to list all iptables rules with line numbers on Linux
- How can I remove specific rules from iptables?
Allow only traffic from external IP to host via port
Block all traffic to specify port in host
List all rule and table rule
Delete rule in iptables
tr
command
Use tr
to delete with -d
flag
Use tr
to change space to colon,
β :
ssh
command
Use tunneling mode of ssh
to reverse shell from remote to your local host
Info
Command below to port-forward from port
127.0.0.1:8080
from remote host and send the traffic to port:8080
inside your host
jq
command
List of articles relate jq
with helpful solution
You can use jq
to select multiple variable
You can use jq
to select multiple variable and concat that to one string
You can use jq
with variable to pass through from command or define to your jq
jq
support for another arg like json
, you can try to concat object this one with your existence object. Explore more at Add an object to existing JSON using jq and Append JSON Objects using jq
Convert json to string for multiple purpose
Get first keys in list object with jq
Select the keys if value of a field is βautoβ. Explore at Select the keys if value of a field is βautoβ
du
command
You can use du
command for list all size inside your directory
lsblk
command
If you want to take the look with your storage device like HDD or SSD, you can use lsblk
to see what format of those devices
File System | Supported File Size | Compatibility | Ideal Usage |
FAT32 | up to 4 GB | Windows, Mac, Linux | For maximum compatibility |
NTFS | 16 EiB β 1 KB | Windows, Mac (read-only), most Linux distributions | For internal drives and Windows system file |
Ext4 | 16 GiB β 16 TiB | Windows, Mac, Linux (requires extra drivers to access) | For files larger than 4 GB |
mkfs
command
You can use mkfs
command to formatting your device. Read more at How to Use the mkfs Command on Linux
fdisk
command
Documentation: What is FDISK and how does it work?
Use fdisk
when you want to hangout with your hard dkkkkkkkkkkkkkisk drive, like integrate multiple way for formatting or partitioning aΒ hard disk drive, or to delete different portions of it. FDISK is an external utility. It is most commonly used to prepare andΒ partitionΒ a hard drive
And when you want to hit to interaction mode you can try with
And when you hit keyboard with m
, you can see the helper
scp
command
Documentation: SCP Command in Linux {13 Examples}
scp
is protocol which permit use copy and transfer file from remote and local machine with bi-direction, or cp from remote to remote
In some special case, you can integrate with option with your scp command to specific
Different Port: Usually scp
use SSH (Port 22) to mediate help you secure transfer data through that port, but in other situation SSH not work in Port 22, you can use -p
to specific
Recursive: To copy whole folder, usually we use recursive mode and scp
does have with -r
sed
command
Documentation: Sed cheatsheet and How to Use Sed to Find and Replace a String in a File
To replace a string in file with sed
, you can use command with format
To replace in the string, you can control action with
External Commands
Caddy server
Use the documentation to get valid command to handling Caddy Server
To reload configuration use reload
command. Doc: caddy reload
To check and validate configuration from caddyfile
use validate
command. Doc: caddy validate
Note
With
Caddy V2
, mostlywebsocket
automatically serve and do not need to configuration likev1
. Check about that in Caddy Proxy
Vagrant
If you have problems when vagrant
canβt authentication for ssh
. You will need concern to add this setting. Read more at: Vagrant ssh authentication failure
Pip3 of Python
With Python3 from version 3.12, there isnβt gonna easy for us to install package, so if you want to force install with python3-pip
, you can add the optional --break-system-packages
after the pip command
With read from file, we can do same way
Keytool of Java
Explore more about keytool
through Common Java Keytool Commands
Get keystroke information
To view and check information which store inside keystroke, which generate from keytool
- key generator integrate into Java