Why is the number of lines in my bash output showing as 4 instead of 3?

  • Thread starter Thread starter r0bHadz
  • Start date Start date
Click For Summary
The user executed the command "ps -ly" in bash, which produced an output of three lines. However, when piping this output to "wc -l," the line count returned was four. After checking the output in a file opened with vim, the user confirmed there were indeed only three lines. The discrepancy in line count was resolved, leading the user to request the deletion of the thread after finding an answer.
r0bHadz
Messages
194
Reaction score
17
TL;DR
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?
 
Computer science news on Phys.org
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:
After playing around a bit with making star maps, I found another video which introduced me to another trick that can be done using geometry nodes. This one involves fluids. For background, Blender has a fluid physics simulator, which, as the name suggests simulates the behavior of fluids. What this person did was to use geometry nodes to convert the fluid into a point cloud. Then he added a turbulence force field to "stir it around". He was then able to extract the velocity information...
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...
Well, the date has now passed, and Windows 10 is no longer supported. Hopefully, the readers of this forum have done one of the many ways this issue can be handled. If not, do a YouTube search and a smorgasbord of solutions will be returned. What I want to mention is that I chose to use a debloated Windows from a debloater. There are many available options, e.g., Chris Titus Utilities (I used a product called Velotic, which also features AI to prevent your computer from overheating etc...