wrfile
by Chris Kranz on Jul.07, 2009, under Manual Pages
NAME
wrfile – write a WAFL file
SYNOPSIS
wrfile [-a] filename [...]
DESCRIPTION
wrfile reads data from standard input and writes it the specified file. filename must be a fully-qualified pathname. If the specified file does not exist, it will be created. If the -a parameter is given, wrfile will append the rest of the command line after filename to the file. Otherwise, it will close the file when it reads an EOF from the input stream or if run on the console, when interrupted by typing the interrupt character.If wrfile is run from the console, interrupting wrfile will cause all characters typed on the same line as the interrupt to be lost. The filer will also issue a message complaining that the read system call was interrupted.
EXAMPLE
toaster> wrfile /etc/test1 test1 read: error reading standard input: Interrupted system call toaster> wrfile -a /etc/test1 test2 toaster>
creates a file /etc/test1 with two lines “test1″ and “test2″ in it.The wrfile -a form has some restrictions with the use special charaters, #, `, and “. It is recommend that the line to be written parameter be surrounded by quotes. Please see the examples below for clarification.
toaster> wrfile -a /etc/test1 This is line 2 toaster> wrfile -a /etc/test1 This is line 3 toaster> wrfile -a /etc/test1 This is line 4 with a \t toaster> wrfile -a /etc/test1 This is line 5 with a -v toaster> wrfile -a /etc/test1 This is line 6 # comment here toaster> wrfile -a /etc/test1 "This is line 7 # comment here" toaster> wrfile -a /etc/test1 This is line 8 with a slash n /n toaster> wrfile -a /etc/test1 This is line 9 with [] brackets toaster> wrfile -a /etc/test1 This is line '10'. toaster> wrfile -a /etc/test1 This is line "../index.htm". toaster> wrfile -a /etc/test1 "This is line '12'." toaster> wrfile -a /etc/test1 'This is line "../index.htm".' toaster> wrfile -a /etc/test1 This is line '"../index.htm"'. toaster> wrfile -a /etc/test1 "This is line \"15\"."
Will produce this file:
toaster> rdfile /etc/test1 This is line 2 This is line 3 This is line 4 with a \t This is line 5 with a -v This is line 6 This is line 7 # comment here This is line 8 with a slash n /n This is line 9 with [] brackets This is line 10. This is line 11. This is line '12'. This is line "../index.htm". This is line "../index.htm". This is line "../index.htm".
SEE ALSO
rdfile
WARNINGS
If a user has the capability to execute the wrfile command, then the user can write over or append onto any file on the filer.
Table of Contents
Copyright © 1994-2008 NetApp, Inc. Legal Information











































August 18th, 2010 on 4:59 pm
Can you explain what kind of sentence this is :
‘….If a user has the capability to execute the wrfile command, then the user and write over or append onto any file on the filer….’
You’ve got to be kidding me right? What is that supposed to mean???
August 18th, 2010 on 6:20 pm
Not sure what extra clarification you need on that. Having full root access to any system is dangerous and there are worse commands than this, but potentially with the wrfile you can do a lot of damage. It’d be difficult to do this accidentally, and that’s what snapshots are for.
On the flip side, this could be useful in some scenarios where permissions are messed up or you need to quickly change a system file and you have no other access to the system.
January 25th, 2011 on 4:33 pm
I think if the word AND is swapped for the word CAN, this will make sense. See below.
‘….If a user has the capability to execute the wrfile command, then the user CAN write over or append onto any file on the filer….’
And yes, having root access to anything is dangerous. I should know, I’ve broken enough stuff in my time.
January 27th, 2011 on 7:38 pm
Thank you for the correction, I’ll update accordingly