“I like to do all the talking myself. It saves time, and prevents arguments.”

— Oscar Wilde

Prologue

This is a collection of useful Linux commands that, you don’t need them often, but will go search for every time. So, just as a memo to save the time. 😏

This article will be updated from time to time as I use and explore Linux.


User Related

Change password

1
passwd

Create sudo-enabled user

See Create sudo-Enabled User on Linux.


Configuration

Install Java

1
apt install openjdk-17-jdk openjdk-17-jre

Switch Java version

1
sudo update-alternatives --config java

Utilities

Count all files under current directory

1
ls -1 | wc -l

Count all files with certain extension

1
find . -type f -name "*.ext" | wc -l

Count total line numbers of all files

1
find . -type f -name "*.ext" -print0 | xargs -0 wc -l

Epilogue

To be continued…