No you need to use the g command as I showed in my last post. The command:
will delete all lines in your file that contain the string gcc. And, the command:
will delete all lines in the range 3560 through 3572 that contain the string gcc.
I am looking for a way to remove any line in a text file that contains the string "Mac address". I guess you would grep and sed, but I am not sure how to do this. Thanks for you help. (3 Replies)
Hi,
I want to replace the srting '; with ABCD'; in a file from line 1 to line 65. Is there any single command to do it without using awk
Thanks for quick reply
https://www.unix.com/images/misc/progress.gif (3 Replies)
Hi
Can anyone tell me how can i remove new line character from a string.
My requirement is to read a line from a file and store it to a string.
read line
string1=$line
read line
string2=$line
echo $string1$string2
The result i am getting in different line. i want the output in the same... (1 Reply)
Hi,
i need to delete a lines after searching a particular string but this searching should only happen after the 4th line..
basically imagine a file like this
From: abcd.yahoo.com
To: cdeb.yahoo.com
Subject: hi all
sdfsd
sadasd
asdasd
dfsdf
From: abcd.yahoo.com
To:... (3 Replies)
Hello everyone...I have large txt file and I would like to remove unwanted specific line.
My data is like this:
So I would like to remove from line below No. until line reassambled like this:
Thanks... (4 Replies)
Hi Folks,
I am new to ksh, i have informatica parameter file that i need to update everyday with shell script. i need your help updating this file with new parameters.
sample data
$$TABLE1_DATE=04-27-2011
$$TABLE2_DATE=04-23-2011
$$TABLE3_DATE=03-19-2011
.......Highligned... (4 Replies)
I am trying to write a script that will allow me to recursively look at my directories, and output all filenames to a txt document. I am almost finished, however I am hitting one last snag. Here is my script so far:
find . | grep .jpg | awk -F"/" '{print $NF}' > output.txtThis will give me an... (7 Replies)
Hi,
I have a file like :
I want to remove last string in last line (here total string is "05550"~). And last line end with ~ character.
Output should be :
Please help me
Thanks in advance (3 Replies)
I would like to identify every line with a specific string, in this case: "Mamma".
I would like to remove that line, and also the line above it and below it. So the below
Where are all amazing Flats
Look At The Great Big White
Hey There Hot Mamma
You Are So hot Baby
I wish You were Mine... (5 Replies)
Discussion started by: phpchick
5 Replies
LEARN ABOUT PHP
rm
RM(1) User Commands RM(1)NAME
rm - remove files or directories
SYNOPSIS
rm [OPTION]... [FILE]...
DESCRIPTION
This manual page documents the GNU version of rm. rm removes each specified file. By default, it does not remove directories.
If the -I or --interactive=once option is given, and there are more than three files or the -r, -R, or --recursive are given, then rm
prompts the user for whether to proceed with the entire operation. If the response is not affirmative, the entire command is aborted.
Otherwise, if a file is unwritable, standard input is a terminal, and the -f or --force option is not given, or the -i or --interac-
tive=always option is given, rm prompts the user for whether to remove the file. If the response is not affirmative, the file is skipped.
OPTIONS
Remove (unlink) the FILE(s).
-f, --force
ignore nonexistent files and arguments, never prompt
-i prompt before every removal
-I prompt once before removing more than three files, or when removing recursively; less intrusive than -i, while still giving protec-
tion against most mistakes
--interactive[=WHEN]
prompt according to WHEN: never, once (-I), or always (-i); without WHEN, prompt always
--one-file-system
when removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command
line argument
--no-preserve-root
do not treat '/' specially
--preserve-root
do not remove '/' (default)
-r, -R, --recursive
remove directories and their contents recursively
-d, --dir
remove empty directories
-v, --verbose
explain what is being done
--help display this help and exit
--version
output version information and exit
By default, rm does not remove directories. Use the --recursive (-r or -R) option to remove each listed directory, too, along with all of
its contents.
To remove a file whose name starts with a '-', for example '-foo', use one of these commands:
rm -- -foo
rm ./-foo
Note that if you use rm to remove a file, it might be possible to recover some of its contents, given sufficient expertise and/or time.
For greater assurance that the contents are truly unrecoverable, consider using shred.
AUTHOR
Written by Paul Rubin, David MacKenzie, Richard M. Stallman, and Jim Meyering.
REPORTING BUGS
GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Report rm translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2017 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO unlink(1), unlink(2), chattr(1), shred(1)
Full documentation at: <http://www.gnu.org/software/coreutils/rm>
or available locally via: info '(coreutils) rm invocation'
GNU coreutils 8.28 January 2018 RM(1)