Linux useful commands

linkaiyi
Follow

Linux Commandlines

Make package / unpack tar/tar.gz files/folder

pack folder to tar.gz
tar cfvz [ARCHIV].tar.gz [Folder]

pack several folders to tar.gz
tar cfvz [ARCHIV].tar.gz [VERZEICHNIS1] … [VERZEICHNISn]

pack several files to tar.gz
tar cfvz [ARCHIV].tar.gz [DATEI1] [DATEI2] … [DATEIn]

Options explanation:

  • -c create: generate new tar.gz file
  • -v verbose: show file details
  • -f filename: indicate the file with file name
  • -z zip: tar with gzip zip

Get groups of user and uid and gid

groups username # get group names of username
id username # get uid of username

List all users

getent passwd

List all groups of certain user

groups username

correct windows file in linux

error message: /bin/bash^M: bad interpreter: No such file or directory

sed -i -e 's/\r$//' filename.sh

change folder/file user, group and access right

setfacl -m u:handsome:r -R web/ # for the folder web/ only user handsome has read right. use g for group

check last reboot time

who -b

check linux version

cat /etc/os-release

check system hardware configuration

sudo apt-get install inxi
inxi -Fz 
Object has 0 attachments

Was this article helpful?

This article is viewed 64 times!

0 Comments

Leave a Comment

Support