Tag Info

New answers tagged

0

When key list is fixed, it can be transposed by the following command: $ pr -mt <(grep key1 in.txt | cut -f2 -d:) <(grep key2 in.txt | cut -f2 -d:) <(grep key3 in.txt | cut -f2 -d:) | sort -k1 1 2 3 4 5 6


1

You could try: { foo; echo contents not stored in file; } | bar or (almost the same, but starts a subshell): ( foo; echo contents not stored in file ) | bar Edit: A totally different approach, closer in design to what you were looking for: foo | cat - <(echo additional contents) | bar See "Process substitution" in bash's manual.


1

It seems a work for awk. It allows somehow the use of associative multidimensional arrays. The following bash script should do the work. awk ' { Nb[$1]++;b[$1][Nb[$1]]=$2 } END{ for (i in Nb) { printf("%s ", i); for (j = 1 ; j<=Nb[i]; j++) printf("%ld ", b[i][j]); printf(" \n") ; } ...


0

In windows 7 use the mode command. mode con:cols=80 lines=40


0

Use the Explorer Toolbar Editor to reset the toolbar or even add new buttons: Explorer Toolbar Editor is powerful and easy-to-use software that helps you add or remove buttons from the Windows Explorer toolbar in Windows 7. Unlike other existing programs, Explorer Toolbar Editor supports multiple folder types and displays the current set of buttons ...


1

You could use RunHiddenConsole hideExec.bat @echo off RunHiddenConsole batch.bat


0

This is what I used for sudo to run Ansible under babun: #!/bin/bash count=0 for var in "$@" do (( count++ )) done shift $count exec "$@"


1

If I understand the question correctly this will get you what you want. This is PowerShell: $FireWall = New-Object -comObject HNetCfg.FwPolicy2 $EnableRules = $FireWall.rules | Where-Object {$_.LocalPorts -like "*3389*" -and $_.Profiles -eq "3"} ForEach ($Rule In $EnableRules){$Rule.Enabled = "True")} This will filter out the rules and grab the correct ...


0

I searched everywhere for this answer and here what I got Download Alsamixer. Go to settings and select "alsa_amixer controls" or the second option under the mode From all commands search for "Headphone Volume" and change the values to 63,0 or 0,63.


2

I know this one was answered a long time ago, however this is my script to simulate the locate function used in unix/linux Save this as locate.bat and place in System32 OR run from directory it's stored in. Takes one parameter like this "cmd> locate javac.exe" The locate /c switch (as a 2nd parameter will count the number of instances ) and locate /? will ...


0

in DOS (and Windows command line) mask for all-files is *.*. Like in "files always have an extension, sometimes it's empty string". And filenames cannot end with . So mask * canonically mean "files with empty extension". But some utilities, including xcopy as you found, automagically expand * to *.* because… well, I seek no logic when there isn't one. So * ...


2

Not the most beautiful solution, but it works. This script was tested on Linux Ubuntu. It may not work on a Mac because I use gawk. You need to save the following code in a file, e.g parsetext.sh Run this command to enable execution: chmod +x parsetext.sh Then run it with your inputfile.txt: ./parsetext.sh inputfile.txt Following is the script that ...


0

App Paths cannot be used for the search path, as far as I know, but you can have separate PATH defined for both System and User Environment Variables. The search for executables will include all items in both. If the length of System PATH is an issue, you can abbreviate by defining another Environment Variable and referencing it, e.g. Create Environment ...


3

As you have not provided your complete bat-file I guess that it is Powershell.exe -noexit -command "cd 'c:\Dev\ProductDev'" PowerShell -NoExit -Command "Write-Host 'node sp'" This is the wrong approach. You are first starting a Powershell which changes to the given directory and then stays open. If you exit this powershell the bat file will start the ...


0

I did a similar answer here, that might be of use to you. It explains a bit about how you can custom parse files in notepad++ with regex, regex can also be used in programming, so you can later put it into a little program to parse your output.


0

chmod -R a-wx,u+rwX,go+rX path Above is a modification to bobince's and martinp's answers. I don't have the reputation to comment, so I am posting this as an answer. As pointed out on the comment on martinp's answer, this should work fine.


