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



Possibly Related Threads…
Thread Author Replies Views Last Post
  Fedora - TCP window scaling, timestamps and SACK xSicKxBot 0 1,023 08-13-2020, 07:59 AM
Last Post: xSicKxBot
  Fedora - Playing Music on your Fedora Terminal with MPD and ncmpcpp xSicKxBot 0 1,115 02-11-2020, 07:49 AM
Last Post: xSicKxBot
  Fedora - Setting up the sway window manager on Fedora xSicKxBot 0 1,081 12-16-2019, 11:45 PM
Last Post: xSicKxBot
  Fedora - 5 cool terminal pagers in Fedora xSicKxBot 0 987 12-07-2019, 10:43 AM
Last Post: xSicKxBot
  Windows Terminal Preview v0.3 Released xSicKxBot 0 977 08-05-2019, 07:00 PM
Last Post: xSicKxBot
  Linux To Bid Goodbye To Linux Floppy Drives xSicKxBot 0 1,152 07-31-2019, 04:54 AM
Last Post: xSicKxBot
  Linux Kernel 4.20 Reached End of Life, Users Urged to Upgrade to Linux 5.0 xSicKxBot 0 1,263 03-31-2019, 05:40 PM
Last Post: xSicKxBot
  Fedora - 4 cool terminal multiplexers xSicKxBot 0 1,199 03-30-2019, 02:58 AM
Last Post: xSicKxBot
  Fedora - Let’s try dwm — dynamic window manger xSicKxBot 0 1,066 03-19-2019, 01:22 AM
Last Post: xSicKxBot
  4 Unique Terminal Emulators for Linux xSicKxBot 0 1,251 12-14-2018, 05:16 PM
Last Post: xSicKxBot

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016