Search Results

Search: Posts Made By: omega3
5,704
Posted By omega3
Hi Rudic, I didn't quite get the post ( -n,...
Hi Rudic,
I didn't quite get the post ( -n, --lines=[+]NUM ) on asking me to refer the manpage of tail command.
5,704
Posted By omega3
Thanks Rudic Your solution didn't work for...
Thanks Rudic

Your solution didn't work for me. Maybe bcoz the head and tail commands I use is GNU.

$ cat patterns.txt
hello world
hello asia
hello europe
hello africa
hello america
hello...
5,704
Posted By omega3
Thanks for the tip Rudic I am trying to...
Thanks for the tip Rudic

I am trying to print line 2 to 7th line using head command. But, I get the below errors. Can you guide me on the syntax.

$ head -n 2,7 patterns.txt
head: invalid...
5,704
Posted By omega3
Copy lines from x to y to another file
OS : RHEL 7.2
Shell : bash

I have a file which has lines like below

I want to copy from 2nd line to the 6th line and copy(redirect) those lines to another file.


$ cat...
5,583
Posted By omega3
Delete all lines except a line starting with string
Shell : bash
OS : RHEL 6.8

I have a file like below.

$ cat pattern.txt
hello
txt1
txt2
txt3
some other text
txt4

I want to remove all lines in this file except the ones starting with...
3,210
Posted By omega3
Thank You drysdalk. So, when a new process...
Thank You drysdalk.

So, when a new process is spawned or an existing process needs extra memory , will the memory be allocated from 'free' (100% unused) memory or memory allocated to Cache+Buffer ?
3,210
Posted By omega3
Interpreting Linux's free command output
I have two questions on Linux's free command. Below, I have provided output from my home laptop (fedora 26 ) which has 16GB Physical RAM and a production server (RHEL 7.4) which has 24GB RAM.

...
1,389
Posted By omega3
Thank You Don, gull For some reason, Clicking...
Thank You Don, gull
For some reason, Clicking on 'Thanks' button is not getting reflected except for the last post by gull.
I am using google chrome, later, I will try from Firefox
1,389
Posted By omega3
Split a file into 10 different files
OS : RHEL 6.7
Shell : bash

I have a text file with 5.97 million lines.

I want to split this big file into 12 different files (in sequential order) so that each file will contain roughly 500K...
1,090
Posted By omega3
Ok. Please Ignore the word 'professional' . ...
Ok. Please Ignore the word 'professional' .
Which method do you use ? Consider this as a poll . BTW what are Method1 and Method2 called (terminology) ?
1,090
Posted By omega3
The professional way to use chmod ?
Oracle Linux 6.4 with bash

Question from a beginner

To change permissions using chmod, I can use 2 methods. Since I don't know the terminology, I am calling them Method1 and Method2.
In the...
1,355
Posted By omega3
Yes. find <SearchstartLocation> -name <pattern>...
Yes. find <SearchstartLocation> -name <pattern> is the preferred syntax.

Alternatively you could use

find /path/pattern It seems to search only within the specified directory (depth=1 ). So it...
2,735
Posted By omega3
Archiving a log file on monthly basis
OS : RedHat Linux 6.2
Shell : Bash

Our application write messages, warnings,..etc to the following log file .

/app/cms/diagnostics/logs/cms_messages.log

This file has become huge now. I...
8,527
Posted By omega3
THANK YOU Radulov. Your fix worked !! Escaping...
THANK YOU Radulov. Your fix worked !!
Escaping the $ signs in PATH variable (shown in red below) did the trick . But what is the rationale behind this ?


# cat update2.sh
su - oracle -c "export...
8,527
Posted By omega3
Issue with quotes when running SQL command from within su -c
RHEL 6.2/Bash shell

root user will be executing the below script. It switches to oracle user logs in using sqlplus and tries to
run the below UPDATE statement. All the commands after su -c are...
6,809
Posted By omega3
Thank you Sea. So, how can I pass the database...
Thank you Sea. So, how can I pass the database name into the su command from the caller script ?
6,809
Posted By omega3
Thanks Jim. Thanks everyone. Any idea why...
Thanks Jim. Thanks everyone.

Any idea why passing the DB name as the parameter doesn't work ? Code and its execution shown in my last post. Just reminding that I execute the script as root.
6,809
Posted By omega3
Passing DB name as a parameter was not very...
Passing DB name as a parameter was not very succesfull.
Just to let you know that ORACLE_SID should ${DB_NAME}1 since this is RAC. Hence I am using $11 .eg BATGPRD1

As shown below, the execution...
6,809
Posted By omega3
Thank you Subbeh. Your fix worked. Hi...
Thank you Subbeh. Your fix worked.

Hi Chubler,
Your idea of passing DB name as a parameter is great. Hope it won't treat $database as a literal because of the double quotes. Let me try to modify...
6,809
Posted By omega3
Issue with running multiple commands withing su command
RHEL 6.2/Bash shell

root user will be executing the below script. It switches to oracle user and expect to do the following things

A. Source the environment variables for BATGPRD Database (the...
2,387
Posted By omega3
Thank you very much Yoda.
Thank you very much Yoda.
2,387
Posted By omega3
Thank you Robin. My requirement is to delete...
Thank you Robin. My requirement is to delete those lines. So grep or egrep won't help.
2,387
Posted By omega3
Delete lines starting with these strings
Platform : RHEL 5.8


I have text file called myapplication.log . In this file, I have around 800 lines which start with the followng three strings

PWRBRKER-3493
PWRBRKER-7834
SCHEDULER-ERROR...
2,790
Posted By omega3
Thank you hergp. If clusterware used echo...
Thank you hergp.
If clusterware used echo command as shown below , then there wouldn't have been any problem

$ echo "blueSkies" > hello.txt
$
$ cat hello.txt
blueSkies


By the way , how...
2,790
Posted By omega3
Cool. I opened the file in vi and saved it. The...
Cool. I opened the file in vi and saved it. The character has disappeared.
THANK YOU hergp for 'eliminating this problem'.
Does this imply that VI has inserted a newline character at the end ? What...
Showing results 1 to 25 of 40

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