0

Try with something like: mesg y # this is just to make sure you may write to your user at now + 1 min at>df -kh | write $USER at>^D If that doesn't work, you either haven't got util-linux installed with pty-helper flag enabled or you need to specify the display in which you want the output (it is probably $DISPLAY) Note that if you do something ...


1

You can set the colours in the ~/.minttyrc file. Even better you can get a prebuilt theme from here: https://github.com/mavnn/mintty-colors-solarized Here is what I have in my ~/.minttyrc file: BoldAsFont=yes Transparency=off OpaqueWhenFocused=yes Columns=115 Rows=34 Term=xterm BackspaceSendsBS=yes Font=Consolas BellFlash=yes Locale=en_GB Charset=UTF-8 ...


1

This works nicely, I use it mostly with psexec when inspecting client computer connections. nslookup myip.opendns.com resolver1.opendns.com


0

Using wildcards with folders and not files is slightly tricky with WinRAR, but can be done like this: rar a -n*\ay2015m04d21h*\* "C:\test.rar" "C:\Test\Archiv"


0

CD if in the user account where drive is mapped.If you are in a Elevated Command you are no longer in the mapped user account. Win 7: net use U: \servername\share\path\ win 8: pushd \servername\share\path\


0

Do you need to accomplish the password change from the command line, or is that only a requirement since you are in nested RDP sessions? If you save the following to a text file named ChangePassword.vbs, you can launch it from a command line and then change your password in the current RDP session: Set objShell = CreateObject("Shell.Application") ...


1

for /f "tokens=1,4*" %a in ('netsh interface ipv4 show interface') do @echo %a %c


0

You would create what is called a batch script. There are many tutorials around online for getting started with batch scripting, such as this one, I would recommend you have a read and test some of the basics to get a feel for it. As for your specific case, open Notepad (Not a Word doc), and type in the commands that you would normally type into Command ...


3

You need to write a batch file in Windows (in case of Linux they are called shell script). It is very easy to write once you know what commands to use (In your case you already know the commands). In a batch file you need to write down the commands in the order in which you want them to execute. To create a batch file, open a Notepad and write down those ...


1

I don't know why it didn't work, but I re-installed fontforge to a different directory (with no spaces) and it seems to work now.


1

netsh firewall set service type = remotedesktop mode = enable or REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f


0

From what I can remember, bash has the builtin command, which forces it to run, you guessed it, the builtin command, even if there's a file in PATH with the same name. I tested, by making this script in /usr/bin: #!/bin/bash echo "This is /usr/bin/cd, and it does nothing" And here are the results: jarmund@jarmint/etc$ /usr/bin/cd ~ This is ...


1

Source GPG Configuration options 4.2.1 How to change the configuration These options are used to change the configuration and are usually found in the option file. ... --keyring file Add file to the current list of keyrings. If file begins with a tilde and a slash, these are replaced by the $HOME directory. If the filename does not ...


3

The only way to launch a shell builtin or shell keyword is to launch a new shell because exec “replaces the shell with the given command”. I thought that this was an interesting problem but shouldn’t be too hard to solve. However, getting the quoting right took over almost an hour of trial and error (Bash is great but I’m not a fan of the quoting). You ...


1

You need to provide printer name after /D: Like print /D:"Microsoft XPS Document Writer" testfile.txt You can determine printer name by running the following command in Windows 7 command line: C:\Windows\System32\Printing_Admin_Scripts\en-US\prnmngr.vbs -l


2

If the wrapper needs to insert code before the given command, an alias would work as they are expanded at a very early stage: alias clock="do this; do that;" Aliases are almost literally inserted in place of the aliased word, so the trailing ; is important – it makes clock time foo expand to do this; do that; time foo. You can abuse this to create magic ...


6

