Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Creating File using the CAT Command Post 302386413 by Scott on Tuesday 12th of January 2010 11:22:30 AM
Old 01-12-2010
Quote:
Originally Posted by methyl
The equivalent of "touch new_file_name" is:

Code:
cat /dev/null > new_file_name

But only for a new file.

Where just
Code:
> new_file_name

would do.

Corona688 is right. Using redirection with any tool will create a file, so the question is ultimately futile.

Last edited by Scott; 01-12-2010 at 12:31 PM.. Reason: rewording
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating file of 1MB using shell command?

Hi everybody in the forum, I want to create an empty file of say some 1MB ,i mean at the command line itself.How is this possible??????EEK! (4 Replies)
Discussion started by: vijaya2006
4 Replies

2. UNIX for Dummies Questions & Answers

Creating a file that contains output from a command, and then displays itself

hey, I'm trying to create the command that will create a file named user.txt that contains the output of the command cut -d: -f1,5 /etc/passwd, and displays itself afterwards. I don't know how to bridge cat > user.txt with cut -d: -f1,5 /etc/passwd, or how display it afterwards. Any help would... (2 Replies)
Discussion started by: raidkridley
2 Replies

3. Shell Programming and Scripting

cat in the command line doesn't match cat in the script

Hello, So I sorted my file as I was supposed to: sort -n -r -k 2 -k 1 file1 | uniq > file2 and when I wrote > cat file2 in the command line, I got what I was expecting, but in the script itself ... sort -n -r -k 2 -k 1 averages | uniq > temp cat file2 It wrote a whole... (21 Replies)
Discussion started by: shira
21 Replies

4. Shell Programming and Scripting

Extra control characters being added when I create a file using cat command

Hi, I am using Cygwin.I created a new file and type into it using cat > newfile. When I open this using vi editor, it contains loads of extra control characters. Whats happening? (1 Reply)
Discussion started by: erora
1 Replies

5. UNIX for Dummies Questions & Answers

stuck in editing file with cat command

Hi, While editing a small text file with cat command i pressed ctrl-d to send eof, instead of coming out of cat command it echoed ^D to the screen. Same thing is happening to ctrl-c. After googling i found this is because of trap. The problem is i m stuck in editing mode and cannot get the... (3 Replies)
Discussion started by: TITANIUM
3 Replies

6. UNIX for Dummies Questions & Answers

format values in a text file using cat command

Hello... Is it possible that we can change the format of the values we entered in a text file using cat? Like for example, I will create a text file names.txt using cat and as I save the names and view the text file... the format will be like this ... (5 Replies)
Discussion started by: kpopfreakghecky
5 Replies

7. Shell Programming and Scripting

Cat Command on File not printing "Blank" Lines?

Hello All, I have a bash script and in it at some point I call an Expect Script that does some stuff and saves its output in a ".txt" file. Example "/path/to/my/file/Expect_Output.txt" file: notice the 2nd line is empty in the file... Data for Host-1 (192.168.1.110) Checking the... (2 Replies)
Discussion started by: mrm5102
2 Replies

8. UNIX for Dummies Questions & Answers

Cat command drops lines in output file

I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going?? cat 7760-001_1_*_06_*.txt | grep -v... (1 Reply)
Discussion started by: Xin Xin
1 Replies

9. Shell Programming and Scripting

Cat command not working to display Mac file in Ubuntu

Hi, Recently I got a .txt file from Mac user. when I try to open it in my Ubuntu machine using cat command it is not displaying any content of file however I can see the content using vi. Anyone know How to see its content using cat as I have to process it in my shell script. Thanks in... (4 Replies)
Discussion started by: diehard
4 Replies

10. UNIX for Beginners Questions & Answers

Creating file and passing argument to a command

Hi All, I am having command to run which will take argument as input file. Right now we are creating the input file by cat and executing the command ftptransfer -i input file cat >input file file1 file2 cntrl +d Is there a way I can do that in a single command like ... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies
NYANCAT(1)						      General Commands Manual							NYANCAT(1)

NAME
nyancat - terminal-based Pop Tart Cat animation SYNOPSIS
nyancat [ -hitn ] [-f frames] DESCRIPTION
nyancat is an animated, color, ANSI-text program that renders a loop of the classic Nyan Cat animation. nyancat makes use of various ANSI escape sequences to render color, or in the case of a VT220, simply dumps text to the screen. OPTIONS
-i, --intro Show introduction / about information on startup. -t, --telnet Enable telnet mode. -n, --no-counter Do not display the timer. -s, --no-title Do not set the titlebar text. -e, --no-clear Do not clear the display between frames. -f, --frames Display the requested number of frames, then quit. -r, --min-rows Crop the animation from the top. -R, --max-rows Crop the animation from the bottom. -c, --min-cols Crop the animation from the left. -C, --max-cols Crop the animation from the right. -W, --width Crop the animation to the given width. -H, --height Crop the animation to the given height. -h, --help Show help message and exit. HOMEPAGE
Homepage: http://miku.acm.uiuc.edu/ Repository: https://github.com/klange/nyancat AUTHOR
nyancat was written by Kevin Lange. This manual page was written by Jonathan McCrohan <jmccrohan@gmail.com>, for the Debian project (and may be used by others). May, 2012 NYANCAT(1)
All times are GMT -4. The time now is 07:09 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy