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).
120
questions
1
vote
1
answer
74
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'...
-1
votes
0
answers
22
views
Linux System File functionality using sed [duplicate]
I have a file in a Linux based system, I want to get few lines from the file
Like suppose from row 20 to 30. How can I do that
I have been using cat command and then searching for the required content,...
0
votes
0
answers
235
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/...
0
votes
1
answer
38
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 ...
4
votes
2
answers
1k
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 ...
8
votes
4
answers
4k
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/...
0
votes
1
answer
261
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
...
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 ...
0
votes
2
answers
333
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 ...
0
votes
1
answer
3k
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 ...
0
votes
3
answers
5k
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 ...
0
votes
1
answer
837
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/* > ...
0
votes
1
answer
363
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 ...
1
vote
1
answer
3k
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" > /...
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 ...
0
votes
1
answer
507
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 ...
0
votes
2
answers
125
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 ...
1
vote
1
answer
192
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 /...
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, ...
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 ...
3
votes
1
answer
324
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
1
vote
1
answer
9k
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">&...
0
votes
1
answer
792
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 :
#...
0
votes
1
answer
356
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.
...
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 ...
0
votes
2
answers
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 ...
0
votes
1
answer
2k
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 ...
0
votes
0
answers
56
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
-1
votes
1
answer
371
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
0
votes
1
answer
236
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.
0
votes
1
answer
159
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 ...
0
votes
1
answer
41
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.
30
votes
5
answers
14k
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?
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,...
3
votes
1
answer
470
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 ...
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 /...
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 ...
0
votes
1
answer
472
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&...
4
votes
2
answers
399
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
1
answer
193
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
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 ...
0
votes
0
answers
356
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
1
answer
828
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
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,...
1
vote
2
answers
140
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
1
answer
38
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
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 ...
0
votes
0
answers
215
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 ...
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 &...
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?