image

Bash

2 July 2025


User, group

/etc/passwd (World-readable): Contains information for all users (username, UID, GID, home directory, shell).

/etc/shadow (Root-only): Stores secure encrypted password hashes and password aging information (expiration, warnings).

/etc/sudoers (Root-only): Defines which users or groups can execute commands as root or other users.

Add user to group

sudo groupadd group
sudo usermod -aG group user
  • a: Append, use only with -G
  • G: Groups which user is also a member of

Change folder owner

Window

Check wake up devide

powercfg -devicequery wake_armed

Format partion in cmd

format v: /fs:fat32

Rebuild UEFI partiton

bcdboot c:\Windows /s <boot letter>: /f UEFI\

ETC

Install custom fonts

place fonts at ~/.local/share/fonts

Install custom app

Extract and move app folde to /opt

sudo tar -xvf postman-linux-x64.tar.gz -C /opt/
  • x: Extract
  • v: Verbose mode
  • f: Specific file name
  • C: To specific folder

Create app.desktop at /usr/share/applications

[Desktop Entry]
Name=Firefox Developer Edition
Comment=Web Browser
Exec=/opt/firefox/firefox %u   
Icon=/opt/firefox/browser/chrome/icons/default/default128.png
Terminal=false
Type=Application

Create Symbolic Link: Create a link to run postman from the terminal:

sudo ln -s /opt/app /usr/local/bin/app

Install nodejs

  • Extract nodejs binary package

  • Add to ~/.bash_profile

export PATH=$PATH:/opt/node-v22/bin

Other way to run npm

sudo env PATH="$PATH:/opt/node-v22.18.0/bin" npm

Bash alias

make alias permanent change file "~/.bash_profile"

Kill running process at specific port

fuser -k 8080/tcp

List processes associated with network ports

ss -tlnp
  • t: TCP sockets
  • l: Listening sockets
  • n: Numeric addresses
  • p: Show the process name and PID

List installed packed

dpkg -l | grep -i my-package
sudo apt remove my-app

Find files

find ./HD-MP3 -name use*.ts

Check disk free

df -h

Mount disk to folder

sudo mount /dev/sda6 /data

Git

git config --global --edit
git remove show origin

Curl

curl -X POST -H "Content-Type: application/json" -d '{"username": "admin", "password": "123123"}' http://localhost:4000/api/auth/login

Add ppa repository

sudo add-apt-repository ppa:repository-name

sadfasdf sadfasdf

asdfasdf

Make withby Nguyen Huu Dat

© 2025