1

When connected to our production server over ssh, sometimes when running ls inside a git repository and simultaneously looking at the output of htop I can see a process git status --porcelain --ignore appearing as a child of ls. I can spot this when the server's disk IO is saturated and the execution of ls takes long enough for one to see the short lived git command. Why is the aforementioned git command being run as a child of ls?

3

Your ls command may in fact be an alias to someting more complicated; you can try by running instead /bin/ls or \ls, you should not see the same behavior. The alias command could show you if you have an aliased ls and to what.

Also your shell prompt could be configured to run such a command: it is "common" to put various git information (state of the directory, lastest commit ID, branch name, etc.) inside one's prompt and to do that git status must be run automatically after each command invocation.

| improve this answer | |
  • 2
    in bash, type ls will show you where it's coming from - whether an executable, alias, or a shell function. – Beni Cherniavsky-Paskin Apr 23 '19 at 19:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.