New answers tagged

0

This account is reserved for the graphical log in screen to shutter you to the command line environment / minimal text terminal. It’s not an actual account you can use to log in to the OS, just a signal to switch from one set of processes and interface to another. That being said, I wonder if something is up and you have an actual account you are loggin in ...


0

I see some likely non-macOS code in the script. Example: export SDKMAN_DIR="/home/USRNAME/.sdkman" Linux uses "/home" while macOS uses "/Users". While untested, export SDKMAN_DIR="${HOME}/.sdkman" This isn't related to your slowdown.


1

If you type set -x into the terminal, it will print every command it executes from that point on, so to find the culprit, type set -x and hit return, then - paying attention to the lines scrolling by on the screen - watch for whatever command takes a long time to run. The number of + characters at the beginning of each line tell you how deeply nested the ...


4

The Mac must be powered on to run your script. Only a few Apple specific processes are allowed to run via PowerNap. pmset You can use pmset to schedule your Mac to wake in the middle of the night. pmset allows you to schedule system sleep, shutdown, wakeup and/or power on. "schedule" is for setting up one-time power events, and "repeat" is for setting ...


2

I found an answer. The Lock Screen app on Github does exactly what I wanted to do. So, by downloading it and adding this to my script, I can lock my monitor remotely: run application "Lock Screen" Edit: It seems the application runs the following script: activate application "SystemUIServer" tell application "System Events" tell process "...


1

I've marked the above answer as correct even though it did not solve my problem because there is a lot of other useful code. My unsolved issues: 1. modifier keys are still interfering even with CMD-c trick 2. Clipboard trick alters the clipboard. I could set it back to original value but that changes the history. My solution: Don't run the script till any ...


4

You can try something like, first copying the text to your clipboard, that you want inserted into Terminal, then have the AppleScript code paste the clipboard into Terminal. tell application "Terminal" activate tell application "System Events" tell application process "Terminal" set frontmost to true repeat while not ...


3

Can't find the correct variable for the title. But if you go to iTerm2-> Preferences -> Profiles -> Session -> Configure Session, you can create a custom menu component with title as \(rows) x \(columns) and it will show the width. I know it's not the perfect solution but will do your job. Make sure your status bar enabled is checked.


3

I came here as came up with Sam Berry's exact same answer, but it doesn't work for me (OSX 10.14.6). Managed to get it to do so with quotes around the !! : echo "!!" | pbcopy


1

I use screen to connect to my router's serial port on my Mac. After installing it- using either macports or homebrew depending on your preference- use the following syntax: sudo screen /dev/(serialDevice) (baudRate) (TransmissionRate) (flowControl) To connect to my MikroTik RB4011 router my screen command is: sudo screen /dev/ttyUSB0 115200 cs8 ixoff "...


1

An important consideration when programming is to come up with a plan for debugging your code. Here is how I would have coded the code for debugging. It's difficult to debug an on open handler. I add an on run handler where I can dummie up the input to a common routine that is called by on run and on open. fyi: I corrected how the input was processed from ...


1

Recent Macs ship with GNU nano version 2.0.6, which is a far cry from the latest version 4.3. GNU nano is written in C and thus very easy to build from source. To do this, try the steps below that are reproduced from the README file that is included in the source code which you can find here: curl -O https://www.nano-editor.org/dist/v4/nano-4.3.tar.gz tar ...


0

Here's another attempt, tested on macOS High Sierra. Alas, this is only works when the given window is on the current desktop! The AppleScript API to control windows seems to be incomplete, making this impossible. Substitute "Safari" and "WhatsApp" for your use case. tell application "System Events" tell process "Safari" try set ...


0

The -s option is working for me, so I don't know why it doesn't work for you. Have you tried to add #!/bin/sh (or #!/bin/bash) in the top of your script ?? If you use the -n option on echo you'll get the input on the same line as the label. So the below is having the input: Password: <waiting for input>, and on the next line it just print the ...


1

"Is there a workaround?" I'd call it the "right" way. Use the script editor. save the script as an application. Thus, the script becomes a full fledged application. Give the app assertive capabilities. should you want to start the app from the terminal, open your-app. What to worry about: "Effective defenses against malware and other threats" by John ...


