The safest would be something like:
assuming that something else hasn't been done in your script that needs to be undone if the script dies at this point.
I want to run the 'locate' command and then remove what the command finds.
My guess was, locate blahblah |rm -f
but this does not work.
Thanks! (3 Replies)
Hi,
First time on the forum. I have converted some files using the Unix to DOS command but need to strip off the last record that is generated from this conversion that contains just a ^Z. Is there any command that would accomplish this without having to do stream editing? (4 Replies)
I have directory IXNPG7 under which i have seen file ads.c , ads.gif ,
ads.js and lots more with extension .html
I tried to remove the Entire Directory with rm -Rf IXNPG7
but it is saying -- Directory Not empty can't remove
Secondly i tried removing all the files first
using rm *.*... (7 Replies)
find /app01/tomcat_local -name *jsp* -type f -exec rm -r {} \;
I would assume the above is just deleting any *jsp* below the /app01/tomcat_local directory - is this correct as its seems to delete more than I expect.... (1 Reply)
Hi All,
Is there an option for 'rm' to "remove everything but these files"?
For instance if I have:
a.txt <-- I just want to remove this one
a_1.txt
a_2.txt
Is there an option ? for this:
rm -? *_*.txt
Thanks,
ScKaSx (4 Replies)
I have a file from which the Header and the Trailer lines need to be removed. They are confirmed to be the first and the last lines in the file.
I have tried a few commands, but not successful yet. It needs to be implemented urgently, hence any help is greatly appreciated.
Raghu
----------... (1 Reply)
I need to delete some files which are not getting removed not even from root user
-rw-r----- 1 ptml tellin 0 Jul 26 19:23 temp.out1
-rw-r----- 1 ptml tellin 0 Jul 26 19:23 temp.out
-rw-r----- 1 ptml tellin 2 Jul 26 19:23 prev
-rw-r----- 1... (4 Replies)
KSH
A simple remove command is not workin for me. The user has all the access and the return code after remove command is 0. But I am still able to find the file. I have the code as below.
tmplog=/tmp/$fl_nm.$$
main () {
--set of statments
rm -fr $tmplog
RC=$?
} (2 Replies)
hi,
I want to remove first word in all files where first and second word is seperated by comma.
example: a file contains Apple,mango.
i need only mango shoule be there in the file???
Apple, should be removed!!!!!
can anyone help me out???
thanks in advance,
Arun Manas:b: (2 Replies)
I have two questions:
the first is I have a line of code:
printf "What is the id of the patient getting GJB2 analysis : "; read id that stores a user input in a variable $id in the python directory c:/Users/cmccabe/Desktop/Python27/$id.txt
Using rm I get the error cannot remove ... (21 Replies)
Discussion started by: cmccabe
21 Replies
LEARN ABOUT BSD
shar
SHAR(1net) Wang Institute SHAR(1net)NAME
shar - create file storage archive for extraction by /bin/sh
SYNOPSIS
shar [-abcmsuv] [-p prefix] [-d delim] files > archive
DESCRIPTION
shar prints its input files with special command lines around them to be used by the shell, /bin/sh , to extract the files later. The out-
put can be filtered through the shell to recreate copies of the original files.
shar allows directories to be named, and shar prints the necessary commands (mkdir & cd) to create new directories and fill them. shar
will not allow existing files to be over-written; such files must be removed by the user extracting the files.
OPTIONS -a All the options. The options: -v -c -b -p <tab>X are implied.
-b Extract files into basenames so that files with absolute path names are put into the current directory. This option has strange
effects when directories are archived.
-c Check file size on extraction by counting characters. An error message is reported to the person doing the extraction if the sizes
don't match. One reason why the sizes may not match is that shar will append a newline to complete incomplete last lines; shar
prints a message that mentions added newlines. Another reason why the sizes may not match is that some network mail programs remove
non-whitespace control characters. shar prints a message that mentions control characters to the extractor.
-d Use this as the ``end of file'' delimiter instead of the default. The only reason to change it is if you suspect a file contains
the default delimiter: SHAR_EOF.
-m Reset the exact protection modes of files when they are extracted (using the chmod program). By default, the extractor's default
file modes are used, and executable files (e.g., shell scripts) are made executable.
-p Use this as the prefix to each line of the archived files. This is to make sure that special characters at the start of lines are
not eaten up by programs like mailers. If this option is used, the files will be extracted with the stream editor sed rather than
cat so it is more efficient and portable to avoid setting the prefix, though perhaps less safe if you don't know what is in the
files.
-s Silent running. All checking and extra output is inhibited.
-u Archive the input files with the uuencode format for later extraction with uudecode. This will allow you to send files with control
characters in them, but will slow down the extracting. You must be sure that the receiving party has access to uudecode.
-v Print verbose feedback messages about what shar is doing to be printed during extraction. Sizes of plain files are echoed to allow
a simple validity check.
SEE ALSO sh(1), tar(1), cpio(1), tp(1), uuencode(1), uudecode(1)fpack(1) is a plain-file packer useful for UNIX and MSDOS
AUTHOR
Gary Perlman (based on a shell version by James Gosling, with additions motivated by many people on the UNIX network: Derek Zahn, Michael
Thompson, H. Morrow Long, Fred Avolio, Gran Uddeborg, Chuck Wegrzyn, nucleus!randy@TORONTO, & Bill McKeeman)
LIMITATIONS
shar does not know anything about links between files.
UNIX User's Manual March 4, 1986 SHAR(1net)