We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [cat]

cat : A Linux Command Line tool , is used to view the contents of a .txt file.

Filter by
Sorted by
Tagged with
0
votes
0answers
27 views

Using a cat * > function for files in a specific category

I'm trying to cat all .json files in the D:\Dumps\Dumps2019-10-17 directory and for the life of me I can't figure it out. Please help. Edit: I'm using the obunto terminal on a windows 10 os.
2
votes
3answers
100 views

Bash, command to variable (cat), output is on 1 line, <pre> is not working

Issue In bash, output is on 1 line from command, so <pre> is not working in html tag. log=`cat ../local/log/$(ls -t ../local/log | head -1 )` echo ' <tr style="background-color: rgb(250,...
45
votes
9answers
35k views

Can `cat` show files using code markup in colors?

Sometimes I quickly want to view the contents of a file from the command line. For this I of course use cat, but it is often source files in Python, Java or simple HTML. For these files it would be ...
2
votes
1answer
62 views

Program for Ubuntu to detect cat-like typing?

A feline hacker has invaded my home. She frequently crawls across and sits on the keyboard, causing all sorts of mayhem. I have gotten into the habit of locking my computer when I step away for a ...
3
votes
3answers
4k views

What is the output of `cat image.png`?

What does the output mean when you do cat image.png? Is this what the image actually is made of? Does it matter what file extension the image has?
3
votes
2answers
4k views

What is the correct output of cat /etc/apt/sources.list?

I have Ubuntu 12.04 LTS. I need the correct output because I edited it because it wasn't working but it has only made it worse.
1
vote
3answers
123 views

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 /...
1
vote
4answers
1k views

How to display line numbers with pygmentize

I often use the command pygmentize filename.py to show color source files with code formatting. This works like a charm. I now also want to show line numbers like cat -n filename.py does. I read ...
0
votes
1answer
18 views

Average of CPU and memory use of ALL process that appear during some time interval

I know some ways that I can see the average of CPU and memory use for one process, but I never saw a way to see the average of all process that appeared during some time. The goal is, for example, to ...
1
vote
0answers
41 views

How to change the description of a catkin package?

What command should I use to change the description (line 5) cat package.xml<?xml version="1.0"?> <package format="2"> <name>beginner_tutorials</name> <version>0.0.0&...
3
votes
1answer
134 views

cat | dd inconsistent behavior

From a given a file, I have a requirement to create a copy that is padded with zeros to a specific size. If you create a file with the following. echo test >testfile The output of the following ...
1
vote
1answer
62 views

Use syntax highlighting for cat .gitignore [duplicate]

Is it possible to get syntax highlighting for .gitignore files when using cat? Update: Tried sudo apt-get install python-pygments as suggested by @rovo but when using comments in the .gitignore it ...
0
votes
1answer
364 views

Why I can't read file?

Please look at output: deploy@li445-201:~$ sudo ls -al /var/log/nginx/ total 152 drw-rw-r-- 2 root adm 4096 Mar 26 16:08 . drwxrwxr-x 14 root syslog 4096 Mar 26 06:25 .. -rw-r--r-- 1 ...
0
votes
0answers
77 views

Cat and awk Commands

What does these commands mean in linux? GBPUSD30MIN and USDJPY30MIN are text files with data having 4 columns and 1000 rows. cat GBPUSD30MIN | awk '{ print NF }' | uniq -c awk '{ print $4}' ...
1
vote
1answer
130 views

Converting a linux alias to a desktop launcher [duplicate]

I would like to know how to convert the following simple alias to a desktop launcher: cat ~/info1.txt
3
votes
1answer
747 views

How to bulk extract bitrate data from videos and output them in a text file?

I have several videos in a folder; ~/Downloads/movie1.mkv ~/Downloads/movie2.mkv ~/Downloads/movie3.mkv I would like to extract the bitrate for each file, and output the data into a single text file,...
1
vote
2answers
45 views

How to take value as value without considering it as string when we do cat and grep

I have created the utility that need to be run in all the system without any error by creating the required environment. When ever I run the following command it will take the path value from a config ...
0
votes
1answer
18 views

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 ...
0
votes
0answers
20 views

using find and cat command for merging text files orderly [duplicate]

I have a main directory and its sub-directories as; main_directory == main_directory 0001 0102 0203 ... == first order sub_directories 001 002 003 ... == second order sub_directories I use below ...
0
votes
0answers
83 views

Data loss over ttyACM* in Ubuntu 14.04 whereas success on Ubuntu 16.04 when “cat” command is used

I have a development board which will have 3 ACM interfaces when connected to Ubuntu host and i want to transfer data from Host to Device over ttyACM3. I have followed the following procedure for ...
1
vote
1answer
407 views

How do I edit a file in /proc that can be viewed with cat, but is not editable by mousepad and abiword?

As the question says, I need to edit my /proc/acpi/wakeup file, but when I open it with any text editor, it shows blank file. cat command, on the other hand, displays correct file contents in terminal....
0
votes
1answer
502 views

Script with commands split & cat [duplicate]

I want to split an image.jpg into parts and merge it again. I used the following commands: split -b 1440 image.jpg # It divides it into 6 parts. cat xaa.jpg xab.jpg xac.jpg xad.jpg xae.jpg xaf.jpg &...
0
votes
1answer
791 views

Cat VS vim/nano etc

When I open files in nano/vim I see characters which are not-visible using cat command in terminal. I want to proceed only with output of cat command. How to do that?
0
votes
0answers
109 views

Is there any way to get my scrollback history of terminal?

Is there any way to get my scrollback history of the terminal (not only a history of the terminal but also the file's data that I viewed in terminal using CAT command)?? I want to get the file data ...
-1
votes
2answers
140 views

Joining streams

You normally can pipeline the operations a | b | c where b takes input from a and sends it to c. It has only one input, generated by a. But what if I want to replace a header in file b. I therefore ...
0
votes
0answers
100 views

Echo and Cat output problem

I'm trying to run this script: #!/bin/bash for file in /home/dima/Downloads/dir/* do if [ -f "$file" ] then echo "SSS::################====================#####################" >> ...
0
votes
0answers
450 views

“cat *” (read all output) Crashes Terminal and Gedit

This command: cat * > cat_all.txt successfully results in the file cat_all.txt, as expected. However, the text file will not open in Gedit. The behavior is mostly freezing, screen-darkening, ...
13
votes
4answers
58k views

What is 'cat' used for?

I've seen the cat command come up in some online stuff and I was curious as to what cat did and what it's for in the context of someone who is just doing some simple command line stuff.
2
votes
1answer
11k views

Can the cat command edit a text file as well as read it? [duplicate]

I am trying to learn all I can about the cat command. I am going to be using it for its light weight performance and its ability to work in nothing but a command line. I know it can create a text ...
4
votes
1answer
3k views

How to unzip only the first few lines of a zip archive?

I have a zipped text file a.zip I want to read the first 10 lines of it. Is it possible to do that without unzipping the whole file?
-1
votes
2answers
126 views

What is the output of running cat swapfile? [duplicate]

Why when I run sudo cat swapfile I get a bunch of unknown characters. What do these characters mean? Plus my keyboard then types these unknown characters. As a side note this is an active swap file. A ...
11
votes
4answers
17k views

Appending a line to a file in the cat command?

I can do cat file.txt to get the contents of a file but I also want to tack on a final line of my own choosing. I tried piping (cat file.txt ; echo "My final line") | but only the final line is ...
17
votes
2answers
5k views

How to use `cat` to see the top of a very long file?

I'd like to know how to cat my-verylong-file and show it from the top instead of the end. Like the man command does.
1
vote
3answers
353 views

Parameters of the 'cat' command [closed]

cat -b test1.txt This command is meant to skip blank lines and number the rest. cat -n test1.txt This command numbers lines no matter what. I tried both of them. One on a file with only spaces ...
0
votes
3answers
2k views

Giving cat output to rm

I have file names in a file which I need to delete in a different directory. Let's say I have x and y files in dir a. How do I delete it using cat? I tried, rm -f a/{`cat a.txt`} a.txt has ...
0
votes
1answer
344 views

Ubuntu 16.04 doesn't recognise Cat B25 phone external drive

Ubuntu 16.04, working on a Acer Aspire V5 laptop, can not recognise a CAT B25 phone plugged in through USB port. I already checked that a computer with Mac OS can absolutely recognise it (both phone ...
0
votes
1answer
237 views

how is the concatenate dog utility installed?

Where is the repo to install dog? To get the command on Ubuntu you can just open a terminal and type: sudo apt-get install dog After the installation you can retrieve all the information ...
2
votes
1answer
21k views

How to use the cat command to find a specific word in a textfile [closed]

I did some research but I was unable to find anything to help, I need to find the word "war" in a text file, I know that I can use the cat command, but I need to modify it somehow, can someone help?
0
votes
0answers
75 views

Use pipes in the terminal [duplicate]

I have a user defined latex .sty file called mathpkgs.sty located in ~/texmf/tex/latex/local/. When I am typing up some articles in a diffferent directory, occasionally I need to view the content of ...
0
votes
2answers
1k views

How to pipe a text file containing mongod arguments to mongod command

So usually I start a mongod process with 2 arguments like this ~$ mongod --dbpath /media/nhuyvan1106/0CB6-189A/linux/mongodb/data --logpath /media/nhuyvan1106/0CB6-189A/linux/mongodb. But I don't ...
1
vote
1answer
530 views

DD vs cat for forensic works (carving in USB)

I'm using the foremost,photorec and other tools for recovering data. What is the best way for cloning the USD or HDD for recovery files? Which one should I use dd or cat or ddrescue? If you ...
3
votes
4answers
44k views

How does one read the contents of a text file located on the desktop using the terminal? [closed]

My goal is to open and the read the contents of a file that is located on my desktop using only the terminal to do so. My file has a space (" ") in its name, this has become troublesome because, cat ...
5
votes
5answers
5k views

Numbering paragraphs with the 'cat' command

I'm currently trying to find a way to use the cat command to show a text file as automatically numbered paragraphs for a project I'm doing, but I haven't been able to find a single command. Example: ...
0
votes
0answers
368 views

Want to save pulseaudio output as wav or mp3

Recently I have discovered cat file.bmp | padsp tee | aplay But I dont know, how to save the output of this command as audio file. If it would help, I have sox and lame software(I dont know how to ...
10
votes
3answers
2k views

cat command doesn't show the lines of the text [duplicate]

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

Redirect command and output to a file [duplicate]

Commands executed: cat a1.txt | grep a | wc -l >> a.txt cat b.txt | grep a | wc -l >> a.txt cat c.txt | grep a | wc -l >> a.txt I want count and the command to append ...
1
vote
2answers
3k views

copy text from file to another

I've been trying to copy the entire text of a file to another The command that I've been using is: echo $(cat file1) > file2 file1 text text in other line more text in other line But my result ...
3
votes
1answer
134 views

Bash with cat for automatic merging pair of files

I have a list of files starting with L- and a folder called L with inside files with the same name, for instance L-some and L/L-some. For each file L- I want to merge append its content into L/L-. I ...
9
votes
3answers
13k views

Difference between cat and sudo cat? [duplicate]

Can you tell me what the difference is between cat and sudo cat? All I know so far is that cat is used for displaying contents of file and concatenation.
-1
votes
2answers
631 views

bash: Is there any way of printing two files with a single command?

I was trying to print two files with a single command. I have two files: file1 and file2. I used cat file1 file2 > together to combine these two and get a new file together. When I cat together, ...