Site Tools


linux:general:basics

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
linux:general:basics [2019/04/17 11:04] lunetikklinux:general:basics [2022/08/31 10:14] – [Linux Commands] lunetikk
Line 57: Line 57:
 |  tar cfvz <archive>.tgz <dir/file>  |  compress files to tgz  | |  tar cfvz <archive>.tgz <dir/file>  |  compress files to tgz  |
 |  tar -xzfv <archive>  |  decompress tgz to current dir  | |  tar -xzfv <archive>  |  decompress tgz to current dir  |
 +|  tar -xvjf <archive>.tar.bz2 <archive>  |  decompress bz2 to current dir  |
 +|  tar -tvf <archive>.tar  |  list files in tar  |
 +|  tar -xvf <archive>.tar home/foo/bar  |  extract /home/foo/bar from the tar (NO LEADING SLASH /)  |
 |  last -w  |  displays the full name instead of only 8 chars  | |  last -w  |  displays the full name instead of only 8 chars  |
 |  lsscsi -v  |  lists the scsi device id and its partition  | |  lsscsi -v  |  lists the scsi device id and its partition  |
Line 63: Line 66:
 |  find /tmp -type f -atime +30 -delete  |  delete files in /tmp with no access in the last 30 days  | |  find /tmp -type f -atime +30 -delete  |  delete files in /tmp with no access in the last 30 days  |
 |  dpkg --print-architecture  |  show cpu architecture (amd64/i386/...) (debian/ubuntu only)  | |  dpkg --print-architecture  |  show cpu architecture (amd64/i386/...) (debian/ubuntu only)  |
-|  nmap -sL <IP like 192.168.178.*>  |  List all hosts in the given IP-range  |+|  nmap -sL <IP like 192.168.178.*>  |  list targets to scan in the given IP-range 
 +|  nmap -sn <IP like 192.168.178.*>  |  ping scan in the given IP-range  |
 |  yes %%|%% yum install <package>  |  submit yes - also works for other commands  | |  yes %%|%% yum install <package>  |  submit yes - also works for other commands  |
 +|  du -hs * %%|%% sort -h %%|%% head    show files by size and sort by size  | 
 +|  rm !(*.log)    remove all files except for *.log  | 
 +|  ps -f -p <PID> -o lstart=  |  show starttime of process 
 +|  install -d -o <user> -g <group> -m <mode> <path>  |  mkdir with specific user, group and rights  |
  
 ==== Save textfile with password (VIM) ==== ==== Save textfile with password (VIM) ====
Line 104: Line 111:
 ===== SLES Commands ===== ===== SLES Commands =====
  
-[[https://en.opensuse.org/images/3/30/Zypper-cheat-sheet-2.pdf|Zypper Cheat Sheet]]+[[https://en.opensuse.org/images/1/17/Zypper-cheat-sheet-1.pdf|Zypper Cheat Sheet 1]]\\ 
 +[[https://en.opensuse.org/images/3/30/Zypper-cheat-sheet-2.pdf|Zypper Cheat Sheet 2]]
  
-===== SLES Commands =====+^  Command  ^  Function  ^  
 +|  zypper ref  |  Refresh repositorys  |\\ 
 +|  zypper up  |  Update packages  |\\ 
 +|  zypper in %%<%%PACKAGE%%>%%  |  Install PACKAGE  |\\ 
 +|  zypper info %%<%%PACKAGE%%>%%  |  Shows the repository with PACKAGE  |\\ 
 +|  zypper lr  |  List repositorys  |\\ 
 +|  zypper ar %%<%%REPOURL%%>%%  |  Add repository via REPOURL  |\\ 
 +|  zypper mr -e %%<%%REPO%%>%%  |  Activate existing REPO  |\\ 
 +|  zypper se -s %%<%%PACKAGE%%>%%  |  Show all available packages incl. versions  |\\
  
-[[https://en.opensuse.org/images/3/30/Zypper-cheat-sheet-2.pdf|Zypper Cheat Sheet]]+===== Redhat Commands ===== 
 + 
 +[[https://access.redhat.com/articles/yum-cheat-sheet|Yum Cheat Sheet]] 
 + 
 +^  Command  ^  Function  ^  
 +|  yum list all  |  Show all available and installed packages  |\\ 
 +|  yum search %%<%%PACKAGE%%>%%  |  Find info about [Package]  |\\ 
 +|  yum repolist  |  Show enabled repositorys  |\\ 
 +|  yum clean all  |  Clean all packages and meta data from cache  |\\ 
 +|  yum update  |  Update all installed packages  |\\ 
 +|  yum update %%<%%PACKAGE%%>%%  |  Update PACKAGE  |\\ 
 +|  yum reinstall %%<%%PACKAGE%%>%%  |  Reinstall PACKAGE  |\\ 
 +|  yum remove %%<%%PACKAGE%%>%%  |  Remove PACKAGE  |\\ 
 +|  yum downgrade %%<%%PACKAGE%%>%%  |  Downgrade package to earlier version  |\\ 
 +|  yum --disablerepo="*" --enablerepo="my-repo" update  |  Only update software of repository "my-repo"  |\\
  
 ===== Ubuntu/Debian Commands ===== ===== Ubuntu/Debian Commands =====
Line 127: Line 157:
 |  apt-mark hold [Package]  |  hold back [Package]  |\\ |  apt-mark hold [Package]  |  hold back [Package]  |\\
 |  apt-mark unhold [Package]  |  remove hold back from [Package]  |\\ |  apt-mark unhold [Package]  |  remove hold back from [Package]  |\\
 +|  apt-mark showhold  |  show held back packages  |\\
 |  dkpg --install [Package.deb]  |  installs offline packages  |\\ |  dkpg --install [Package.deb]  |  installs offline packages  |\\
 |  aptitude install [Package]  |  installs [Package] alt. apt-get  |\\ |  aptitude install [Package]  |  installs [Package] alt. apt-get  |\\
linux/general/basics.txt · Last modified: 2022/12/16 10:41 by lunetikk