New answers tagged

1

Based on what you described, I can suggest two more options: alias youtube="youtube-dl -f best '$1'" ($1 - is the first argument following your command, if you have to use single quotes) youtube() { echo -n "YouTube link: " ; read _url ; youtube-dl -f best '$_url' ; } (multi command function with a prompt line) Or if you don't have to ...


0

aliases are not set by terminal or iTerm they are a part of your shell. By default in BigSur it is zsh, for most other versions before the default shell was bash aliases do not take a parameter they just do a text replacement of the alias by the text to the right of the = If you need to do things with parameters then look at functions in the shell manuals. ...


0

TL;DR I could not get it to work. I have mentioned some ways to setup that might work for some. Will note the errors I faced at the end. The only thing you need for the most minimal setup is a working shell (like /bin/bash). A curious case of simple but not easy. Here's how it's supposed to be : Required mkdir -p /tmp/chroot/bin /tmp/chroot/usr/lib cp /bin/...


10

Each Terminal tab is a login session on macOS by default. You can run w to see that each tab/tty running a shell has a process name starting with - attached to it (which indicates a login shell). Additional information (related to bash, but the same is applicable to other shells) What options does Terminal pass to bash on startup? Why doesn't .bashrc ...


0

You can launch GUI Dialog to select a file in shell script with following code: theSelectedFile="$(osascript -l JavaScript -e 'a=Application.currentApplication();a.includeStandardAdditions=true;a.chooseFile({withPrompt:"Please select a file to process:"}).toString()')" echo "Selected file: $theSelectedFile" You can customize ...


0

While this is obviously an old, already answered question, it appeared as the top 'related' post for a very new question so I took a look at it without considering its age. There are some alternative approaches but I think the easiest would be to take advantage of pdf metadata and use Automator to rename the file accordingly. This workflow takes the selected ...


0

I had the same issue with git. After reinstalling MacOS the issue went away.


1

The tool osx-cpu-temp works perfectly for me ! (thanks) I made a little script to actuate the value each second and to prettify the output (it uses toilet for the pretty-output) : while true; do; clear; osx-cpu-temp | toilet -f smblock; sleep 1; done; Using ITerm2, I made a profile that lauches this command just after logging. ITerm2 can also store a window ...


3

As of macOS Big Sur 11.2.3+ - and according to the updated man tmutil - you need to provide the date and time of each backup using -d and -t flags, respectively. So the following tweak is needed for the accepted answer: ## assuming you have the backup disk connected: latest=$(sudo tmutil latestbackup) sudo tmutil listbackups | while read backup; do if [[ ...


0

Worth checking your Terminal preferences. From the keyboard, press the Command and comma keys [⌘ ,]. Then click on "Profiles" and select the "Shell" tab. Make sure the startup run command has the correct command. (Defaults to empty text.) Try unchecking the run command option and open another terminal tab. It should default to your system'...


0

I think answered my own question and wanted to post it here in case anyone else runs into this. In my case not only was it a self signed cert, but I was using a local host name which did not match the hostname on the certificate. Therefore using the following command worked for all browsers tested: security add-trusted-cert -e hostnameMismatch-r trustRoot -...


-1

There are several histories for example bash and zsh. You can do this with nano. To do this, simply open the terminal With this you edit the bash history nano $HOME/.bash_history With this you edit the standard zsh history nano $HOME/.zsh_history If you want, you can do the whole thing using TextEdit. Bash: open -t $HOME/.bash_history Zsh: open -t $...


0

displayplacer is perfect and made the bulk of the process very easy. I used it in an Automator script to switch between two arrangement profiles, and then set up the ability to trigger those scripts from the menu bar. Here's a record of the process I went through. Follow instructions here to install displayplacer and get the commands to set your two layouts....


6

As @benwiggy says you cannot split up the command line tools. However if the issue is just that you want git then there are other ways Install command line git binary and associated tools from the Git downloads web page Install a git GUI tool that includes its own copy of git efor example SourceTree. Other Git GUI clients are listed on the Git website


2

There shouldn't be any difference, no.


8

The installer says it requires 2.72 Gb of space. It installs a variety of Unix tools for compiling software, and other advanced usage (such as git) on the command line, including 'many other useful commands that are usually found in default linux installations' (osxdaily.com). It also includes the SDK frameworks and header files for macOS APIs. And python3. ...


0

For new version of iterm 2 (3.4.4), I had to use the suggestion from https://coderwall.com/p/a8uxma/zsh-iterm2-osx-shortcuts. This work specifically for zsh In zsh you can use ctrl + a/e to move to beginning/end of line and esc + W/B to move one word backward/forward, but that's not very handy. Here is a solution to map ⌥ + ← / → and ⌘ + ← / → to work in ...


7

I want to add that if you're security conscious, you should never cut-n-paste such a command from a web site to run on your computer like that. The HomeBrew project is a well-known and respected piece of software so I'm not saying that there is anything inherently wrong with installing it. However, their web site could be compromised in the future, where ...


12

/bin/bash executes a new instance of bash -c passes one or several commands to be executed $(...) runs the command within () and returns its result (Command Substitution) curl ... gets the file specified in the URL So basically bash gets called to execute the content of the file fetched by curl. Some things you may try to understand this in more detail run ...


0

I don't have enough reminders to test for speed but give this a try. You can get the 'named' reminders into a list with one step and then coerce that list into your text output with a second. This should be faster than iterating through them individually. # Find all Reminders whose name contains "Alumni" set findMe to "Alumni" set answer ...


0

The following code in the .bashrc file should initialize an anaconda environment. Just remove them. # >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/Users/proshore/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2$ if [ $? -eq 0 ]; then eval "$__conda_setup" else ...


0

The UNKNOWN part is your computer hostname, for some reasons it changed itself. You can change the hostname from the Terminal using the following commands : sudo scutil --set ComputerName "newname" sudo scutil --set LocalHostName "newname" sudo scutil --set HostName "newname" Then flush your DNS cache with dscacheutil -...


0

This is a specific example of a common problem. Installers and applications that spray files and detritus all over the filesystem and rely on users to run many scripts, all changing weekly with version upgrades quickly becomes an intractable problem. You should be able to reclaim the 5 GB of space easily without worrying about some stub files and mostly ...


1

Each shell (the program that runs inside the terminal application) has two startup files. If you look at the steps you performed when you set up homebrew, it asked you to modify those startup files. There is a syntax error or unintended side effect of the directions you followed to customize the files to prepare the homebrew environment. Take some time and ...


0

You seem to have booted into an older version of macOS Recovery (there's an item called "Install OS X Yosemite.app" visible in your screenshot). This is something that can happen with Internet Recovery, depending on the Mac model and OS version. If you use the regular local Recovery (⌘ R), the spctl command should be available. If you HAVE to use ...


Top 50 recent answers are included