Skip to main content

Questions tagged [cat]

cat is a standard Unix utility used for concatenating files or printing specific file on the standard output.

Filter by
Sorted by
Tagged with
0 votes
2 answers
134 views

I want to alias cat to batcat. Yet I do not want to break any script on my system that may depend on cat. How to ensure that it won't break existing scripts? I am on an Ubuntu machine on a bash ...
k0pernikus's user avatar
  • 16.7k
0 votes
1 answer
86 views

Show lines passed by here-document in the stdout: cat <<EOF foo bar baz EOF foo bar baz I want to match some string with grep via pipe: cat <<EOF foo bar baz EOF |grep 'ba' Why can't ...
showkey's user avatar
  • 601
0 votes
1 answer
203 views

I have the following line: isUbuntu=$(cat /etc/os-release | grep '^ID=ubuntu$' | wc -l) It works fine Now, through VSC and mostly with the ShellCheck extension is indicated two warnings messages as ...
Manuel Jordan's user avatar
0 votes
1 answer
55 views

I've got a bunch of text files and pdfs in a directory. If I enter evince *.pdf ..all the pdfs open up in separate windows, I do this quite often. When I enter cat *.txt ..was pleasantly surprised ...
cardamom's user avatar
  • 704
0 votes
1 answer
417 views

I'm running the following one-liner: cat input.txt | xargs -I{} bash -c './script.sh "{}"' >> output.txt The script works and does exactly what I want it to do. The only issue is that ...
dlyk1988's user avatar
  • 103
0 votes
1 answer
144 views

stdin: Generally standard input, referred to as stdin, comes from the keyboard. When you type stuff, you're typing it on stdin (a standard input terminal). A standard input device, which is usually ...
Guilherme Woolley's user avatar
2 votes
2 answers
383 views

I commonly append to text files using cat: cat >> FILE I use an alias to avoid accidentally overwriting the file (with a single >): alias a='cat >>' Enter changes the line and Ctrl + ...
user598527's user avatar
0 votes
2 answers
161 views

I have the following code that takes in a file via an arg and if none exists, take it from stdin: file= column= pattern= path= cmd="echo" while getopts "f:c:e:" opt; do ...
Mathew's user avatar
  • 243
0 votes
1 answer
478 views

man cat says: -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB I checked info cat, and it uses the same acronym: ‘-v’ ‘--show-nonprinting’ Display ...
Daniel Kaplan's user avatar
2 votes
1 answer
181 views

I have a file with a huge string without spaces in it (something like: "A":123,"B":456,"C":789...) I want to get X amount of chars before and after a specific value (like ...
Ran's user avatar
  • 125
0 votes
5 answers
608 views

Let me take you to this short trip: Open terminal. Type cat <any text file in your current working directory, containing a URL, at the beginning> | head The first 10 lines of that text file are ...
futurewave's user avatar
-1 votes
2 answers
1k views

When i use "cat /proc/uptime" i get result 10257.21 31389.01 what does this mean that my computer is slow? how to read about this more can you recommend me anything?
cahjcu2's user avatar
2 votes
1 answer
69 views

I have a directory data in which there are several fastqs like below: SRR13456784_1.fastq SRR13456784_2.fastq SRR13456784_3.fastq SRR13456785_1.fastq SRR13456785_2.fastq SRR13456785_3.fastq ...
stack_learner's user avatar
0 votes
1 answer
104 views

I have tried running the following commands: cat base64 /dev/stdin md5sum /dev/stdin tail /dev/stdin In all cases when I do: ^Z $ bg $ jobs I get the status: [1]+ Stopped instead of [1]+ Running. ...
Marinos An's user avatar
0 votes
4 answers
316 views

I am concatenating thousands of .txt files together but I want to keep the path written above the text of each .txt file so I can refer back to the directory to review files if needed. Example: file1....
linuxuser24569's user avatar
1 vote
1 answer
238 views

I have this script: while read $item; do # Some bash logic here done <<< "$({ cat /path/to/some/file; echo; })" Now I want to also use find to find the name of some directories,...
Saeed Neamati's user avatar
1 vote
0 answers
184 views

Let l have a file that contain a data like this: -ab-a--a-- 1 abcd abcd 934M Nov 2 00:14 abc_de-123.456.xyz-2022-11-02_1234567890.zip -ab-a--a-- 1 abcd abcd 45M Nov 2 01:39 abc_de-...
Bhawishya Khanal's user avatar
0 votes
3 answers
106 views

I have the file, In the file data few lines have only one word, if such a case is present i want to print following line as the present line can I get some tips for this grep -E "module" ...
Santhosh Nayak D.'s user avatar
0 votes
3 answers
826 views

I want to be able to scroll back through all of the output for each session in terminal. When using cat on large files, for example, there could be hundreds, or even thousands, of lines (I write a lot ...
Lee's user avatar
  • 135
0 votes
2 answers
112 views

This is first time that I am using Linux, and I need to understand some concepts about two commands. I would be happy if you could explain the process one by one. What does this command do? cat ../...
Daffy's user avatar
  • 1
2 votes
2 answers
3k views

Im building a script to load from a file content and then use to cat and grep in another file. The problem is that is not showing any values while executing the grep. If i do the command manually it ...
macieira's user avatar
  • 123
9 votes
2 answers
1k views

I have Afile made by the equivalent of cat a.gif b.7z > Afile. How may I split Afile into the original a.gif and b.7z files?
user536180's user avatar
3 votes
4 answers
744 views

I had 4000 text files with unique filenames in a directory. Is there any Linux command to concatenate only the 1-100 files. cat 1.txt ... 100.txt > 1.100.txt cat 101.txt ... 200.txt > 2.200.txt ....
sunnykevin's user avatar
0 votes
0 answers
303 views

In my Ubuntu 20.04.4 LTS virtual machine(in azure), I had 2 data disks (/dev/sdc & /dev/sdd) connected. I attached 2 disks to VM as per: https://docs.microsoft.com/en-us/azure/virtual-machines/...
KIRAN KUMAR B's user avatar
7 votes
2 answers
24k views

I'm used to use cat > /path/to/file << EOF when I, in a bash script, printed more than one line into a file... I was checking old code of my company and I found the cat EOT instruction ...
k.Cyborg's user avatar
  • 527

1
2 3 4 5
14