Sponsored Content
Full Discussion: cat command
Top Forums Shell Programming and Scripting cat command Post 302068833 by surjyap on Tuesday 21st of March 2006 07:51:10 AM
Old 03-21-2006
cat command

What does the below command means

$cat <<% >abc.txt
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

the CAT command

hi everybody, how do i open a txt file writen in unix on to a web page so when i want to view the txt file that was generated from a shell program, that file is open on a web page do i use the cat > filename.html command to do this, or is there another way many thanks :D (2 Replies)
Discussion started by: alexd
2 Replies

2. UNIX for Dummies Questions & Answers

CAT command

All - how do i save the file after i used CAT command line to modify? Thanks :confused: (2 Replies)
Discussion started by: March_2007
2 Replies

3. AIX

cat command

I would like to append some statement into 1 single file so that it can be concatenate together in 1 word. I have tried >> but it will seperate my 2 statement into 2 rows. # cat abc.txt cde.txt > result.txt where abc.txt is "abcde" and cde.txt is "12345" the result should come out as... (3 Replies)
Discussion started by: kwliew999
3 Replies

4. UNIX for Dummies Questions & Answers

Difference between cat , cat > , cat >> and touch !!!

Hi Can anybody tell the difference between Difference between cat , cat > , cat >> and touch command in UNIX? Thanks (6 Replies)
Discussion started by: skyineyes
6 Replies

5. UNIX for Advanced & Expert Users

cat command

Dear All I have two text files File1.txt and File2.txt . I am concatenating the two files and making it as single file Cat_File.txt. Now i need to keep joined file in two different path. that is I need to use cat command only once ,but store joined file in two different locations. Since... (3 Replies)
Discussion started by: tkbharani
3 Replies

6. 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

7. UNIX for Advanced & Expert Users

cat command

I believe I used the cat command to append a file beside another file (instead of below it) but I did not document it any where and I can't remember exactly how I did it. Has anyone else done this? I have tried all the cat options individually with no luck. It may be a combination of options. ... (2 Replies)
Discussion started by: nickg
2 Replies

8. Shell Programming and Scripting

Cat command help

I want to concatenate 100 files to one file and append file name in each record to find out which file it came from for a in $(<shal_group) do cat $a >> bigoutput.group The above code put all files in one file but i want file name appended to each file Record should be like this... (3 Replies)
Discussion started by: pinnacle
3 Replies

9. Homework & Coursework Questions

Need some help on using cat command

I have a file "sample.txt" with the content as below: Hi This is a Sample Text. I need a single command using cat which serve the following purpose. 1.display the contents of sample.txt 2.append some text to it 3. and then exit But, all should be served by a sinle... (1 Reply)
Discussion started by: ashok.g
1 Replies

10. AIX

cat command

Hi. How can i write a command on AIX like the one i did at linux that find string in a file and show me that string, and return 3 lines before and 4 lines after that string. my linux command is: /bin/cat <filename> | tail -150 | grep -B2 -A8 "<string to look for>" Example: /bin/cat ... (10 Replies)
Discussion started by: yechi_r
10 Replies
cat(1)								   User Commands							    cat(1)

NAME
cat - concatenate and display files SYNOPSIS
cat [-nbsuvet] [file...] DESCRIPTION
The cat utility reads each file in sequence and writes it on the standard output. Thus: example% cat file prints file on your terminal, and: example% cat file1 file2 >file3 concatenates file1 and file2, and writes the results in file3. If no input file is given, cat reads from the standard input file. OPTIONS
The following options are supported: -n Precede each line output with its line number. -b Number the lines, as -n, but omit the line numbers from blank lines. -u The output is not buffered. (The default is buffered output.) -s cat is silent about non-existent files. -v Non-printing characters (with the exception of tabs, new-lines and form-feeds) are printed visibly. ASCII control characters (octal 000 - 037) are printed as ^n, where n is the corresponding ASCII character in the range octal 100 - 137 (@, A, B, C, . . ., X, Y, Z, [, , ], ^, and _); the DEL character (octal 0177) is printed ^?. Other non-printable characters are printed as M-x, where x is the ASCII character specified by the low-order seven bits. When used with the -v option, the following options may be used: -e A $ character will be printed at the end of each line (prior to the new-line). -t Tabs will be printed as ^I's and formfeeds to be printed as ^L's. The -e and -t options are ignored if the -v option is not specified. OPERANDS
The following operand is supported: file A path name of an input file. If no file is specified, the standard input is used. If file is `-', cat will read from the standard input at that point in the sequence. cat will not close and reopen standard input when it is referenced in this way, but will accept multiple occurrences of `-' as file. USAGE
See largefile(5) for the description of the behavior of cat when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). EXAMPLES
Example 1: Concatenating a file The following command: example% cat myfile writes the contents of the file myfile to standard output. Example 2: Concatenating two files into one The following command: example% cat doc1 doc2 > doc.all concatenates the files doc1 and doc2 and writes the result to doc.all. Example 3: Concatenating two arbitrary pieces of input with a single invocation The command: example% cat start - middle - end > file when standard input is a terminal, gets two arbitrary pieces of input from the terminal with a single invocation of cat. Note, however, that if standard input is a regular file, this would be equivalent to the command: cat start - middle /dev/null end > file because the entire contents of the file would be consumed by cat the first time `-' was used as a file operand and an end-of-file condition would be detected immediately when `-' was referenced the second time. ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of cat: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 All input files were output successfully. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
touch(1), attributes(5), environ(5), largefile(5), standards(5) NOTES
Redirecting the output of cat onto one of the files being read will cause the loss of the data originally in the file being read. For exam- ple, example% cat filename1 filename2 >filename1 causes the original data in filename1 to be lost. SunOS 5.10 1 Feb 1995 cat(1)
All times are GMT -4. The time now is 12:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy