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

Filter by
Sorted by
Tagged with
1 vote
1 answer
158 views

How to iterate eml file with mailutils?

How would a directory of .eml files be iterated? nicholas@mordor:~$ nicholas@mordor:~$ mail -f foomail/foo.eml "/home/nicholas/foomail/foo.eml": 0 messages nicholas@mordor:~$ Whereas, I'...
Nicholas Saunders's user avatar
0 votes
0 answers
385 views

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/...
omar's user avatar
  • 101
0 votes
1 answer
51 views

Symbolic link to read a syfs directly

Is there a way to read a sysfs using a symbolic link if I want to read a sysfs, for example, cat /sys/bus/usb/gps/time we usually type the cat followed by sysfs path and then enter Is there a way to ...
DEV's user avatar
  • 68
4 votes
2 answers
2k views

How to create an alias for a "cat" file usable in a path

I have two huge files (150G each) and I need to use a tool for which I should supply them as a single file (since the tool only accepts one file). However, I do not want to merge these files for ...
ashenflower's user avatar
8 votes
4 answers
5k views

How to replace cat with bat system-wide Ubuntu 22.04

I am using Ubuntu 22.04 with bash, pretty vanilla, and have added alias cat="batcat" to ~/.bashrc. The program batcat or bat being referred to can be found here: https://github.com/sharkdp/...
WhiteBerry's user avatar
0 votes
1 answer
338 views

Uniq --count doesn't work properly

I'm trying to solve a problem with counting IPs using uniq -c. My file after using file looks like this : 69.246.75.77 7.44.104.171 195.82.180.9 195.82.180.9 61.115.160.23 56.240.142.58 195.82.180.9 ...
Learningmachine's user avatar
0 votes
1 answer
1k views

"cat ls" messes up my terminal's characters [duplicate]

when I go to my /bin directory and do cat ls it messes up my whole terminal's characters, even my input gets messed up and I have no option but to restart the terminal. I was just watching a toturial ...
JohnDoeVI's user avatar
0 votes
2 answers
390 views

Bash: variable is not full read in `for` because line contains blank spaces

In for command, variable is not fully saved because of blank spaces. Source file in.csv: VPricingCurrency,Currency,Transactions,VPricingCurrency,Deal,VPricingCurrency CustomerPriceGroup,Customer Price ...
genderbee's user avatar
  • 850
0 votes
1 answer
4k views

cat command not found even tough package is installed

I've been running Ubuntu 20.04.3 in a VM for a few weeks without any major problems but when i tried to use cat today it only said: Command 'cat' not found, but can be installed with: sudo apt ...
teddy's user avatar
  • 11
0 votes
3 answers
6k views

How can I disable echo in terminal

This might seem simple but sometimes I need terminal to not echo anything , whether for a specific command or all commands. in windows I could simply do echo off I tend to make files with cat command ...
YoloWex's user avatar
  • 312
0 votes
1 answer
932 views

cat : Do not read stdin if no input file is given on the command line

