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