11 Replies - 531 Views - Last Post: 30 June 2017 - 12:01 AM

#1 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

ls - taking 22 seconds

Posted 16 May 2017 - 10:22 PM

[email protected] MINGW64 ~/Desktop
$ time ls
real 0m22.266s
user 0m0.000s
sys 0m0.000s

This is using git bash. I tried reinstalling it. Sometimes it works fast other times it takes this long. What can I do to fix this or work around it. Let me know if you need more info.
Is This A Good Question/Topic? 0
  • +

Replies To: ls - taking 22 seconds

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13552
  • View blog
  • Posts: 54,075
  • Joined: 12-June 08

Re: ls - taking 22 seconds

Posted 17 May 2017 - 06:45 AM

Is it one directory or all of them?
Was This Post Helpful? 1
  • +
  • -

#3 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

Re: ls - taking 22 seconds

Posted 17 May 2017 - 07:08 AM

All of them
Was This Post Helpful? 0
  • +
  • -

#4 BetaWar  Icon User is online

  • #include "soul.h"
  • member icon

Reputation: 1489
  • View blog
  • Posts: 8,217
  • Joined: 07-September 06

Re: ls - taking 22 seconds

Posted 17 May 2017 - 07:53 AM

Are you using any special bash prompt? I have seen times where a bash prompt (such as powerline) can slow down your entire terminal.

Alternatively, have you looked through other processes either eating your memory, filesystem, or CPU alive? htop is my go-to tool there for a nice experience, but top or atop will work out too (atop giving the most information in the least user-friendly way, with top being nicer than it, but not as nice at htop).
Was This Post Helpful? 2
  • +
  • -

#5 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6558
  • View blog
  • Posts: 30,699
  • Joined: 10-May 07

Re: ls - taking 22 seconds

Posted 17 May 2017 - 12:44 PM

I 2nd top/htop, also check the output of free for memory issues.
You should also check for hard drive issues with dmesg.
Was This Post Helpful? 1
  • +
  • -

#6 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

Re: ls - taking 22 seconds

Posted 17 May 2017 - 12:51 PM

Ok thanks ill give them a try when I can.
Was This Post Helpful? 0
  • +
  • -

#7 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

Re: ls - taking 22 seconds

Posted 19 May 2017 - 10:55 PM

Posted Image
I'm not sure what I'm looking at but nothing looks unusual.
Was This Post Helpful? 0
  • +
  • -

#8 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

Re: ls - taking 22 seconds

Posted 20 May 2017 - 04:25 PM

I don't know what to do I installed Cygwin this time and the same thing
real 0m23.793s
user 0m0.015s
sys 0m0.046s
Was This Post Helpful? 0
  • +
  • -

#9 baavgai  Icon User is online

  • Dreaming Coder
  • member icon


Reputation: 6995
  • View blog
  • Posts: 14,628
  • Joined: 16-October 07

Re: ls - taking 22 seconds

Posted 21 May 2017 - 06:16 AM

What happens when you just ls? How many entries are we looking at? (ls | wc -l) Perhaps there are wonky characters slowing you down? Try throwing in a -q.

So, you reinstalled cygwin? Want to try again? I recommend Babun. It gets you all the cygwin goodness, but with helpful prepackaged defaults. It's the one I use when faced with a windows box.

As an aside, I have a win10 box where the Downloads directory has always been slow, in ls or file explorer, so I consider this a windows problem.
Was This Post Helpful? 1
  • +
  • -

#10 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

Re: ls - taking 22 seconds

Posted 21 May 2017 - 11:01 AM

Yes I reinstalled git bash, and installed cygwin by itself. (ls | wc -l) gave me just 2. It's not only the ls command but all commands take like 20 seconds. It usually takes 20 seconds the first time, and then will run smoothly for like 4 minutes after that and then a command will take 20 seconds. I installed babun but it's showing the same behavior. The first cd that I did took 20 seconds. The next like 10-20 commands worked fine, and then the next command took 20 seconds.
Was This Post Helpful? 0
  • +
  • -

#11 wtp  Icon User is offline

  • D.I.C Regular

Reputation: 26
  • View blog
  • Posts: 319
  • Joined: 08-December 11

Re: ls - taking 22 seconds

Posted 29 June 2017 - 11:08 PM

Finally figured it out. I had something bad in my PATH.
Was This Post Helpful? 0
  • +
  • -

#12 no2pencil  Icon User is offline

  • Professor Snuggly Pants
  • member icon

Reputation: 6558
  • View blog
  • Posts: 30,699
  • Joined: 10-May 07

Re: ls - taking 22 seconds

Posted 30 June 2017 - 12:01 AM

Thank you for following up! Glad you got it sorted.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1