How do you create a new text file in IBM i (as/400) Integrated File System (IFS) from green screen command line or maybe in ACS or Navigator tools?
I usually just copy an old file, but I realized I don't know create a new file using IBM i command. No F6=Create option in WRKLNK. Going through on line help was not productive.
CPY OBJ('/home/myFile.txt') TOOBJ('/home/NEWUSER/MyNewFile.txt')
If you just want a text file, you can use EDTF
to create an empty IFS file and open an editor against it. So:
EDTF 'test.txt'
will create a file named test.txt
in the IFS in your home directory which is usually /home/<user name>
.
Another alternative is to use the QSH
command and run the touch
shell command.
QSH CMD('touch /path/to/ifs/file.txt')
You can add the '-C nnnn' parameter if you want to set the CCSID of the file that is created.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With