Skip to content

Tag: command-line

grep to read exact data from text file

I have file test1.txt file, i am trying to read variable which is enclosed in double quotes and starting with hyphen for eg: “-color”. i trying to use this grep command cat test1.txt | grep getParm | sed ‘s/getParm(/ /;s/&/ /;s/,/ /;s/”/ /g’ | awk ‘{print $3}’ , w…

How to follow latest log file with tail -f?

I have a dir that saves a fresh log file for each run, so I use the following command to follow the latest log file: So my question would be if there is any way to jump from one file to the next, if there is a newer log file available without having to stop the latest tail -f and

moving and renaming a folder in linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …

Printing full path of directories

I am trying to get full paths of folder and print them into a into a file. I have been using this command to get paths. But they are not proper. Ex. When trying to print path of Documents/Folder/Folder2 comes as Documents/folder2 instead of proper path. I have tried going over directory using for loop and pri…