|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
[Solved] Help to remove a line from a file
Hi, I just upgraded one my server to latest version RHEL, I have many users who will do SSH from another server. I wanted to update all of the users home directory and remove the security key. For example. /home/XYZ/.ssh/known_hosts and remove this hostsname. Please see below and advise. Thanks. Code:
#!/bin/ksh -e XYZ='ls -1 /home' ## need to list each of the home directory for USERS in /$XYZ/.ssh/known_hosts ' ## each users home directory. do sed 's/txus03/g' ## remove the line txus03, replace with nothing done |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
wow, you make it so simple, I was trying to do all kinds of crazy things. Thank you so much.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] remove file extension | babom | Shell Programming and Scripting | 7 | 09-26-2012 05:57 AM |
| [Solved] Rename file name / remove part of name | borobudur | UNIX for Dummies Questions & Answers | 2 | 04-24-2012 05:00 PM |
| [Solved] Read a .gz file line by line without using gzcat | aikhaman | Shell Programming and Scripting | 4 | 10-06-2010 01:25 AM |
| [Solved] Problem in reading a file line by line till it reaches a white line | hakermania | Shell Programming and Scripting | 3 | 08-19-2010 11:37 AM |
|
|