Search Results

Search: Posts Made By: Aejaz
2,633
Posted By Aejaz
delete lines in unix
Hi Can anyone please provide me soln for below:

I want to remove the word "system" from all the lines containing "#" and remove two lines below it.

file1:

!
system alpha#close
logs
login...
5,572
Posted By Aejaz
Delete a word and complete line
Hi Canone please provide me solution how can achieve the result below:

File1.txt

$
sweet apple£1
scotish
green
$
This is a test1
$
sweet mango£2
asia
yellow
$
This is a test 2
$...
4,109
Posted By Aejaz
Thanks to All.
Thanks to All.
4,109
Posted By Aejaz
Folks, I am getting a space now, tried applying...
Folks,
I am getting a space now, tried applying space
awk '{ printf("!\ninterface %s\n%s\n%s\n", $0, " shut", " switchport mode access")}' file1.txt
but i am not getting interface at the...
4,109
Posted By Aejaz
Folks, Two things I am missing.... 1....
Folks,
Two things I am missing....
1. interface in the first line
2. space in the beginning of the first two lines.

Regards,
4,109
Posted By Aejaz
Hi Jim, THanks for your response. I get the...
Hi Jim,

THanks for your response. I get the o/p but I want a space before no and switchport
Regards,
aejaz
4,109
Posted By Aejaz
Add new lines with a space in beginning
Hi

file1.txt contains

GigabitEthernet1/1
GigabitEthernet1/2
GigabitEthernet2/2
GigabitEthernet2/4
GigabitEthernet2/14
GigabitEthernet2/16

can anyone show me how to modify it as below....
10,702
Posted By Aejaz
How to select Test in Vi Editor
Guys,

file1 is 10pages long in vi.
How to select the complete contents of the life.

Regards
2,956
Posted By Aejaz
Thanks Folks. Will try all the options.
Thanks Folks. Will try all the options.
2,956
Posted By Aejaz
Cool It works. Thanks Frank.
Cool It works.
Thanks Frank.
2,956
Posted By Aejaz
How to delete empty lines
abc#
abc#this is a test
abc#this is a test to delete
abc#
xyz#
xyz#this is a test two
xyz#


In the above example '#' is common. How to do delete the emply lines. In specific to observe the...
4,680
Posted By Aejaz
^M goes away when I execute the command, but when...
^M goes away when I execute the command, but when I say
sed 's/^M//g' filename | more
it appears again.
4,680
Posted By Aejaz
Franklin, Thanks a Million, It works. I am...
Franklin, Thanks a Million, It works.
I am getting an unusual character at the end of every line.
^M at the end of every line when i do more.
3
3,514
Posted By Aejaz
Thanks Vijay! It worked.
Thanks Vijay! It worked.
3
3,514
Posted By Aejaz
Grep
Hi

grep hello file1.txt
grep £ file1.txt

I am trying to grep both in one command. But I am failing to get the result by

grep hello|£ file1.txt

Can anyone correct it ?
4,680
Posted By Aejaz
How to extract two words at the same time.
Hi, Can anyone please let me know, how to extract two lines at the same time. In specific,I have a file containing list of devices, such as router1 and switch2 below. I want to get all the lines...
4,131
Posted By Aejaz
Thanks to all. Sanjay it worked. :)
Thanks to all.
Sanjay it worked.
:)
4,131
Posted By Aejaz
Delete rest of the line
Hi, can anyone please answer my question in deleting the rest of the line. I have an example below of a file contaning:

Serial3/1.5 43.70.195.13 YES NVRAM down ...
Showing results 1 to 18 of 18

 
All times are GMT -4. The time now is 11:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy