Linux Command to check space disk and folder

To check Linux disk space use :

df -ha

To check Linux folder space use :

du -sh * 

will not traverse any mount points it encounters. But if it is told to start at a mount point then it will do as requested.

du -shx *

for also hidden folder

du -sh .[^.]*

for hidden and not hidden

du -hs $(ls -A)

with threshold

du -h –threshold=10M .

du -h –threshold=10M –max-depth=0 * du -h –threshold=10M –maxdepth=1 .

add | sort -n for sorting

Linux Centos 7 – Startup Services – Functions

systemctl disable httpd
Running systemctl disable removes the symlink to the service in /etc/systemd/system/*

systemctl status httpd

systemctl list-unit-files

systemctl start application.service

systemctl list-units –type=service
systemctl list-units –all –state=inactive

systemctl mask nginx.service
systemctl unmask nginx.service

systemctl edit nginx.service

To remove any additions you have made, either delete the unit’s .d configuration directory or the modified service file from /etc/systemd/system. For instance, to remove a snippet, we could type:

sudo rm -r /etc/systemd/system/nginx.service.d
To remove a full modified unit file, we would type:

sudo rm /etc/systemd/system/nginx.service
After deleting the file or directory, you should reload the systemd process so that it no longer attempts to reference these files and reverts back to using the system copies. You can do this by typing:

sudo systemctl daemon-reload

very usefull
https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units