I just installed cygwin & i am unable to do basic commands in cygwing like :-

$ ls -l
total 0

$ ls | wc -l

$ ls -ld
drwxr-xr-x+ 1 Shivendra Gupta None 0 Oct 10 14:40 

closed as off-topic by EightBitTony, Jeff Schaller, Archemar, Stephen Rauch, roaima Oct 10 '17 at 16:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information." – EightBitTony, Archemar, Stephen Rauch
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    That's valid output when run in an empty directory or a directory with only hidden files. – Stéphane Chazelas Oct 10 '17 at 13:45
  • Thanks for the reply ..i can understand but i want to practice these commands & i dont know why it is empty directory.. cygwin is installed in C directory ..i am completely noob so plz elaborate if you can. – john kumar Oct 10 '17 at 13:54
  • I got this: $ pwd /home/Shivendra Gupta – john kumar Oct 10 '17 at 14:00
  • If you want to list the content of the C:\ windows directory, that's ls /cygdrive/c. If you want to see hidden files in the current directory, it's ls -lA – Stéphane Chazelas Oct 10 '17 at 14:01
  • @ Stephane Chazelas u got me ...thank you so much.. it worked ..you rocks !! – john kumar Oct 10 '17 at 14:04

There is nothing wrong per se with the output you posted.

Should you expect to see the usual . and .. entries, you have to enable hidden files display. To do so, use ls -la instead of ls -l.

If you just opened a Cygwin terminal right after installing you will see that you have several other hidden files there, such as .profile for example, as . at the beginning of a filename means "hidden".

Anyway, should you need to urgently dig into Cygwin, there's one place to go: its official documentation.

  • Thanks bro ..i get following output now $ ls -la total 25 drwxr-xr-x+ 1 Shivendra Gupta None 0 Oct 10 14:40 . drwxrwxrwt+ 1 Shivendra Gupta None 0 Oct 3 22:18 .. -rw------- 1 Shivendra Gupta None 358 Oct 10 14:40 .bash_history -rwxr-xr-x 1 Shivendra Gupta None 1494 Oct 3 22:18 .bash_profile -rwxr-xr-x 1 Shivendra Gupta None 6054 Oct 3 22:18 .bashrc -rwxr-xr-x 1 Shivendra Gupta None 1919 Oct 3 22:18 .inputrc -rwxr-xr-x 1 Shivendra Gupta None 1236 Oct 3 22:18 .profile – john kumar Oct 10 '17 at 13:56
  • @johnkumar Makes sense, you are in your home directory. – Shlublu Oct 10 '17 at 13:59
  • ..ok i got that i am in home directory but what to do next if i have to practice the basic commands of unix through cygwin – john kumar Oct 10 '17 at 14:02
  • @johnkumar This is way beyond the original question. The best is to search for some tutorials on the internet, and to have a look at the documentation I linked. – Shlublu Oct 10 '17 at 14:05
  • definitely @Shlublu – john kumar Oct 10 '17 at 14:08

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