Jump to content

How do I make a .txt file?

Go to solution Solved by mariushm,

In Windows you can also do this :

 

copy CON c:\temp\file.txt

 

and press Ctrl+Z and ENTER when you're done to close the file and return back to console (command line). Ctrl+Z is short for "end of file" and ENTER simply submits the command.

 

The whole thing means copy what you type on console to file c:\temp\file.txt  (naturally the folder temp needs to exist, specify the full path or just a name if you want the file to be created in the current folder, the one listed before the prompt)

 

In Linux, you can use the touch command to create files. Linux has no concept of extensions (meaning programs don't use file extensions  to open files) but you're free to use extensions in the name of the files you create.

 

 

 

In Ubuntu 14.04

Thanks!

Look at my status then you'll know why

 

tl;dr

how do I make a .txt file in 14.04 Ubuntu?

thanks

Well, now you're reading this, I might as well inspire you with a deep quote

If you fall, I'll be there

             - Floor

so inspiring, so deep, the feels ;-;  THE FEELS ;-;

 

Newer Build which I'm gonna buy when I haz moneyz

CPU: Intel Core i5-4440 3.1GHz Quad-Core Processor  (£0.00)
CPU Cooler: be quiet! PURE ROCK 51.7 CFM Sleeve Bearing CPU Cooler  (£25.98 @ Novatech)
Motherboard: MSI B85-G43 GAMING ATX LGA1150 Motherboard  (£78.10 @ Amazon UK)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£0.00)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£29.76 @ Ebuyer)
Storage: Seagate Barracuda 2TB 3.5" 7200RPM Internal Hard Drive  (£0.00)
Video Card: MSI Radeon R9 380 4GB Video Card  (£179.99 @ Amazon UK)
Case: Corsair 780T ATX Full Tower Case  (£149.99 @ Amazon UK)
Power Supply: EVGA SuperNOVA G2 550W 80+ Gold Certified Fully-Modular ATX Power Supply  (£70.97 @ Amazon UK)
Optical Drive: Asus DRW-24B1ST/BLK/B/AS DVD/CD Writer  (Purchased For £0.00)
Operating System: Microsoft Windows 8.1 OEM (64-bit)  (£59.00 @ Amazon UK)
Wireless Network Adapter: TP-Link TL-WDN4800 802.11a/b/g/n PCI-Express x1 Wi-Fi Adapter  (£24.99 @ Amazon UK)
Keyboard: Corsair K95 RGB Wired Gaming Keyboard  (£184.99 @ Amazon UK)
Total: £803.77

 

somethings says '£0.00' because I already bought them

 

 
probably best remix out there

 

 

If I follow you, consider your self lucky, I rarely follow people and when I do it's either because

1) I look up to you

2)I like your picture

3) Or you have an epic ass rig (40 titan x's 9 6700k's clocked at 29GHz that is what I call a epic ass rig, but no one has that soo...)

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, GreezyJeezy said:

can you not right click on the desktop and click text file? idk ubuntu  

sort of, but idk if it'll open in windows as a .txt file

since it opens as gedit which is linux's .txt

Well, now you're reading this, I might as well inspire you with a deep quote

If you fall, I'll be there

             - Floor

so inspiring, so deep, the feels ;-;  THE FEELS ;-;

 

Newer Build which I'm gonna buy when I haz moneyz

CPU: Intel Core i5-4440 3.1GHz Quad-Core Processor  (£0.00)
CPU Cooler: be quiet! PURE ROCK 51.7 CFM Sleeve Bearing CPU Cooler  (£25.98 @ Novatech)
Motherboard: MSI B85-G43 GAMING ATX LGA1150 Motherboard  (£78.10 @ Amazon UK)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£0.00)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£29.76 @ Ebuyer)
Storage: Seagate Barracuda 2TB 3.5" 7200RPM Internal Hard Drive  (£0.00)
Video Card: MSI Radeon R9 380 4GB Video Card  (£179.99 @ Amazon UK)
Case: Corsair 780T ATX Full Tower Case  (£149.99 @ Amazon UK)
Power Supply: EVGA SuperNOVA G2 550W 80+ Gold Certified Fully-Modular ATX Power Supply  (£70.97 @ Amazon UK)
Optical Drive: Asus DRW-24B1ST/BLK/B/AS DVD/CD Writer  (Purchased For £0.00)
Operating System: Microsoft Windows 8.1 OEM (64-bit)  (£59.00 @ Amazon UK)
Wireless Network Adapter: TP-Link TL-WDN4800 802.11a/b/g/n PCI-Express x1 Wi-Fi Adapter  (£24.99 @ Amazon UK)
Keyboard: Corsair K95 RGB Wired Gaming Keyboard  (£184.99 @ Amazon UK)
Total: £803.77

 