You defined a bash function. So you are already in a bash shell when invoking that function. So that function could then simply look like: clock(){ echo "do something" $@ } That function can be invoked with bash builtins, special reserved words, commands, other defined functions: An alias: $ clock type ls do something ls is aliased to `ls ...


0

The only solution I could come up with so far would be to perform a case analysis to distinguish whether the first argument is a command, built-in, or keyword, and fail in the last case: #!/bin/bash case $(type -t "$1") in file) # do stuff exec "$@" ;; builtin) # do stuff builtin "$@" ;; keyword) >&2 echo "error: ...


0

According to TechNet... If the printer is connected to parallel port 1, you can print /d:lpt1 <file> If it is a network printed, you can redirect lpt1 (or lpt2) to the printer first: net use lpt1: \\remotehost\myprinter print /d:lpt1 <file>


0

If the file is in printer format, you can use the following command to send it to the printer: LPR -S printer_IP_address -P queue_name filename The queue_name is printer-specific, but most modern printers do not really care what it is. If it's an HP printer, use "raw". This will work with most others as well, even those, like Xerox, that use specific names ...


1

Create a script file called InstallFonts.vbs in my case I put it in C:\PortableApps\InstallFonts\ IN the below code replace "SomeUser" with the username of the person you want to be able to install fonts. Then make the Appropriate "install Fonts" folder on their desktop. Set ofso = CreateObject("Scripting.FileSystemObject") 'SourceFolder = ...


0

I was able to rewrite the script only using WMIC to query the information for the appropriate network interfaces. The script works by querying WMI for network adapters whose ipenabled status is set to true. This weeds out all of the interfaces that are not actual ethernet adapters. We then store the first line of the output (lowest index number for an ...


0

Run where ipconfig to see what is actually running. The correct ipconfig.exe is usually in the System32 folder. If it is running some other command, then the path may be different. Example: C:\>where ipconfig C:\Windows\System32\ipconfig.exe If someone created something else earlier in the path named ipconfig, it may be that program is running ...


2

7z a D:\HTM\comp.7z D:\HTM\*.htm You don't need the -o since you're creating an archive. You also fail to specify which files need to be included in the archive (D:\HTM\*.htm). The output is the complete name of the archive (D:\HTM\comp.7z). The quotes aren't needed here, since there are no spaces in the filename(s).


0

icacls "File/folder_name" /grant "USER":F /t: will provide full access to the user specified as"USER" to the file or folder specified. The /t allows traversal to its sub-folders and files and provides the permission


0

Sounds like you're running cmd /c instead of /K. /c will close the window when your command or script finishes running, while /K will keep it open. If I had to guess, you're using Winkey+R to run this cmd and auto fill is selecting the /c variant of your command, instead of the desired command. The other possibility is that you might be running just ...


0

This works for me once I'm ssh'd in: export DISPLAY=:0; nohup iceweasel &>/dev/null &


0

The runas command cannot be used to elevate the command prompt -- even if you provide Administrator credentials. There is no way to elevate the command prompt from a non-elevated one.


0

Try the following find usage: find . -type f -not -path '*/\.*' Which would ignore all the hidden files (files and directories starting with a dot).


0

The correct way is to use the copy mode like pointed out. You could speed things a bit by automatically enter in the copy mode when you press your favourite scroll keys. For example using PgUp and PgDown: # easier scroll bindkey "^[[5~" eval 'copy' 'stuff ^b' # PgUp | Enter copy/scrollback mode and page up bindkey "^[[6~" eval 'copy' "stuff ^f' # ...


0

Although the underlying object code may be the same between the platforms, non-trivial native applications can't be binary-compatible between Windows and Linux. If Linux executable you are trying to convert is dynamically linked, it would require the presence of libraries that don't exist on Windows (you can see this list of libraries by running ldd ...


0

This is almost certainly not going to work. Linux and Windows do not play nice with one another. The application you are looking to "convert" will have to be rebuilt from source for Windows (which will require Windows specific patching). With any luck the application you are trying to run already has a Windows port.


0

"add folder according to wildcards" "I want to generate an archive file which will include all k* folders (starts with k)" "The k* filter is only for folder names" Given your requirements clearly the image below is incorrect, because you've highlighted k.txt even though it's not a folder. To ensure kjhasd (with 3 files) and koio (with 2 ...


1

You can also type du -sh ./* This will list all the folders under current directory, with human-readable format, including the more familiar file sizes in Kb, Mb, Gb.



Top 50 recent answers are included