KavehSadeghiGarmaroudi
3/9/2019 - 12:36 PM

linux important and usfull command

extract tar.gz
tar xvzf file.tar.gz
-------------------------------------------------
memory usage
 watch -n 5 free -h
---------------------------------------------------------------------
sudo find core  -type d -exec chmod 755 {} +
sudo find core  -type f -exec chmod 644 {} +
sudo chmod 777 -R /home/sammy/ftp/core/storage
sudo chmod 777 -R /home/sammy/ftp/core/bootstrap


------------------------------------------------------------------------
ncdu important
du -sch /* | sort -rh
Free Space
df -Ph . | tail -1 | awk '{print $4}'
du -h
df -h
-----------------------------------------------------------------------
folder size on sda1
du -sch .[!.]* * |sort -h
file bigger than 
 sudo find / -xdev -type f -size +102400000c

-------------------------------------------------------------------------
copy allfiles with hiden files hi
cp -r /home/ftp_users/core_fazagasht/. core/
-------------------------------------------------------------------------
crontab log
sudo grep --color -i cron /var/log/syslog
-----------------------------------------------------------------------
scp
scp -p -P 5560  kinamo_mysqlbackup.sh root@130.185.73.87:/usr/local/sbin/kinamo_mysqlbackup.sh

download file with ssh

scp -P 5560 -p  administrator@185.13.231.189:/home/backup/20160406/bimeh_kia.dmp.gz /home/kaveh/Desktop
------------------------------------------------------------------------
vsftp  553
sudo chown -R sammy:nogroup /home/sammy/ftp
sudo chown -R ftp_users:nogroup /home/ftp_users/ftp
sudo chown -R ftp_users:nogroup /home/ftp_users/

sudo chown -R sammy:nogroup /home/sammy/ftp
sudo chmod a-w /home/ftp_users
sudo chmod a-w /home/sammy
--------------------------------------------------------------------------
ssh admin@88.99.113.135  -o PubkeyAuthentication=no -p 5560
sshpass -p hamed@123kaveh ssh  administrator@185.13.231.188 -p 5560
------------rsync-------------------
nice -n -20 rsync -zarvh --progress -e 'ssh -p 5555'  root@130.185.76.190:/home/backup /volume1/Public/backup/cloud