sh linux通用终端命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh linux通用终端命令相关的知识,希望对你有一定的参考价值。

zip -r foo.zip dir_path

----------------------------------------------------------------

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

----------------------------------------------------------------

以上是关于sh linux通用终端命令的主要内容,如果未能解决你的问题,请参考以下文章

ubuntu 下执行shell脚本的问题

Mac 终端之终极Zsh命令篇

Linux 进程后台运行

Shell 命令 之linux 模式下的编程语言

Fedora25查找文件——linux通用查找文件方法——find命令巧用

Mac OS 终端运行.sh脚本