Command HEAD in Cygwin doesn't work

985 Views Asked by At

I'm a Windows sysadmin trying to setup a Cygwin in a Windows 2016 environment. Not a Linux or developer person, but I'm open to learn.

I'm able to install Cygwin (x86/64) and most of the commands work just fine. But there is 2 commands that doesn't work: HEAD (10 first lines) and WC (word count). TAIL, CAT CLEAR, PWD are commands that work just fine. HEAD & WC doesn't show anything. An user needs those commands to be working because he's working with huge files.

I've tried Cygwin on my laptop and each command work just fine, Including HEAD & CAT.

Troubleshooting already tried:

1) Run as administrator 2) x86/x64 version = same issues 3) I've already set the PATH environment variable to F:\cygwin64

Troubleshooting that I need help in order to do it:

1) PATH: Do I need to specify the PATH of the Cygwin software to Windows OS on any other way/setting? Do I need to specify the PATH for cygwin in any cygwin config file?

2) I've tried/set the following in my Cygwin desktop shortcut "C:\cygwin64\bin\mintty /bin/bash -l" but the shell just shows for a couple of seconds then it closes.

3) Anything else where I can proceed?

Thanks a lot in advance

1

There are 1 best solutions below

1
On

Head and tail belong to the same coreutils package and require the same shared libs.

$ cygcheck -f /usr/bin/tail
coreutils-8.26-2

$ cygcheck -f /usr/bin/head
coreutils-8.26-2

$ cygcheck head
Found: E:\cygwin64\bin\head.exe
E:\cygwin64\bin\head.exe
  E:\cygwin64\bin\cygwin1.dll
    C:\Windows\system32\KERNEL32.dll
      C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
      ....
  E:\cygwin64\bin\cygintl-8.dll
    E:\cygwin64\bin\cygiconv-2.dll

$ cygcheck tail 
Found: E:\cygwin64\bin\tail.exe
E:\cygwin64\bin\tail.exe
  E:\cygwin64\bin\cygwin1.dll
    C:\Windows\system32\KERNEL32.dll
      C:\Windows\system32\API-MS-Win-Core-RtlSupport-L1-1-0.dll
      ...
  E:\cygwin64\bin\cygintl-8.dll
    E:\cygwin64\bin\cygiconv-2.dll

If one works and the other not there are 2 possible issues:
. you have screw up the installation
. something is interfering with cygwin

You should follow https://cygwin.com/problems.html and provide the cygcheck.out to the cygwin mailing list, that is more indicated that here for trobleshooting installation problem.

PS:
. the binaries in Cygwin are under "C:\cygwin64\bin"
. you can call mintty with just "-" to invoke a login shell
. You are reporting both C: and F: as disks where the installation resides