somethings says '£0.00' because I already bought them

 

 
probably best remix out there

 

 

If I follow you, consider your self lucky, I rarely follow people and when I do it's either because

1) I look up to you

2)I like your picture

3) Or you have an epic ass rig (40 titan x's 9 6700k's clocked at 29GHz that is what I call a epic ass rig, but no one has that soo...)

Link to comment
Share on other sites

Link to post
Share on other sites

You can just append any file extension in Linux to a file and so long as it contains the right character set it can be read just fine in Windows.

Current Network Layout:

Current Build Log/PC:

Prior Build Log/PC:

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, Lurick said:

You can just append any file extension in Linux to a file and so long as it contains the right character set it can be read just fine in Windows.

So I can just throw it into windows and it'll open normally?

Well, now you're reading this, I might as well inspire you with a deep quote

If you fall, I'll be there

             - Floor

so inspiring, so deep, the feels ;-;  THE FEELS ;-;

 

Newer Build which I'm gonna buy when I haz moneyz

CPU: Intel Core i5-4440 3.1GHz Quad-Core Processor  (£0.00)
CPU Cooler: be quiet! PURE ROCK 51.7 CFM Sleeve Bearing CPU Cooler  (£25.98 @ Novatech)
Motherboard: MSI B85-G43 GAMING ATX LGA1150 Motherboard  (£78.10 @ Amazon UK)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£0.00)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£29.76 @ Ebuyer)
Storage: Seagate Barracuda 2TB 3.5" 7200RPM Internal Hard Drive  (£0.00)
Video Card: MSI Radeon R9 380 4GB Video Card  (£179.99 @ Amazon UK)
Case: Corsair 780T ATX Full Tower Case  (£149.99 @ Amazon UK)
Power Supply: EVGA SuperNOVA G2 550W 80+ Gold Certified Fully-Modular ATX Power Supply  (£70.97 @ Amazon UK)
Optical Drive: Asus DRW-24B1ST/BLK/B/AS DVD/CD Writer  (Purchased For £0.00)
Operating System: Microsoft Windows 8.1 OEM (64-bit)  (£59.00 @ Amazon UK)
Wireless Network Adapter: TP-Link TL-WDN4800 802.11a/b/g/n PCI-Express x1 Wi-Fi Adapter  (£24.99 @ Amazon UK)
Keyboard: Corsair K95 RGB Wired Gaming Keyboard  (£184.99 @ Amazon UK)
Total: £803.77

 

somethings says '£0.00' because I already bought them

 

 
probably best remix out there

 

 

If I follow you, consider your self lucky, I rarely follow people and when I do it's either because

1) I look up to you

2)I like your picture

3) Or you have an epic ass rig (40 titan x's 9 6700k's clocked at 29GHz that is what I call a epic ass rig, but no one has that soo...)

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, LynxThe1st said:

So I can just throw it into windows and it'll open normally?

Yup, you can even throw it in Windows without an extension and add the .txt to the name in Windows and it should work just fine.

Current Network Layout:

Current Build Log/PC:

Prior Build Log/PC:

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, Lurick said:

Yup, you can even throw it in Windows without an extension and add the .txt to the name in Windows and it should work just fine.

thanks man :D

Well, now you're reading this, I might as well inspire you with a deep quote

If you fall, I'll be there

             - Floor

so inspiring, so deep, the feels ;-;  THE FEELS ;-;

 

Newer Build which I'm gonna buy when I haz moneyz

