How to call VS Code Editor from terminal / command line

To open a file or directory use the command: code /path/to/file/or/directory/you/want/to/open For macOS users, it needs to be installed manually: Launch VS Code. Command + Shift + P to open the Command Palette. Type shell command, to find the Shell Command: Install ‘code’ command in PATH and select to install it. Restart your terminal.

How do I install cygwin components from the command line?

Cygwin’s setup accepts command-line arguments to install packages from the command-line. e.g. setup-x86.exe -q -P packagename1,packagename2 to install packages without any GUI interaction (‘unattended setup mode’). (Note that you need to use setup-x86.exe or setup-x86_64.exe as appropriate.) See https://cygwin.com/packages/ for the package list.

How to loop through files matching wildcard in batch file

Assuming you have two programs that process the two files, process_in.exe and process_out.exe: for %%f in (*.in) do ( echo %%~nf process_in “%%~nf.in” process_out “%%~nf.out” ) %%~nf is a substitution modifier, that expands %f to a file name only. See other modifiers in https://technet.microsoft.com/en-us/library/bb490909.aspx (midway down the page) or just in the next answer.

Command Line Tool – Error – xcrun: error: unable to find utility “xcodebuild”, not a developer tool or in PATH

I solved that problem by setting the Command Line Tools in Xcode. Go to: Xcode > Preferences > Locations And select the command line tool from the dropdown. If you have only one version of Xcode installed, there should be only one option. If you have several versions of Xcode, then you must choose the … Read more

What does cmd /C mean? [closed]

The part you should be interested in is the /? part, which should solve most other questions you have with the tool. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp. C:\>cmd /? Starts a new instance of the Windows XP command interpreter CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | … Read more

How can I read command line parameters from an R script?

Dirk’s answer here is everything you need. Here’s a minimal reproducible example. I made two files: exmpl.bat and exmpl.R. exmpl.bat: set R_Script=”C:\Program Files\R-3.0.2\bin\RScript.exe” %R_Script% exmpl.R 2010-01-28 example 100 > exmpl.batch 2>&1 Alternatively, using Rterm.exe: set R_TERM=”C:\Program Files\R-3.0.2\bin\i386\Rterm.exe” %R_TERM% –no-restore –no-save –args 2010-01-28 example 100 < exmpl.R > exmpl.batch 2>&1 exmpl.R: options(echo=TRUE) # if you want … Read more

How to use sed to replace only the first occurrence in a file?

A sed script that will only replace the first occurrence of “Apple” by “Banana” Example Input: Output: Apple Banana Apple Apple Orange Orange Apple Apple This is the simple script: Editor’s note: works with GNU sed only. sed ‘0,/Apple/{s/Apple/Banana/}’ input_filename The first two parameters 0 and /Apple/ are the range specifier. The s/Apple/Banana/ is what … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)