I have a script that concatenates files with cat. It contains roughly the following line that hangs the script in reading the standard input if the directory contains no files: cat /path/to/dir/* > ...
Serge Rogatch's user avatar
0 votes
1 answer
379 views

How to merge many files together? [duplicate]

I have around 58,000 txt files that have the prefix ppdb- in a directory. I want to merge all of them into one file. Wgen I try to merge them using cat ppdb-* >> out.txt it gives me an error ...
Rumesh Madhusanka's user avatar
1 vote
1 answer
4k views

Unable to read from serial port on command line

I tried reading from /dev/ttyS0 on 1 terminal as root with cat: cat < /dev/ttyS0 and sending message to the serial port from another terminal as root with echo: echo -ne "hello" > /...
ablan's user avatar
  • 195
2 votes
3 answers
2k views

How to redirect the output of 'cat' into a different folder?

I have a Python script, EulerianCycle.py, and an input file, euleriancycle.txt. I am able to get the correct results by doing py EulerianCycle euleriancycle.txt > cat euleriancycleout.txt into the ...
trinity's user avatar
  • 23
0 votes
1 answer
548 views

Why use tee with wget? Isn't it superfluous?

So I came across this code for downloading youtube-dl using wget which pipes into tee here: How can I update youtube-dl? The code being: wget -O - https://yt-dl.org/downloads/latest/youtube-dl | sudo ...
mysterium's user avatar
0 votes
2 answers
147 views

How to copy files into a new file

How to copy files from one file to another file that has contents I want to keep? In other words, I want the contents of file1 to go in file2 but the info in file1 to be added to the existing stuff in ...
Elon_s_mom's user avatar
1 vote
1 answer
204 views

Where is the tab completion "compspec" for commands like cat and ls defined?

Some pretext: I'm installing Jenkins locally, and following the installation, I'm asked to produce a password from a text file in this folder: /var/lib/jenkins/secrets/ However, after entering cat /...
DVukajlo's user avatar
0 votes
2 answers
2k views

how to view the content of /dev/sda file?

I formatted a 160GB drive using: dd if=/dev/zeros of=/dev/sda bs=512 I expect the entire drive is filled with zeros, but how do I check it? I thought I could just cat /dev/sda and see all zeros, ...
user97662's user avatar
  • 157
0 votes
1 answer
59 views

How to fix problem with half outputs results

for f in 20*.txt do sed -n '1p' "$f" | cut -d' ' -f3 >> displayStudentInfo.txt head -3 "$f" | tail -2 >> displayStudentInfo.txt done cat ...
FancyName112's user avatar
3 votes
1 answer
351 views

How to “cat” or “less” a libreoffice impress .odp file?

Is there any way to cat or less a .odp file just like we have for .odt files as mentioned here
Suraj Singh's user avatar
1 vote
1 answer
10k views

Merge multiple zip files in to one

I have over a hundred .zip files that I need to be merged into one. I have found that a possibility is to use: cat "filename1.zip" "filename2.zip" "filenamen.zip">&...
T. van der Veen's user avatar
0 votes
1 answer
849 views

SETUID not working in my laptop [duplicate]

Suppose i have two files total 8 -r-sr-xr-x 1 root root 34 Oct 8 17:36 openroot.sh -rwx------ 1 root root 38 Oct 8 17:34 root.txt Content in root.txt : Hi I am root file. Content in openroot.sh : #...
Zozzizzez's user avatar
  • 465
0 votes
1 answer
375 views

How to cat and print formatted more than one file?

I have a device in /sys/bus/iio/devices/iio:device0/, and device has lots of files such as in_current0_raw, in_current0_mean_raw, in_current0_scale ... I want to print them periodically in terminal. ...
Mübin Icyer's user avatar
1 vote
2 answers
6k views

How do I search in multiple files with "cat"? [duplicate]

What I want is to find within a directory all the files containing a match and when it finds the match it shows the file where that match was found. example cat * | grep password: Here it will show ...
Rodolfo's user avatar
  • 11
0 votes
1 answer
2k views

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

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 ...
rcaaron's user avatar
0 votes
1 answer
3k views

How to copy the content of a file using command line

My question is may be too simple or hard Is there any way I can copy the content of a file using the command line the same as you do with right click + copy? After that I want to paste what I copied ...
Reda's user avatar
  • 111
0 votes
0 answers
59 views

How to save text file after use cat -n command [duplicate]

I am created file use "cat > sample.txt". after i used "cat -b sample.txt". how to save it. ctrl+x or F2 is not working.cat -b command
TipVisor's user avatar
  • 103
-1 votes
1 answer
382 views

Cat redirection not working

I used a command set -r noclobber Now I'm not able to reset. cat >1.txt shows Restricted: can't redirect output
Subir Makur's user avatar
0 votes
1 answer
242 views

Two different terminal line commands - the same result

What is the difference between less file-name and cat file-name | less For example: less .bashrc and cat .bashrc | less output the same result.
BlueSkies's user avatar
  • 2,145
0 votes
1 answer
184 views

Search number list in multiple files and print

I am trying to find a few numbers listed in a file and their next +16 rows, from a bunch of files in a folder. Print or store output in a file, but the command is not displaying any output for i in ...
Ankur Bohra's user avatar
0 votes
1 answer
42 views

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's user avatar
  • 105
30 votes
5 answers
15k views

What is the difference between "cat < filename" and "cat filename"?

The simplest way to display file contents is using the cat command: cat file.txt I can get the same result using input redirection: cat < file.txt Then, what is the difference between them?
BlueSkies's user avatar
  • 2,145
2 votes
3 answers
3k 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,...
genderbee's user avatar
  • 850
3 votes
1 answer
525 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 ...
Reinstate Monica's user avatar
0 votes
3 answers
8k 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 /...
HEENA SINGHAL's user avatar
0 votes
1 answer
46 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 ...
André Carvalho's user avatar
0 votes
1 answer
484 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&...
Dr Drill's user avatar
4 votes
2 answers
409 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 ...
John JJ's user avatar
  • 478
1 vote
1 answer
201 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 ...
Alexander Zeitler's user avatar
0 votes
1 answer
10k views

Why I can't read file? [duplicate]

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 ...
mystdeim's user avatar
  • 429
0 votes
0 answers
370 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}' ...
viswaja katragadda's user avatar
1 vote
1 answer
876 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
user93809's user avatar
3 votes
1 answer
4k 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,...
Martin JS's user avatar
1 vote
2 answers
147 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 ...
Shreyas Kanna's user avatar
0 votes
1 answer
39 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 ...
Christa Frodella's user avatar
0 votes
0 answers
27 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 ...
deepblue_86's user avatar
  • 1,194
0 votes
0 answers
217 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 ...
Shivaprasad A Prabhu's user avatar
0 votes
1 answer
1k 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 &...
thmk's user avatar
  • 1
0 votes
1 answer
2k 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?
Josef Klimuk's user avatar
  • 1,586
0 votes
0 answers
821 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 ...
Doraemon's user avatar