Tags » Bash

Why does '/./,/^$/!d' have any effect in sed?

I came upon an example of sed simulating cat -s, which will replace two or more empty lines by one empty line.

The command is below… 259 more words

Linux

Able to override the root permission of a readonly file with a non-sudo user

I was performing some experiments in Docker and found a strange behaviour.

I was able to override the ownership of a file created with the root… 196 more words

Linux

Find specify string within 2 string in bash

Hello,

I have file like this :

today#123 
2934
9236
monday 

today#12341
4246
58234
monday

today#456
7768
32347
monday

But in my file is around 200k+ lines, but it’s made from section starting with “today” and end with “Monday” 351 more words

Linux

Bash script - change value in only one column

I have 1 file, for example

12341234 3,0
12341342 4,0

How can I print:

abcdabcd 3,0
abcdacdb 4,0

cat $1 | tr 1234 abcd

changes both column 1 and 2. 83 more words

Linux

Running Linux GUI Apps on Windows 10

This information is current for Windows 10 Fall Creators Update (FCU), which was released in October 2017. It may change for future updates. If/when it does, I will attempt to post updates. 900 more words

Linux

How to use the ip command to bring up/down the network interface on Linux

The ip command is replacing ifconfig, which is getting deprecated and some distros have already removed it.

To bring a network interface down, simply run the following: 35 more words

Ubuntu

Filter output with grep

In the previous post I described how I search and read manuals in the shell. In my example the output of the command “apropos network” was a long list with manuals. 589 more words

Bash