Linux/Unix:Generic: Difference between revisions

From wiki
Jump to navigation Jump to search
No edit summary
 
(16 intermediate revisions by the same user not shown)
Line 1: Line 1:
;df -P
[[Category:Linux/Unix]]
:Report file-system information in parseble format.


;df -h
;Force a reboot (e.g. when mount commands are hanging)
:Report file-system information in easy understandable precision (K, M or G when appropriate).
<syntaxhighlight lang=bash>
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
</syntaxhighlight>
 
;ulimit -Sv 12000000
:Set max memory to use to 12GB for this process (with option to increase (-S))
 
;cp -rL
:Copy recursively and dereference symbolic links (copy the file, not the link)


;top
;top
:List process resource usage. By default having the most CPU-intensive process on top. Press 1 to have usage for each CPU apart.
:List process resource usage. By default having the most CPU-intensive process on top. Press > to have it sort on another column. Press 1 to have usage for each CPU apart.


;lscpu
;lscpu
:List CPU information
:List CPU information
;free
:Show memory usage
;cat /etc/sysctl.conf|grep swappiness
:Check swappines (the eager the system will swap with). A higher number means more swapping will happen. 0 is not no swapping but minimal swapping.


;uname -a
;uname -a
:Show kernel version  
:Show kernel version  
;mountpoint -q <directory>
:Check if <directory> is in use as mountpoint
;chage -l <username>
:Show password aging status
;PS1="[\u@\h \W]\$ "
:Set shell prompt to '[username@hostname <curdir>]$ '
:\w for whole current path
=Debian=
;/var/run/reboot-required
:If this file exists a reboot is required


=RedHat (RHEL)=
=RedHat (RHEL)=
;/etc/redhat-release
;/etc/redhat-release
:Redhat version installed
:Redhat version installed
;for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done
:Find swapspace usage per process
;yum list
:Show all packages on the rpm-server
;yum install <packagename>
:Install a package from a rpm-repository
;rpm -qa
:List all installed packages. Add -i for details
;rpm -ivh <rpm-file>
:Install package in rpm-file
;rpm -Uvh <rpm-file>
:Update package in rpm-file
=Bash=
;<nowiki>:</nowiki>
:No operation (NOP)
==Raspberry pi autologon==
In /etc/lightdm/lightdm.conf comment this line out (by putting a # in front of it)
<code>lightdm.conf:autologin-user=pi</code>

Latest revision as of 09:19, 11 February 2025


Force a reboot (e.g. when mount commands are hanging)
echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger
ulimit -Sv 12000000
Set max memory to use to 12GB for this process (with option to increase (-S))
cp -rL
Copy recursively and dereference symbolic links (copy the file, not the link)
top
List process resource usage. By default having the most CPU-intensive process on top. Press > to have it sort on another column. Press 1 to have usage for each CPU apart.
lscpu
List CPU information
free
Show memory usage
cat /etc/sysctl.conf|grep swappiness
Check swappines (the eager the system will swap with). A higher number means more swapping will happen. 0 is not no swapping but minimal swapping.
uname -a
Show kernel version
mountpoint -q <directory>
Check if <directory> is in use as mountpoint
chage -l <username>
Show password aging status
PS1="[\u@\h \W]\$ "
Set shell prompt to '[username@hostname <curdir>]$ '
\w for whole current path

Debian

/var/run/reboot-required
If this file exists a reboot is required

RedHat (RHEL)

/etc/redhat-release
Redhat version installed
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done
Find swapspace usage per process
yum list
Show all packages on the rpm-server
yum install <packagename>
Install a package from a rpm-repository
rpm -qa
List all installed packages. Add -i for details
rpm -ivh <rpm-file>
Install package in rpm-file
rpm -Uvh <rpm-file>
Update package in rpm-file

Bash

:
No operation (NOP)

Raspberry pi autologon

In /etc/lightdm/lightdm.conf comment this line out (by putting a # in front of it)

lightdm.conf:autologin-user=pi