Quick tricks
Here i am sharing a few tricks
1. {} used to run commands in current shell
2. () use single quotes to execute commands in subshell
( cd /var/run/mysqld/ && rm -rf mysqld.pid ) && /etc/init.d/mysqld &
It will change dir to /var/lib/mysql if its successful it will remove mysql pid file
and now if exit status of that whole is 0 it will start mysql
3. {} use curly brackets to enclose a variable to avoid any errors.
4 ulimit -a list all the limit restrictions in current shell
We can always change these limits both hard and soft in /etc/security/limit.conf file
5. How to change a particular thing in multiple files in multiple directories
find /dirname -iname "file name" -exec sed 's/search/ /replace/g' {} \;
1. {} used to run commands in current shell
2. () use single quotes to execute commands in subshell
( cd /var/run/mysqld/ && rm -rf mysqld.pid ) && /etc/init.d/mysqld &
It will change dir to /var/lib/mysql if its successful it will remove mysql pid file
and now if exit status of that whole is 0 it will start mysql
3. {} use curly brackets to enclose a variable to avoid any errors.
4 ulimit -a list all the limit restrictions in current shell
We can always change these limits both hard and soft in /etc/security/limit.conf file
5. How to change a particular thing in multiple files in multiple directories
find /dirname -iname "file name" -exec sed 's/search/ /replace/g' {} \;
Comments
Post a Comment