Hot answers tagged

6

You installed cygwin, so you can just use its shell for maximum command support : "C:\Program Files\Cygwin\cygwin.bat this will give you a bash shell Then you can change directoty to go to the images location. Suppose your image location is "D:\Your Name\Images", to go there type cd "/cygdrive/d/Your Name/Images" and then call your command using the bash ...


5

There is no traceroute in the Cygwin packages, because tracert is always available on Windows. See https://cygwin.com/ml/cygwin/2005-12/msg00443.html for a thread briefly discussing this. You can try compiling a Unix-style traceroute from source usign Cygwin. If you want to compare Windows-style tracert to Unix-style traceroute though, I'd recommend running ...


5

In cygwin its not possible to change group permissions, until the group is Users or Root. Refer http://stackoverflow.com/questions/17091972/chmod-cannot-change-group-permission-on-cygwin So you wont be able to change the group permission until you change var's group owner to Users So the best solution is: chown :Users /var chmod 757 /var chmod ug-s /var ...


5

Poking around with various inputs, I felt grep did its own magic for line-endings: $ printf "foo\rbar\n" | grep -oz $'\r' | od -c 0000000 \r \n 0000002 $ printf "foo\rbar\r\n" | grep -oz $'\r' | od -c 0000000 $ printf "foo\rbar\r" | grep -oz $'\r' | od -c 0000000 \r \n \r \n 0000004 (The -z was my lame attempt to make grep match everything.) And so ...


4

Input files: yahoo.net.txt gougle.com.txt reddit.com.txt Contents of yahoo.net.txt: user1-yaho0 pas,, Contents of gougle.com.txt: user1-google pas"wor,d Contents of reddit.com.txt: user1-reddit pas\wor\d With this input, the following quick and dirty script does the job: #!/bin/bash echo "\"Account\",\"Login Name\",\"Password\",\"Web ...


4

There are at least 2 mechanisms readily available in Linux (but probably not in cygwin). There is the fuse filesystem, see man fuse, which allows you to implement a filesystem in user-space. For example, curlftpfs (see its man page) converts file accesses into curl ftp calls. Then there is the fanotify system call, which allows you to intercept calls made ...


3

Assuming you believe the host really did change its host key you can delete the old entry. Since this one tells you the old entry is on line 2 you can do sed -i -e '2d' ~/.ssh/known_hosts to remove the old entry from you known hosts file


3

I had problem with arrow keys while trying vim inside Windows 8.1 using cygwin. The issue was, printing A/B/C/D while navigating with Arrow keys in insertion mode. The solution worked for me is: cp vimrc_example.vim ~/.vimrc Basically, above command copying vimrc_example.vim file to /home/<user name>/.vimrc.


3

AFAIK, lsof has not been ported to cygwin. You could use the Microsoft netstat utility there: netstat -aon | awk '$1 == "TCP" && $4 == "LISTENING" && $2 ~ /:8000$/ {print $5}' | xargs kill


3

Ok, I figured out the solution to my own problem. By default CygwinX no longer listens for tcp connections (Cyg SSH is using Unix sockets to connect). To enable tcp connections "-listen tcp" needs to be added to the command line parameters. In my case I changed the "XWin Server" icon to read: C:\cygwin64\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; ...


3

I just ran into this problem connecting to a headless RHEL7 server. You need the xorg-x11-xauth package installed on your host in order for the DISPLAY variable to get set, and to be properly authorized. Hope I saved somebody some time.


3