CPU: Intel Core i5-4440 3.1GHz Quad-Core Processor  (£0.00)
CPU Cooler: be quiet! PURE ROCK 51.7 CFM Sleeve Bearing CPU Cooler  (£25.98 @ Novatech)
Motherboard: MSI B85-G43 GAMING ATX LGA1150 Motherboard  (£78.10 @ Amazon UK)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£0.00)
Memory: Kingston HyperX FURY 8GB (2 x 4GB) DDR3-1600 Memory  (£29.76 @ Ebuyer)
Storage: Seagate Barracuda 2TB 3.5" 7200RPM Internal Hard Drive  (£0.00)
Video Card: MSI Radeon R9 380 4GB Video Card  (£179.99 @ Amazon UK)
Case: Corsair 780T ATX Full Tower Case  (£149.99 @ Amazon UK)
Power Supply: EVGA SuperNOVA G2 550W 80+ Gold Certified Fully-Modular ATX Power Supply  (£70.97 @ Amazon UK)
Optical Drive: Asus DRW-24B1ST/BLK/B/AS DVD/CD Writer  (Purchased For £0.00)
Operating System: Microsoft Windows 8.1 OEM (64-bit)  (£59.00 @ Amazon UK)
Wireless Network Adapter: TP-Link TL-WDN4800 802.11a/b/g/n PCI-Express x1 Wi-Fi Adapter  (£24.99 @ Amazon UK)
Keyboard: Corsair K95 RGB Wired Gaming Keyboard  (£184.99 @ Amazon UK)
Total: £803.77

 

somethings says '£0.00' because I already bought them

 

 
probably best remix out there

 

 

If I follow you, consider your self lucky, I rarely follow people and when I do it's either because

1) I look up to you

2)I like your picture

3) Or you have an epic ass rig (40 titan x's 9 6700k's clocked at 29GHz that is what I call a epic ass rig, but no one has that soo...)

Link to comment
Share on other sites

Link to post
Share on other sites

touch (file name here)

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

notepad.exe will open any file that's text only. If you feel like it, you can save to .txt, but it's not necessary. It just has to be text only. I'm a friggin retard when it comes to linux but in WIndows it's entirely possible to create your own extension and open the files in notepad.exe.

Shift+right-click on the desktop and pick 'Open command window here'

type in or copy-paste the following line

echo All hail the mightly Naeaes >> Naeaes.naeaes

Hit enter, find the Naeaes.naeaes -file on your desktop, right-click it, pick Open with

Untick the 'Always use...' so you won't end up with an unnecessary registry entry for the .naeaes file extension, find notepad.exe and open it. Leave it ticked, and notepad will be the default program for your .naeaes files from now on.

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

In Windows you can also do this :

 

copy CON c:\temp\file.txt

 

and press Ctrl+Z and ENTER when you're done to close the file and return back to console (command line). Ctrl+Z is short for "end of file" and ENTER simply submits the command.

 

The whole thing means copy what you type on console to file c:\temp\file.txt  (naturally the folder temp needs to exist, specify the full path or just a name if you want the file to be created in the current folder, the one listed before the prompt)

 

In Linux, you can use the touch command to create files. Linux has no concept of extensions (meaning programs don't use file extensions  to open files) but you're free to use extensions in the name of the files you create.

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

touch /path/to/directory/fileName.extension

 

so

 

touch /path/to/directory/textFile.txt

Intel i7 5820K (4.5 GHz) | MSI X99A MPower | 32 GB Kingston HyperX Fury 2666MHz | Asus RoG STRIX GTX 1080ti OC | Samsung 951 m.2 nVME 512GB | Crucial MX200 1000GB | Western Digital Caviar Black 2000GB | Noctua NH-D15 | Fractal Define R5 | Seasonic 860 Platinum | Logitech G910 | Sennheiser 599 | Blue Yeti | Logitech G502

 

Nikon D500 | Nikon 300mm f/4 PF  | Nikon 200-500 f/5.6 | Nikon 50mm f/1.8 | Tamron 70-210 f/4 VCII | Sigma 10-20 f/3.5 | Nikon 17-55 f/2.8 | Tamron 90mm F2.8 SP Di VC USD Macro | Neewer 750II

Link to comment
Share on other sites

Link to post
Share on other sites

For simply creating a text file with touch, as others have said you just do:

touch textfile.txt

If you want to do something like you were doing in that original command, where you add some text to the end of a file (creating it if it doesn't already exist) it would be:

echo "some text" >> textfile.txt

If you wanted to overwrite the whole file with the text, it would be:

echo "some text" > textfile.txt

Note that a single '>' means it's simply overwriting the file and double '>>' means it's appending to the end.

 

You can also send the output of a command to a text file with something like:

ifconfig > textfile.txt

Realistically though, all of these commands would place 'textfile.txt' into whatever directory you're currently in, so you'd really want to do something like:

ifconfig > ~/Documents/textfile.txt

The '~' being short for the current user's home directory. So that would be sending the file to /home/username/Documents/textfile.txt

 

Hope it helps!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×