mv /tmp/home/rcook/.[!.]* /home/rcook/
move dot files
----------------------------------------------------------------
zip -r foo.zip dir_path
exclude folder
zip -r myarchive.zip dir1 -x dir1/ignoreDir1/\* dir1/ignoreDir2/\*
----------------------------------------------------------------
grep -Ril "text-to-find-here" /path
find -name 'filename'
find . -name '*.js' -exec grep -i 'string to search for' {} \; -print
----------------------------------------------------------------
pwdx <process id>
This command will fetch the process path from where it is executing.
----------------------------------------------------------------
List number of files in current directory
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr
----------------------------------------------------------------
composer install --ignore-platform-reqs
----------------------------------------------------------------
Start:
sudo /etc/init.d/mysql start
Stop:
sudo /etc/init.d/mysql stop
Restart / reload configs:
sudo /etc/init.d/mysql restart
Check run status:
sudo /etc/init.d/mysql status
------
tar -czvf media/bk.tar.gz ./ --exclude="media/*" --exclude="var/*" --exclude="v/*" --exclude="errors/*"
This works exclude files and folder
tar --exclude=*.tar --exclude='var/*' --exclude='pub/US' --exclude='pub/static' -cvzf mojow-bkp-2019-06-12.tar ./
----------------------------------------------------------------
folder files count
ls | wc -l
----------------------------------------------------------------
SCP
scp root@1.1.1.1:/var/www/vhosts/dafs.com/httpdocs/vendor1.zip ./public_html
----------------------------------------------------------------