Command Line

Subscribe to Command Line feed
This is for anything regarding the command line, in any operating system. All questions (including dumb ones), tips, and interesting programs/console applications you've found or made yourself are welcome. Linux / BSD / OSX / Windows CLI apps or questions or comments, we're happy to take them all!Command Line
Updated: 25 min 26 sec ago

cmder questions on Windows. Help a noob out

Thu, 09/20/2018 - 21:12

Just installed cmder after being unimpressed with GitBash. I just got a new Windows laptop.

I normally used iterm2 on Mac and LOVED it. Just got a Windows machine. I use Vim and Git heavily and just have some stupid questions regarding cmder.

  1. iterm2 on Mac starts INSTANTLY when I click the shortcut for the terminal. Cmder seems to take about two seconds to open up and get to where I can type. Yeah, this isn't the biggest deal, but it's annoying. I like things to be snappy. Is there anything I can do, or is it this way for everybody?

  2. How in the world do I switch to a new tab in cmder using the keyboard. For iterm2 I would just use cmd + shift + [ or cmd + shift + ]. This was extremely fast and fluid. What is the windows shortcut?

  3. How do I split my window into two panes USING keyboard shortcuts? In iterm it's just cmd + d to split vertically. Then I can easily swap between them.

  4. How do I get lists to wrap around the current window dimensions? iterm2 would always do this so I wouldn't have to scroll up. For ex, on cmder I can press "ls" and there's a giant list of shit that goes outside of the dimensions of the currently opened window. How can I make things wrap?

  5. How do I show HIDDEN files doing an ls? I DO NOT want to have to do ls -a everytime, I just want everything to show doing ls.

submitted by /u/acerswift3
[link] [comments]

is it possible to add more than three buttons on osascript?

Thu, 09/20/2018 - 12:49

also, I've heard that the new macOS won't allow osascript to tell an application (method) without user permission?

submitted by /u/lalamanicer
[link] [comments]

remove duplicate files - OS X / bash

Thu, 09/20/2018 - 10:15

On OS X. So, bash

I'm wondering how difficult it would be to make a script that does the following:

1) walks a directory tree and finds files with duplicate names. For example. MainDir/dir3/foobar.txt would be considered a duplicate of MainDir/dir8/foobar.txt.

2) moves all the duplicate files to a dummy folder that replicates the folder structure. So the above file in dir8 would be moved to DupedFiles/MainDir/dir8/foobar.txt.

I don't care which dupe files are moved, as long as one copy of the file remains in original structure.

I've been able to create a list of simply dupe-filenames, but that doesn't really get me any closer to moving the files out.

If there are any utilities that might do the same, I'd be interested. I found DupeGuru and Dupe File Remover PRO. Neither can use only filename as the rule. DupeGuru seems unable to succeed and moves unique files also. Dupe File Remover might work, but is only allows all the dupes to get put into it's own folder in the Trash. I'm not really into that.

submitted by /u/ovideos
[link] [comments]

RSS feedreader suggestions?

Wed, 09/19/2018 - 07:25

I'm currently trying newsboat, and I discovered that the workflow suits me much better than any GUI feedreader - if the article contains anything besides plaintext, I just want to open it in Firefox.

However, newsboat is incredibly wasteful with RAM, considering it's written in C++. With 13 feeds and a limit of 30 articles per feed, it uses 150MB. Does anyone have a suggestion for a comparable feedreader that's stable, uses less ressources, and is not abandoned?

I use Ubuntu 18.04. I strongly prefer feedreaders that are available via apt, flatpak or snap, without having to add a PPA.

submitted by /u/FeatheryAsshole
[link] [comments]

Any Linux CLI Chat Clients?

Tue, 09/18/2018 - 21:11

I am looking for a chat client that I can run via the Linux CLI. I am aware of hangups and finch. However, I was not sure if there were any others.

Thanks in advanced!

submitted by /u/BobsYourUnc
[link] [comments]

[jscript] if else

Tue, 09/18/2018 - 21:00

Hi guys!

I'm trying to do an if else statement and the damn thing won't do the {else. Hoping you guys can see something (probably obvious) I'm missing.

strResult= "";

if ((strSubType="Potato")||(strSubType="Tomato")) {

strResult = "Vegetable - " + strSubType;

} else {

strResult = "Fruit";


submitted by /u/pancaeks
[link] [comments]

Spotify CLI clients

Tue, 09/18/2018 - 19:57

I'm currently running modipy / modipy-spotify and ncmpcpp to listen to spotify on the console. In general this is a very nice setup and working well, but i miss some of the discovery features which are supposed to be provided through tunigo and although i have modipy-spotify-tunigo installed and active I only get empty folders when trying to drill down to the playlists.

I'm wondering if anyone has any alternative clients you could suggest that provide the full spotify experience but on the commandline?

submitted by /u/thott2601
[link] [comments]

`$ say nytimes` results in an unexpected sound (MacOS)

Tue, 09/18/2018 - 19:31

To make more obvious what I mean, do this:

$ say latimes $ say nytimes submitted by /u/danwin
[link] [comments]

How to create shortcut for a command that works in "Run"?

Tue, 09/18/2018 - 06:03

So this command works when I type it in "Run":

C:\Windows\System32\cmd.exe /c C:\Program Files Personal\XP-UBmatrix Processing Engine - Java Edition\UBmatrix_Processing_Engine_Java_Edition -\UBmatrix Processing Engine - Java Edition.exe LAX_VM "C:\Program Files\Java\jre1.8.0_181\bin\java.exe

But I tried many ways to get this in a .bat or .exe file with no luck. I just want an easy shortcut on my desktop to be able to run this specific program with the specific java version. It's a hassle to copy paste this everytime in "Run".

Also before someone says it yes I know it's an issue with the program itself, but because of circumstances this is the only solution.

submitted by /u/vree360
[link] [comments]

Overcoming readline limitations for a simple logger

Mon, 09/17/2018 - 15:01

I created a super-simple bash script to log various project activity:

$ cat ~/bin/log #!/bin/bash # Syntax: log $PROJECT $UPDATE >>$1 echo -------------------- >>$1 date >>$1 echo -------------------- >>$1 echo "{@:2}" >>$1 echo

In other words, write all the params to a file in the first param with a timestamp. Yes, it could be vastly improved, but I just wanted something quick and dirty. Unfortunately, my goal was to type in English, but English has these weird quirks that Bash thinks are special characters. The biggest annoyance is the apostrophe. Obviously, if I have a string with an even number of aposhtrophes, they're basically just stripped, and if there's an odd number, I get a PS2 prompt to complete my command.

Unfortunately, every simple solution I've thought of would be subject to the same limitations. What can I do to work around this without getting too complicated?

submitted by /u/tactiphile
[link] [comments]

Is there a command line for macOS that allow me to see what application is the front window - the one currently being used by the enduser?

Mon, 09/17/2018 - 10:54


If I have Chrome, FaceTime and Safari open, but FaceTime is the fore-front of all windows; Is there a command/code that tells me that FaceTime is the current window being used?

submitted by /u/lalamanicer
[link] [comments]

Is there a way to set the origination mode on Facetime (Macbook Pro) to be landscape view by default?

Mon, 09/17/2018 - 06:45

I found this command line code to auto-answer your facetime calls via laptop.

defaults write AutoAcceptInvites -bool true defaults write AutoAcceptInvites -bool false

I'm curious, what other facetime settings you can do via the command prompt?

Regarding the default landscope mode. I notice there's a keyboard shortcut to activate the landscape mode; maybe I should use apple scripts or build a little script myself? Thoughts?

submitted by /u/lalamanicer
[link] [comments]