-1

Marta (free + open source) Simple and fast file manager for basic tasks like copying, moving and managing files. Key features Open source macOS native Plugins Macros Dark/White themes Installs from dmg/brew Embedded terminal Tabs Cons Limited functionality at the moment: No file/text search No remote filesystems support (aws, ftp, etc) PS: I'm neither ...


-1

New user accounts will be created with zsh as the default shell. Existing accounts will keep whatever settings they already have in place.


0

I've personally not used MacOS Catalina. It may or may not require you to run chsh altogether as the superuser (i.e. root). Try executing chsh -l (lowercase L) to see a list of the shells available to you. As changing a user's shell modifies /etc/passwd, you'll only be able to modify your own user's shell if you don't run chsh with sudo or as the root user....


2

Turns out the terminal app has its own settings for which shell to use. I had to go to terminal preferences and change the option for Shells open with to Default login shell:


1

Check the "View" menu. optioncommandPage Up and optioncommandPage Down scroll the window a single line.


1

There is no way to do it right know, but this pull request, if it gets accepted, will enable iTerm2 to report mouse wheel events without reporting clicks.


1

As per Tetsujin's comment, it turns out I was missing the -v before the url of the printer.


0

To do that, you need to open the 'Terminal' In your Terminal, enter the following command: touch -t YYYYMMDDhhmm.ss (DON'T press enter yet) replace YYYYMMDDhhmm.ss by it's respective characters So for example: touch -t 197512232000.23 (DON'T press enter yet) Locate the files you want to change their timestamps in Finder Select all the files you want to ...


0

Open the keychain app, click on the category "passwords", click add, and put the path to the SSH file as the account name: Now, ssh-add -A should automatically add the key to your ssh-agent without any further hassle.


2

I'm one of the creators behind CommandPost. CommandPost is a free and open source Mac application that allows you to seriously speed up your creative editing process through powerful and customisable automation tools. Think Apple’s Automator, with a little bit of BetterTouchTool and Keyboard Maestro thrown in, but specifically designed for creative ...


3

I know this is late, but the solution here may work for others with similar roommates. I am thinking that your hostname is properly set, but that your prompt definition may have been pranked. First check is to run 'echo $PROMPT && echo $PS1' and see if they match. If they don't, then we are looking for a prompt re-definition for sure but it is ...


1

While this is not a final solution, I have found an interesting behaviour that may lead to a real solution if someone can figure out how terminal is doing this. Using macOS 10.14.6, Terminal 2.9.5 (421.2), I get much the same results as all of the above except, if I am in mc [midnight-commander: stable 4.8.22 (bottled)] the window list shows entries like ...


1

You might want to check out CommandPost which has a Watch Folders function. I've never used this software, so I'm not sure of its full capabilities. It may be a good place to start. Disclaimer: I have no financial or personal ties to CommandPost.io.


1

Shell script: curl & installer If you can host the package on a web site, the installation can be reduced to the following two commands. Download the file to the local computer: /usr/bin/curl https://www.example.com/mypackage.pkg > /tmp/mypackage.pkg Install the downloaded file: /usr/sbin/installer -pkg /tmp/mypackage.pkg -target / You can ...


2

A terminal connection, such as created by SSH, basically transfers characters, not keystrokes. There are some exceptions to this, such as the "return" key and CTRL+letter combinations, because they have been in use since time immemorial and have their own character codes, and some keys like the arrow keys are handled by sending multi-character sequences, but ...


0

TLDR; use .bash_profile for your aliases. The way the different initialisation files work together is a bit more complicated, and there are some important special cases in OSX. Here are the highlights: Bash, on any platform, executes one of several different files depending on how it is invoked. The details are here. OSX's Terminal App does something non-...


2

Troubleshooting often involves a process of elimination and can require a lot of patience. Unfortunately, when it comes to Wi-Fi connection issues there are actually a lot of variables at play, so the best place to start would be to test for whether this is a problem with your MacBook or something specific to the Wi-Fi network. (I know you say there is ...


2

To see which key combinations are supported in Terminal, look through the menus or open the help page from the help menu. A utility I find quite useful is CheatSheet which lists all key combinations currently available if you press and hold Command key for a few seconds.


2

This should be the correct format. Spaces are not 'allowed', but escaped by a preceding backslash that wouldn't be visible in Finder. To verify, use the exact path and add a cd  (note the space character that's usually killed by SE-rendering) before it, press enter, and find yourself at the location in Terminal. Alternatively, precede it with open  and see ...


2

if python is installed already just go to terminal, go to correct directory and type "python filename.py"


5

If you want to list all files/folders in a directory, you should type ls not Is. It is L, not i. To learn python, you won't need to reach ~/.bash_profile unless you need to change versions. Just use which python or python --version and use the syntax for the version that appears. Or use online compilers for quick testing. Suppose you have your file learn....


0

I have just had the same issue and after some head-scratching it turns out to have been a mis-configured ssh configuration file. I want to limit log on authentication to ssh keys only and had updated /etc/ssh/sshd_config file, but made a mistake. I suggest you check your ssh configuration file carefully. In my case I set some parameters with the value No (...


1

fc-scan -f "%{file}\t%{lang}\n" PATH | grep 'zh' | cut -f1 | sort | uniq Replace PATH with the folder you want to scan. This spits out all filenames inside this directory which are at least of some language containing 'zh'.


1

The short arrow is indicating alias. Some like that are also there in my Applications folder for apps which are located in ~/Library folder. So I can guess that when first photo's original process is done, alias is still active. This happens to me while using OpenCV. closewindow() is hard to perform. I have to force quit it every time(it kills jupyter ...


1

The answer is simple and obvious — i just never thought of it until I did it by accident. You need to shut down the shell in each tab before you exit terminal. Then when you restart the histories get restored as expected. Shutting down bash causes it to execute the hooks that save the history properly


2

You can use the following AppleScript: tell application "System Preferences" reveal pane "Security\n& Privacy" end tell In the shell, you'll need to wrap this inside an osascript command. The best solution will depend on what your exact workflow is, e.g. whether you want to do this as part of a script.


3

You have to know where the actual PreferencePane resides. Just supply the full path to the section you want. For Apple supplied PreferencePanes it's easy: open /System/Library/PreferencePanes/Security.prefPane opens your desired System Preferences > Security and Privacy. Other preferencePanes might be found at /Library/PreferencePanes or ~/Library/...


1

Terminal > Preferences, Profiles > Advanced and disable Audible and Visual bell.


5

Open Terminal Preferences → Profiles → your profile → Shell and switch ‘Ask before closing’ to ‘Never’.


2

It is always a security risk to run a binary as root. The better way of doing things would be to set the unix raw socket capability. sudo setcap cap_net_raw+ep /usr/bin/hping3 That way the you dont give the binary permissions that it doesnt need. (You can also look at set capabilites, e.g.: getcap /bin/ping)


4

This may help you. Go to Preferences under the Terminal menu and a panel opens. Click on the Profiles icon on the top left of the panel. This opens a new panel as shown below. Click on the shell tab at the top of the new panel. The first item, as shown in the image, is where you can define a command or commands to run when the tab is opened.


2

This is unfortunately not possible with Terminal.app. This can be done with iTerm2, but you are obviously aware of that.


1

I have resolved this problem. I was specifying SERVERNAME in the command. I used to enter something like: SERVER.DOMAIN.Local (as we have *.local domain). Turns out, I had to enter just DOMAIN.Local.


1

The ‘read’ verb for defaults takes a domain, not a filename, therefore the .plist suffix should be omitted. sudo defaults read /var/db/dslocal/nodes/Default/users/user ShadowHashData


3

To get this to work the way you want, you have to set the option key to be used as a Meta key. To do this: Launch Terminal Go to Terminal > Preferences... Select the Profiles icon at top Select the profile you're using from the lefthand side Click on the Keyboard tab on the righthand side Now tick the Use Option as Meta key checkbox at bottom of the screen ...


Top 50 recent answers are included