Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] Help to remove a line from a file Post 302731995 by in2nix4life on Friday 16th of November 2012 10:29:59 AM
Old 11-16-2012
Code:
find /home -name 'known_hosts' -exec sed -i -e 's/txus03//g' {} \;

This User Gave Thanks to in2nix4life For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove header(first line) and trailer(last line) in ANY given file

Hi, I need some help in removing the header (first line) and the trailer (last line) in a give file... The data file actually comes in EBCDIC format and I converted it into ASCII.. Now I need to strip off the first line and the last line.. I think we can use sed to do something like this:... (2 Replies)
Discussion started by: madhunk
2 Replies

2. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

3. Shell Programming and Scripting

[Solved] Read a .gz file line by line without using gzcat

Hi all Is there a way to read and process a gzip file line by line similar to a text file without using gzcat.. while processing a text file we will usually use the logic exec<sample.txt while read line do echo $line done Is there a similar way to process the gz file in the same... (4 Replies)
Discussion started by: aikhaman
4 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Rename file name / remove part of name

I have a whole file structure with jpeg files where I want to remove a part of the file name. An application added in many files a case conflict in the naming "xyz 017.jpg (Case Conflict 1)" So, can someone help me how to get rid of the " (Case Conflict 1)"? What I have is this: find . -name... (2 Replies)
Discussion started by: borobudur
2 Replies

5. Shell Programming and Scripting

[SOLVED] Sorting file and get everything on same line on condition

Good afternoon! I am a perl newbie. I hope you will be patient with me. I have a script that needs to be written in perl. I can't do it in awk or shell scripting. Here is the script: #!/usr/bin/perl use POSIX qw(strftime); use FileHandle; use Getopt::Long; use IO::Handle;... (0 Replies)
Discussion started by: brianjb
0 Replies

6. Shell Programming and Scripting

[Solved] remove file extension

Hi, I have some files with some extension e.g. abc.xml.REMOVE,xyz.xml,efg.xml.REMOVE . I have to remove the .REMOVE extension. I can display it using the below script but cannot rename it. ls -l|sed 's/\.REMOVE//' How can I rename this? Thanks in advance (7 Replies)
Discussion started by: babom
7 Replies

7. Shell Programming and Scripting

[Solved] Remove file older than 90 days

I have crontab job a tar file to a directory ( tar -cvf /tmp/backup/or.`date +%m%d%y`. /ora/db/* ) , it will do it every day . Now I don't want to keep too much files , I just want to keep the file for 90 days , can advise if I want to remove the backup file which are elder than 90 days , can... (1 Reply)
Discussion started by: ust3
1 Replies

8. UNIX for Dummies Questions & Answers

[Solved] New Line in file

Hi, Though I was successful in following query, I like to know the other ways of doing it. I have a file that is sent as an attachment via mail. However, while opening it, notepad does not recognize new line character whereas other editors like text pad recognizes new line character of unix.... (2 Replies)
Discussion started by: bobbygsk
2 Replies

9. Shell Programming and Scripting

[Solved] Howto remove extra space in the file

Hi Gurus, I have a file which contains some special char or space. when using cat -evt I can see the file as following: 0,"0000","abc/def aaa ... (6 Replies)
Discussion started by: ken6503
6 Replies
RMUSER(8)						    BSD System Manager's Manual 						 RMUSER(8)

NAME
rmuser -- remove users from the system SYNOPSIS
rmuser [-yv] [-f file] [username ...] DESCRIPTION
The rmuser utility removes one or more users submitted on the command line or from a file. In removing a user from the system, this utility: 1. Removes the user's crontab(1) entry (if any). 2. Removes any at(1) jobs belonging to the user. 3. Sends a SIGKILL signal to all processes owned by the user. 4. Removes the user from the system's local password file. 5. Removes the user's home directory (if it is owned by the user), including handling of symbolic links in the path to the actual home directory. 6. Removes the incoming mail and POP daemon mail files belonging to the user from /var/mail. 7. Removes all files owned by the user from /tmp, /var/tmp, and /var/tmp/vi.recover. 8. Removes the username from all groups to which it belongs in /etc/group. (If a group becomes empty and the group name is the same as the username, the group is removed; this complements adduser(8)'s per-user unique groups.) 9. Removes all message queues, shared memory segments and semaphores owned by the user. The rmuser utility refuses to remove users whose UID is 0 (typically root), since certain actions (namely, killing all the user's processes, and perhaps removing the user's home directory) would cause damage to a running system. If it is necessary to remove a user whose UID is 0, see vipw(8) for information on directly editing the password file. If rmuser was not invoked with the -y option, it will show the selected user's password file entry and ask for confirmation that the user be removed. It will then ask for confirmation to delete the user's home directory. If the answer is in the affirmative, the home directory and any files and subdirectories under it will be deleted only if they are owned by the user. See pw(8) for more details. As rmuser operates, it informs the user regarding the current activity. If any errors occur, they are posted to standard error and, if it is possible for rmuser to continue, it will. The options are as follows: -f file The rmuser utility will get a list of users to be removed from file, which will contain one user per line. Anything following a hash mark ('#'), including the hash mark itself, is considered a comment and will not be processed. If the file is owned by anyone other than a user with UID 0, or is writable by anyone other than the owner, rmuser will refuse to continue. -y Implicitly answer ``yes'' to any and all prompts. Currently, this includes prompts on whether to remove the specified user and whether to remove the home directory. This option requires that either the -f option be used, or one or more user names be given as command line arguments. -v Enable verbose mode. Normally, the output includes one line per removed user; however, with this option rmuser will be much more chatty about the steps taken. username Identifies one or more users to be removed; if not present, rmuser interactively asks for one or more users to be removed. FILES
/etc/master.passwd /etc/passwd /etc/group /etc/spwd.db /etc/pwd.db SEE ALSO
at(1), chpass(1), crontab(1), finger(1), passwd(1), group(5), passwd(5), adduser(8), pw(8), pwd_mkdb(8), vipw(8) HISTORY
The rmuser utility appeared in FreeBSD 2.2. BUGS
The rmuser utility does not comprehensively search the file system for all files owned by the removed user and remove them; to do so on a system of any size is prohibitively slow and I/O intensive. It is also unable to remove symbolic links that were created by the user in /tmp or /var/tmp, as symbolic links on 4.4BSD file systems do not contain information as to who created them. Also, there may be other files cre- ated in /var/mail other than /var/mail/username and /var/mail/.pop.username that are not owned by the removed user but should be removed. The rmuser utility has no knowledge of YP/NIS, and it operates only on the local password file. BSD
May 10, 2002 BSD
All times are GMT -4. The time now is 02:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy