Linux/CentOS bash problem

  • Thread starter r0bHadz
  • Start date
193
17
Summary
Using command ps -ly I get output of three lines
piping that output to wc -l it says that there are four lines. Why
In bash, I am writing the following:

ps - ly

this command gives me output of three lines

then I do:

ps -ly | wc -l

to read the number of lines. It says 4.

I clearly see that there are three lines. Thinking that there might be a new line possibly, I open export the command output to a file and open it in vim and no, there are just three lines.

I am wondering why the number is 4?
 
193
17
hmm wrong forum maybe this should go to programming and computer science instead? Can I get a mod to help me out

edit: actually please delete this thread I have my answer now :) thank you
 
Last edited:

Want to reply to this thread?

"Linux/CentOS bash problem" You must log in or register to reply here.

Related Threads for: Linux/CentOS bash problem

Replies
12
Views
3K
  • Posted
Replies
6
Views
2K
  • Posted
Replies
4
Views
2K
  • Posted
Replies
9
Views
2K
Replies
9
Views
2K
Replies
2
Views
604
  • Posted
Replies
1
Views
2K
  • Posted
Replies
1
Views
1K

Physics Forums Values

We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving
Top