Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to create a file in Linux from terminal window

#1
Depending on what you want the file to contain:
  • touch /path/to/file
  • for an empty file
    somecommand > /path/to/file
  • for a file containing the output of some command.
     eg: grep --help > randomtext.txt      echo "This is some text" > randomtext.txtnano /path/to/file
  • or
    vi /path/to/file
  • or
    any other editor emacs,gedit etcIt either opens the existing one for editing or creates & opens the empty file to enter, if it doesn't exist
[Image: 8OHl5AB.png]
Reply



Forum Jump:


Users browsing this thread:
3 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016