07-30-2013
# /UNIX.org file deleting is safer or not
Hi All,
Please tell me the use of # /Unix.org file it has reserved a huge disk space, I want to know is it safer to truncate or delete.
Thanks - Rukshan.
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi ALL,
Can anyone help me out.
I have unix file, I need to delete the contents of the file. Can any one let me know the command to do this.
The file has to be there, but the contents should be deleted.
thanks
Manas (6 Replies)
Discussion started by: manas6
6 Replies
2. What is on Your Mind?
I know that you already know the answer to the question. It just springed in my mind after what happened yesterday. I was getting some books off of Amazon.com, since they are cheeper than bookstore, and my mother said something that made me laugh 'till I couldn't breathe. I have a Debian Lenny... (12 Replies)
Discussion started by: Texasone
12 Replies
3. Shell Programming and Scripting
Hi All,
I have a requirement where i need to remove a file from Remote system. Can any one suggest me how to do this?
My requirement is, i need to archive the file in a separate system. If the remore system is having files older than 7 years, then i need to delete that files from the remote... (2 Replies)
Discussion started by: Raamc
2 Replies
4. Shell Programming and Scripting
Hi,
From the pattern mentioned below remove lines based on pattern range.
Conditions
1 Look For all lines starting with ALTER TABLE and Ending with ; and contains the word MOVE.I wanto to remove these lines from the file sample below.
Note : The above pattern list could be found in... (1 Reply)
Discussion started by: rajan_san
1 Replies
5. Shell Programming and Scripting
Objective
*******
I was trying to develop a script that moves files from one folder to another in Windows drive from a Unix script. I got ftp account created for those windows folders.
I know that for moving a file from Unix server to Windows server we use scp command, but is there a command... (2 Replies)
Discussion started by: anilvaranasi_02
2 Replies
6. UNIX for Dummies Questions & Answers
Hi
I have a file:
r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e)
I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies
7. Shell Programming and Scripting
Hi All ,
I am using the below if condition to delete files .
if
then
if ; then
log_err "Trigger File ${LINKTRIGGER} does not exist!"
fi
log_msg "Deleting the Linktrigger"
rm -v ${LANDINGDIR}/${LINKTRIGGER}.*
else
if ; then
log_err "Trigger File ${TRGFILE} does not exist!"
echo... (11 Replies)
Discussion started by: Hypesslearner
11 Replies
8. UNIX for Advanced & Expert Users
Hello:
I've been reading about ways to edit files from the command line, and I've found two websites which state that the following is the safest way to edit a file:
command original > new
mv new originalThat is, renaming the newer file to the previous one. This is what the websites I mentioned... (8 Replies)
Discussion started by: Cacializ
8 Replies
LEARN ABOUT FREEBSD
truncate
TRUNCATE(1) BSD General Commands Manual TRUNCATE(1)
NAME
truncate -- truncate or extend the length of files
SYNOPSIS
truncate [-c] -s [+|-]size[K|k|M|m|G|g|T|t] file ...
truncate [-c] -r rfile file ...
DESCRIPTION
The truncate utility adjusts the length of each regular file given on the command-line.
The following options are available:
-c Do not create files if they do not exist. The truncate utility does not treat this as an error. No error messages are displayed and
the exit value is not affected.
-r rfile
Truncate or extend files to the length of the file rfile.
-s [+|-]size[K|k|M|m|G|g|T|t]
If the size argument is preceded by a plus sign (+), files will be extended by this number of bytes. If the size argument is pre-
ceded by a dash (-), file lengths will be reduced by no more than this number of bytes, to a minimum length of zero bytes. Other-
wise, the size argument specifies an absolute length to which all files should be extended or reduced as appropriate.
The size argument may be suffixed with one of K, M, G or T (either upper or lower case) to indicate a multiple of Kilobytes,
Megabytes, Gigabytes or Terabytes respectively.
Exactly one of the -r and -s options must be specified.
If a file is made smaller, its extra data is lost. If a file is made larger, it will be extended as if by writing bytes with the value zero.
If the file does not exist, it is created unless the -c option is specified.
Note that, while truncating a file causes space on disk to be freed, extending a file does not cause space to be allocated. To extend a file
and actually allocate the space, it is necessary to explicitly write data to it, using (for example) the shell's '>>' redirection syntax, or
dd(1).
EXIT STATUS
The truncate utility exits 0 on success, and >0 if an error occurs. If the operation fails for an argument, truncate will issue a diagnostic
and continue processing the remaining arguments.
SEE ALSO
dd(1), touch(1), truncate(2)
STANDARDS
The truncate utility conforms to no known standards.
HISTORY
The truncate utility first appeared in FreeBSD 4.2.
AUTHORS
The truncate utility was written by Sheldon Hearn <sheldonh@starjuice.net>.
BSD
December 19, 2006 BSD