Skip to content

Tag: grep

Renaming sub-directories recursively to a new pattern in bash

I want to rename sub-directories to my new pattern but some results may be dangerous in my own script: For example if I use /tmp/etc as input argument I would have the nasty results in the first iteration: So in next iteration there will not be /tmp/etc to work at. The second problem in my script is when I us…

Filter out number from a specific line in log file

I have got a log file with specific String Need to get the specific number which is at the end of line. We can use awk or grep , not able to get this using below command. Since the log file has timestamp at the beginning. Answer Awk lets you easily grab the last element on a line. The variable

A confusion about the alias area of bashrc file

I want write my own alias called oepnserver. The functions of the oepnserver are: show my ip address use python module to start a server on current folder. The detailed code is listed below: When I type oepnserver, my terminal only shows: However, my expectation was I also try to use the ifconfig wlan0 |grep …

Linux Internal Process for Cat and Grep [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I’m newbie to linux back round process, for example i have the below linux command, Ma…

How do i extract some particular words from each line?

The text file has many lines of these sort , i want to extract the words after /videos till .mp4 and the very last number ( shown in bold ) and output each filtered line in a separate file Lets say for example the text file content is .. The output should be Answer You may try the below regex: