Questions tagged [cat]

cat is a command-line utility used to concatenate or copy the contents to standard output from a file or standard input (if no file name is passed).

cat is a command-line utility provided by GNU Coreutils which can be used to concatenate the content to standard output from a file or standard input (if no file name is passed).

To print the content of a file (let's say, ubuntu.txt), use:

cat ubuntu.txt

Details about the options/flags for cat can be found in the manpage.

On systems like MS-DOS that distinguish between text and binary files, cat normally reads and writes in binary mode. However, cat reads in text mode if one of the options -bensAE is used or if cat is reading from standard input and standard input is a terminal. Similarly, cat writes in text mode if one of the options -bensAE is used or if standard output is a terminal.[source]

119 questions
10
votes
3 answers

cat command doesn't show the lines of the text

i am trying to read an odt file from terminal. When i type cat myfile.odt it shows me an image like this
Angelos G
  • 109
0
votes
1 answer

how would you store a variables

how would you store a file using a cat command in a file, say $ENTRY "Input Text $ENTRY cat > $ENTRY /home/me/input_text
thatguy
  • 33
0
votes
1 answer

Concatenate table with a specific order

I would like to concatenate the following table: A B C D E ... I am currently using: find "PATH" name "*.txt" -exec cat {} + >> "PATH/output.txt" My problem is that this command concatenate from A to X; indeed I would like to concatenate from X to…
steve
  • 331
0
votes
0 answers

cat Input/output error when copying ROM file

I was following this guide on how to do single gpu passthrough, I reached the vBIOS Patching section and ran this code: echo 1 | sudo tee /sys/bus/pci/devices/0000:01:00.0/rom sudo cat /sys/bus/pci/devices/0000:01:00.0/rom >…
omar
  • 101
  • 1
0
votes
1 answer

Receiving Permission denied when trying to use cat command to create a file

I am working with Ubuntu version 18.04.4 LTS. I tried to create a file using the following command: sudo cat > filename.yaml and received a "Permission denied error" I can create the file using the VIM editor and sudo. Please advise.
rcaaron
  • 1
  • 1
0
votes
1 answer

How to output a file from line x to another

How can I output the projects.txt contents to another file named newProjects.txt starting from line 4 for example.
Ali Kleit
  • 105
0
votes
3 answers

Cat command with variable in file name not working

I want to cat or read the contents of file giving absolute path that contains a variable but its not working.. None of the below commands are working. ($line here is the name of file) content=`(cat…
0
votes
1 answer

Concatenate Files with a certain word?

I've been using the cat command to concatenate files. To expedite the process is there a way to cat files that have a certain word in middle of the file name. I know how to use the asterisk to capture a certain word in the beginning or the end but…
-4
votes
1 answer

Difference between "cat" command arguments "-b" and "-n"

I am bit confuse about the command cat filename.txt -b and cat filename.txt -n They show the same output to the screen .Then what is the difference between them?