I have a file in /home/{user}/client.log
.
clinet.log
contains a work lcid
.
How can I find a word lcid
in a file client.log
and print it using bash.
use the following command: grep "lcid" . -R
grep "lcid" . -R
Okay, with the additional information you provided this will do the trick for you:
sed -n "s/.*lcid.:.\(\w*\)./\1/p" client.log
Let me know if this helps.
Thanks all. I got this working by using the following command
grep 'lcid' client.log | cut -d'"' -f4
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.