This is a locale issue, compare the output of locale in your two environments, and adjust the one where you want the output changed. For example, on Linux (the sort version or OS shouldn't matter much): $ LC_ALL=C sort t -------- ----------- -=-=-=-=-=- =========== $ LC_ALL=en_US.UTF-8 sort t =========== -=-=-=-=-=- -------- -----------


2

My two cents is that you shouldn't put the file in one of the default system header paths - you should put it into whatever directory you want (/usr/local/libfoo_v1.0/include being a pretty common convention, with the library itself installed into /usr/local/libfoo_v1.0/lib) and then point the compiler to that directory with -I/usr/local/libfoo_v1.0/include ...


2

This is a temporary problem. The ssh-user-config script needs a fix. The reason your "How To Geek" tutorial doesn't match your experience is that the most recent release of Cygwin (1.7.34) did away with /etc/passwd and /etc/group in the default installation. It is possible to recreate them, as you eventually discovered, but if they aren't present, the ...


2

I found fbpanel is here /etc/X11/xinit/startxwinrc in the condition if [ -f $HOME/.startxwinrc ] then exec $HOME/.startxwinrc else ... /usr/bin/fbpanel fi so I've created $HOME/.startxwinrc with the only /usr/bin/xterm (warning: line endings must be unix single LF) it helped, no panel, only xterm window opens


2

Simple if the keyword is always in the same column, e.g. column number 2 cut -d, -f 2 file(s) | grep -c 'true' i.e. cut out column 2 (-f 2), using "," as field seperator ( -d, ), get (grep) all trues and count them (-c) more complicated, if we have to search for column "ARD" awk 'BEGIN {FS = ","} ; FNR == 1 { for ( i=1 ; i<=NF ; i++ ) { if ( ...


2

Consider this more of an expansion/enhancement to @Slyx's answer. Cygwin has a useful utility cygpath to convert Windows path to *nix-style understood within Cygwin's bash shell: $ cygpath "D:\Path\To\Images" /cygdrive/d/Path/To/Images Instead of the explicit for-loop suggested, you can also consider using find that has better support for filtering ...


2

Unix represents newlines with the character LF (line feed = \n = ^J = 10 decimal = 012 octal = 0x0a hexadecimal). Windows represents newlines with the two-character sequence CR, LF (CR = carriage return = \r = ^M = 13 decimal = 015 octal = 0x0d hexadecimal). When a Windows text file is processed by a Unix utility, each line thus ends with a spurious CR ...


2

Try: n=0; for f in *.jpg; do mv "$f" "$((++n)).jpeg.jpg"; done Or, the same thing spread out over multiple lines: n=0 for f in *.jpg do mv "$f" "$((++n)).jpeg.jpg" done How it works n=0 This initializes the variable nn. for f in *.jpg; do This starts a loop over all files in the current directory whose names end with .jpg. mv "$f" ...


2

This is nothing to do with Unix or Linux. It's entirely Win32 and Cygwin. As first discussed in the Microsoft doco for Win32 and various Win32 programmers guides almost a quarter of a century ago, the Windows NT kernel doesn't have a notion of multiple drives each with their own individual working directories. This MS-DOS paradigm is emulated in Win32 ...


2

Hi I'm one of the rmlint dev's. Unfortunately I don't think you'll be able to get rmlint running under cygwin (although happy to be proven wrong). Edit: have been proven wrong. Now have more-or-less working command-line version of rmlint under cygwin. It requires: gcc-core pkg-config libglib2.0-devel libtool and optionally: libjson-glib 1.0-devel ...


1

Upgrading cyg-get solved the problem.


1

Literally 5 seconds after I've posted the question, I found the answer. The rpmbuild command is incorrect; if I execute rpmbuild --nodeps --target=i386-linux --buildroot="$BUILDDIR" -bb $ROOTPATH/tmp.spec everything works correctly and I can install the resulting RPM on Linux.


1

Unix GUI programs display through an X server. Cygwin doesn't automatically start an X server. You need to install the packages xorg-server and xinit, and run startxwin.


1

By default, the 'top' command will display Cygwin processes by CPU usage. If you'd like to view only Windows processes, you can use the 'ps' command, and then sort your results by CPU usage: ps -W | sort -nk 3 where: -W refers to Windows processes, -n refers to a numerical sort, and -k refers to a key, in this case the 3rd column ...


1

Suppose you have 3 files: new.csv Col1,Col2,ARD,Col4 1,2,true,3 1,2,true,3 1,2,true,3 1,2,false,3 1,2,false,3 1,2,false,3 new1.csv : Col1,Col2,ARD,Col4 1,2,true,3 1,2,true,3 1,2,false,3 1,2,false,3 1,2,false,3 1,2,false,3 new2.csv: Col1,Col2,ARD,Col4 1,2,true,3 1,2,false,3 1,2,false,3 1,2,false,3 1,2,false,3 1,2,false,3 Do: awk -F',' '{print $3}' ...


1

Try putting it as -x '*AppData/*'


1

In cygwin you access drive letters by going through /cygdrive eg: sh /cygdrive/d/dev/Main/Env/tpsScripts/devenv.sh


1

BASH_VERSINFO[5]=x86_64-redhat-linux-info Output: bash: BASH_VERSINFO: readonly variable Btw. see: Hacky method to unset readonly variable with gdb


1

incron relies on inotify, which isn't emulated by Cygwin. To run on Windows it would have to be re-written using equivalent Windows functionality; see https://stackoverflow.com/questions/3517460/is-there-anything-like-inotify-on-windows for details. The answers to that question give links to various Windows tools which may provide the functionality you're ...



Only top voted, non community-wiki answers of a minimum length are eligible