LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-25-2017, 11:12 AM   #1
cemberke61
LQ Newbie
 
Registered: Sep 2017
Posts: 1

Rep: Reputation: Disabled
How can I copy the records of the file “/etc/bashrc”


my question is about centos file copy

How can I copy the records of the file “/etc/bashrc” that have the “TMOUT” string except those containing the “read-only” string, to the file?
 
Old 09-25-2017, 11:52 AM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668Reputation: 1668
/etc/bashrc should just be an ASCII text file that you can type "cat" on to see on screen or use your favorite editor (e.g. vi, emacs, nano) to view.

What makes you think it has ANY lines with TMOUT or ANY lines that are "read only"?

What version of CentOS are you using?

Is it possible you meant instead how to extract records from a .bash_history file? You can use "strings <filename>" to see text within such history files (or other files that are not regular text files).

Last edited by MensaWater; 09-25-2017 at 12:00 PM.
 
Old 09-25-2017, 12:08 PM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,426
Blog Entries: 10

Rep: Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249Reputation: 5249
like this?

Code:
grep TMOUT /etc/bashrc | grep -v read_only > file
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How would you use scp to copy your ~/.bashrc file from the system named plum to th sandrews38 Linux - Newbie 2 01-20-2014 07:44 PM
how to copy ~/.bashrc file to local 768 Linux - Newbie 3 05-21-2012 09:27 PM
how would you use scp to copy your ~/.bashrc file from bravo to the local system? marty gallagher Linux - Newbie 1 11-10-2011 08:28 PM
[SOLVED] MX Records / A Records / CNAME Records - Advice Please fusion1275 Linux - Newbie 15 01-18-2011 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration