If you do not want to change your shell from bash to zsh, then add this to your .bashrc file:
To edit this you can use this command:
While you are editing your .bashrc file, look for aliases or functions which redefined ls use Ghostscript.
Try which -a ls in Terminal.app to show you what ls is ...
It's a bug related to the old version of bash included in macOS.
To overcome you can
Switch to zsh (see What are the practical differences between Bash and Zsh?)
Install a more recent version of bash via Homebrew and use this as your standard shell (see How to use bash as default shell)
If you're concerned only about cleaning DNS entries, the command help gives you instructions what to do:
Usage: networksetup -setdnsservers <networkservice> <dns1> [dns2] [...]
Set the <networkservice> DNS servers to <dns1> [dns2] [...]. Any
number of dns servers can be specified. Specify "Empty" for <dns1>
Use either of these to get compatible characters.
tree --charset=ascii > a.txt
tree --charset unicode > a.txt
Each shell has ‘profile’ files, the contents of which are run when the shell is launched. For bash, this includes ~/.bash_profile. Create this file and add any commands you wish to run in that file, then relaunch your shell.
The first file you want to cat starts with a - so cat considers it to be an option. But as there is no option 2 (see the usage string) it throws an error.
Use one of
cat ./-2e-5_cas 0_cas > prova
cat -- -2e-5_cas 0_cas > prova
instead (the second is better for scripts etc).
PS: In general it is recommend to not use - as the first character of a ...
If you want to be able to combine multiple pages onto one sheet, I wrote a tool that can do that (or just a normal combine). Mac PDFNUp
You can get the binary download on the releases button.
Usage: pdfnup --output <out> --nup 1/2/6 <filename>
Type python3 and you will be running the new version. How you install can vary a bit, but on the current macOS you don’t need to install anything as the stub exists. On any older os I recommend installing https://brew.sh as it has a very friendly on boarding and helps you set your PATH properly to run the v3 of python.
A shell alias is an easy way to fix ...
BitBar (GitHub) is a useful tool for running scripts from the menubar, and it has a lot of built-in functionality like being able to show script output, create dropdown items, perform actions on click, and more. See the Plugin API section of the GitHub README for a description of all the functionality you can use.
Here's an example from the site showing ...
The instructions for enforcing a default shell for users in macOS Catalina through Active Directory is available at Apple: https://support.apple.com/guide/directory-utility/set-a-unix-active-directory-user-accounts-diru34cb1e36/mac
Here's the procedure to manually update the shell (independently of any AD setting):
If the computer a natively installed with ...
You could use a different program.
One comment on your linked question suggests using homebrew to install GNU Coreutils. Alternatively you could simply download it from here, unzip it and can compile it with:
You then get a version of ls that formats output for color and monochrome the same. If output will ...
You can enable the Script menu from the built-in Script Editor.app: Preferences → General → Show Script menu in menu bar.
Then you can place any AppleScript in this menu by putting the script in your Scripts folder.
To add user-level scripts to the script menu, save them into the ~/Library/Scripts/ folder of your user directory. For quick ...
ASCII values lower than 32 are often displayed in Unix text environments as ^@, ^A, ^B... and so on. Thus, ^@ represents ASCII character 0, ^A represents 1, etc. (So, when you type CTRL C, you're actually sending ASCII 3.)
If the file reads entirely of ^@ in nano, then the file is 'zeroed' and contains no useful data. Time to check the backup.
You can install the program htop from Homebrew, which will give you this information.
When you have Homebrew installed, run the following command to install:
brew install htop
Afterwards you can run the program like this:
If you go into the Setup menu by typing S and select Display Options, you can enable detailed CPU information. The CPU usage bar ...
You could create an alias in zsh that invokes emacs -nw whenever you write emacs. The -nw argument means to start emacs in "non-windowed" mode - i.e. a command line text interface.
You can create the alias by editing the .zshrc file you mention, and add the following line:
alias emacs="emacs -nw"
File extensions can usually suggest the type of contents a file might have, however, sometimes files are misnamed, and sometimes files are corrupted. I presume that if you're accustomed to opening filenames with a similar extension with a text editor like nano, you're expecting this file to be plain text as well.
Give the command 'file' a try; that could ...
curl can do this automatically for you (see the beginning of man curl for more details about this):
curl -O https://c.m.com/r*/p*/R*/5*/5*/2*/O*/images/page[0000-9999].svgz
PS: This assumes you will expand r*/p*/R*/5*/5*/2*/O*/ before running curl,
Download the zip to your Downloads folder
Enter in Terminal: sudo mv ~/Downloads/displayplacer-master/displayplacer /usr/local/bin/
sudo chmod +x /usr/local/bin/displayplacer
Depending on your Security & Privacy settings you have to allow execution of the file in System Preferences > Security &...
XZ support on macOS isn't broken, it's just restricted to tar. :-)
There is nothing to worry about using Homebrew though. Head over to brew.sh to get started and then run brew install xz to install the xz binary.
Variation of @d3Xt3r answer:
tar xOvf PackageName.pkg output.pkg/PackageInfo 2>/dev/null | grep '<pkg-info' \
| sed "s#.* version=\"\([0-9\.]*\)\".*#\1#"
Advantage is that this is only pipe processing.
Note my package had different structure, there is an extra directory output.pkg which contains file PackageInfo
pbcopy will take input piped or redirected into it, and store it in a "pasteboard" (i.e. clipboard). So to copy a file verbatim, use a redirection:
pbcopy < dosfile
To paste, use Commandv or
pbpaste | some_command
pbpaste > some_file
I had an issue installing to /usr/bin, even with sudo. I had to ensure sudo was used on all commands that needed it:
This works: sudo curl -L https://git.io/rustlings | sudo bash
This doesn't: sudo curl -L https://git.io/rustlings | bash
It's a conda's environment indicator that none of the "new" environments is active, instead the default one is active. "new" here refers to those created by: conda create --name NameOfEnv python=3.6 or similar.
For getting rid of it, add the line conda deactivate at the end of ~/.bash_profile.
Verify by conda info --envs.
The good news: your system is working afterwards
The bad news: user installed apps and user data will be deleted
The command rm -rf /* tries to remove all files in the whole root hierarchy. This is done with the privileges of the user executing it.
An admin user will remove all admin user installed apps and his/her/* own files - including files installed ...
The stream editor sed is likely the fastest and sharpest tool built for exactly this task.
Use the insert command (the newline after \ is part of the syntax):
X' file > newfile
$ time sed 'i\
X' line250000 >/dev/null
The delay or overhead for this operation is ...
Terminal has a setting to use the default shell or run any program.
I would make the election you wish:
If that's not it, you'll have to hunt down each of your initialization files. Before doing that, make a brand new user account to be sure you have a working zsh for that user and terminal overall.
It's probably the obvious item above, though.
If target is an already existing directory, then the command ln -s source target will create a link target/source in that directory, pointing to the original source. That's what's going on here: the directory .emacs.d/snippets/ exists at the start, and you're running the command
ln ~/.dotfiles/.emacs.d/snippets ~/.emacs.d/snippets
which creates a link in ...
To prepend X to the start of every line of file, writing to newfile, in Terminal:
sed 's/^/X/' file > newfile
Here I'm using sed, the Unix stream editor, to use a very simple regular expression to substitute the beginning of every line (the ^ symbol) with an X.
This bash snippet will prepend each line of a file with a hash (#) and save it to a new file:
IFS=$'\r\n'; printf '#%s\n' $(</path/to/file.txt) > /path/to/newfile.txt
IFS=$'\r\n': This sets the field separator so that only the characters \r (carriage return) and \n (newline) are used to delimit a string. The default setting can be ...
As a general rule I do not recommend deleting system files, however, if you really want to remove the default wallpapers you can do the following:
Boot to macOS Recovery by pressing ⌘R when booting the Mac.
Using Terminal, from the Utilities menu, use the following commands:
cd /Volumes/Macintosh\ HD/System/Library/Desktop\ Pictures
Catalina now installs /System as part of a read-only volume, so it cannot be altered whilst in use.
You can modify or delete those files when booted to Recovery, but bear in mind that Apple may well restore them in an update to the OS.
You can use the git history to obtain the formula for OCaml 4.02.3
Go to the local directory where formulas are stored:
Look at the history of the OCaml formula:
git log ocaml.rb
It appears that the last commit of version 4.02.3 is commit 3cdad82334496ca9fe8d8fb37.
Check out this commit:...
This requires adding cron to the Full Disk Access list.
Open System Preferences : Security & Privacy : Privacy : Full Disk Access
Both rsync and cron must be included on this list. Before Catalina, listing only rsync would work. On Catalina, rsync by itself only lets you run rsync by hand. For it to work within cron, cron must also be on the list ...
I still can not understand how I made this work, and why is it so unintuitive,
This is what I did:
brew install geoipupdate
brew install libmaxminddb
mmdblookup -i xx.xx.xx.xx -f /usr/local/var/GeoIP/GeoLite2-City.mmdb
You messed up when editing .bash_profile with the 'vi' editor aka 'vim'.
You did your writing in insert mode, then when you finished, you were supposed to hit esc to exit insert mode, then : w q for command, write and quit.
You failed to hit esc so it inserted :wq as additional text. You then collected yourself, tried esc : w q one more time, and that ...
"Terminal"-apps on macOS (I put that in quotes because technically they haven't got anything to do with Terminal.app, but merely being command line programs) are not in general identical to macOS apps. However most are very similar.
This stems from the fact that macOS can trace many of its standard command line tools to FreeBSD whereas Linux inherits them ...
You need to add Terminal to the list of apps that have Full Disk Access in the Privacy pane of System Preferences > Security & Privacy.
Unlock the padlock in the bottom left, and drag the Terminal app icon onto the window.
It looks like there exists a line :wq in one of your shell’s profile files, such as ~/.bash_profile, which was probably added as a failed attempt at quitting Vim when editing such a file.
To edit the bash profile with TextEdit, run open -e ~/.bash_profile in Terminal. Edit the file to remove the :wq line only. Save it, quit TextEdit and restart Terminal to ...