Skip to content

Tags

On this page

Linux Common Commands

View current system info

lsb_release -a

Output:

Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster

View all users

cat /etc/passwd | grep -v nologin|grep -v halt|grep -v shutdown|awk -F":" '{ print $1"|"$3"|"$4 }'|more

Get Publish IP

hostname -I

Change user group

usermod -g groupname username

Get user group

id -g -n

Remove apt ppa

sudo add-apt-repository --remove ppa:qbittorrent-team/qbittorrent-stable

Get current shell

echo "$SHELL"

Get current cpu arch

arch

or

dpkg --print-architecture

Unzip tar.gz

tar -xf x.tar.gz

See also here

Tar to specific directory

tar -xf x.tar.gz -C ./xxx

Stdout to File

command &> file

Overwrite:

command >| file.txt 2>&1

Download/Upload file by SSH SCP

Download to local:

scp [email protected]:/path ~/Downloads

Remove node_modules

find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +

Remove target

find . -name 'target' -type d -prune -exec rm -rf '{}' +

LINKS TO THIS PAGE

Edit this page
Last updated on 10/4/2021