Bash - cat command and errors

0 votes

I was trying bash shell redirection. I have a directory where there is just one file - a.txt

more a.txt
HELLO

If I type cat < a.txt b.txt , I get

cat: b.txt: No such file or directory

If I type

cat  < a.txt   b.txt a.txt

I get

cat: b.txt: No such file or directory
HELLO

Why am I not seeing HELLO when I try cat < a.txt b.txt? I tried different combinations - typing a.txt multiple times before/after b.txt and see a pattern, but not able to figure out why.

cat  <   a.txt a.txt b.txt  
HELLO
cat: b.txt: No such file or directory
Jun 21, 2022 in Linux Administration by Korak
• 5,820 points
857 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Linux Administration

0 votes
0 answers

Send private message to Discord user using bash and linux AT command

I'm running a Discord bot written in ...READ MORE

Apr 25, 2022 in Linux Administration by Edureka
• 13,690 points
1,275 views
+1 vote
3 answers
0 votes
1 answer

setting a variable output from a bash command

You can use $(command), which in my ...READ MORE

answered Feb 15, 2019 in Linux Administration by DareDev
• 6,890 points
2,542 views
0 votes
1 answer

redirecting stdout and stderr to file using bash

cmd >>file.txt 2>&1 Bash always executes and redirects ...READ MORE

answered Mar 19, 2019 in Linux Administration by ajs3033
• 7,300 points
22,362 views
0 votes
1 answer

How to extract file base name without path and extension in bash?

You don't actually have to call the ...READ MORE

answered May 31, 2019 in Linux Administration by Shubham
• 13,490 points
5,925 views
0 votes
1 answer

copy and create destination directory using bash

mkdir -p "$d" && cp file "$d" try ...READ MORE

answered Jul 16, 2019 in Linux Administration by Upasana
• 8,620 points
913 views
0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24, 2020 in Linux Administration by MD
• 95,460 points
47,554 views
0 votes
1 answer

What is the linux command to find Memory and CPU usage in percent for last 30 days?

Try the following: Cat proc/meminfo top top -i less /proc/memin ...READ MORE

answered Oct 14, 2020 in Linux Administration by Kim
2,518 views
0 votes
0 answers

What exactly does the Unix `bash` command do when run without options?

When you type bash into the terminal ...READ MORE

Apr 14, 2022 in Linux Administration by Soham
• 9,710 points
435 views
0 votes
0 answers

What is the difference between ''find .'' and ''find /'' on linux command

I am solving overthewire bandit. I looked ...READ MORE

Apr 20, 2022 in Linux Administration by Edureka
• 13,690 points
441 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP