Hello forums, Since the new xcode update, I cannot manage provisioning profiles in same location. I am wondering where they are stored on my Mac. In the Terminal app on your Mac, choose Terminal Preferences, then click Profiles. Do one of the following: Click the Action pop-up menu, choose Import, select the file that contains the profile, then click Open. Drag the file that contains the profile from the Finder to the profiles list.
One of the most basic computer functions — deleting files and folders — is also one of the most essential. If you never get rid of anything, soon enough all those extra gigabytes will take a toll on your Mac’s processing power, RAM, and hard drive, not to mention your digital life will resemble a dreadful episode of Hoarders.
So deleting files is good and healthy. But how do you do that? Most people right-click on what they need gone and choose Move to Trash from the menu or use the File option in the menu bar. Others employ the ⌘ + Delete shortcut, which works across the system (even within dialog windows). Experts, however, often find themselves defaulting to the command line delete directory feature. Let’s see how and why you should learn it too.
How to remove directory with Terminal
Since macOS is a Unix-based system, nearly all system tasks you do every day with the help of its graphic interface can also be performed via the command line tool called Terminal.
Why delete file command line feature is important
With regards to delete file or delete folder command line functionality, Terminal lets you:
- Effortlessly erase one or multiple files, folders, and apps, bypassing any error messages you can get when you go the traditional route.
- Remove files from Trash, including ones you can’t delete by simply emptying the trash.
- Get rid of files that are invisible to you within Finder (usually system or root files, for example, .htaccess).
- Delete files and folders in cases when Finder is unresponsive.
Note: The Mac command line delete file feature is final and irreversible. While it lets you avoid any error messages, it also removes the files completely, without any possibility of retrieving them later on.
Tip: Delete unneeded system files on Mac
Some files are hard to delete in a normal way because they sit deeply in system folders. These are such files as logs, broken downloads, caches, remains of old apps, etc. Still, deleting them could give your Mac an extra boost — that's because they are outdated and clutter your macOS.
To dig these files out, try a free version of CleanMyMac X. Among other things, this app has an impressive System Junk detector. When you download CleanMyMac X (this free version is notarized by Apple), you need to click on System Junk.
Just take a loot at the sheer amount of files it unearthed. To delete them, click on Clean.
Just take a loot at the sheer amount of files it unearthed. To delete them, click on Clean.
How to use delete file command line feature
Removing files from your Mac forever using Terminal is deceptively simple: just use the rm command followed by the name of the file. Here’s how it works in practice:
- Launch Terminal from your Utilities folder in Applications.
- Check which directory you’re in by typing ls -la
- Then navigate down a directory with cd [directoryname] or up a directory with cd ../
- When you’re in the same directory as the file you want to delete, type rm [filename.extension]
- If you want to delete multiple files at once, list them all, but make sure there’s a space between each one.
- Press Enter to execute the command.
Mac Os Terminal
Now all the files you specified after rm are gone for good. Navigate directories in your Mac and repeat the process as many times as you want.
Surprised there was no confirmation before your files were deleted? Luckily there’s a way to add one as a safeguard for not deleting the wrong file by accident. Just use -i after the rm but before the first filename, like this: rm -i [filename.extension]. Terminal will then ask you whether you’re sure you want to delete the file. Reply y or yes followed by Enter and the file will be gone. This also works for multiple files, but you’ll have to confirm the removal of each one separately.
How to make command line delete directory
Surprisingly, you can’t delete a folder using the rm command because it has its own: rmdir.
Otherwise, rmdir works exactly the same as rm:
- Navigate to the appropriate directory using Terminal.
- Type rmdir [directoryname]
- Hit Enter.
Sadly, you can’t use the -i hack when you’re deleting folders, so be extra careful!
Another thing to keep in mind is that rmdir only deletes the directory, but can’t delete any files or folders located within that directory.
Mac Download File Terminal
To delete a folder with everything in it, you need to use rm -r followed by the folder’s name. Using -i to create a warning here is possible and done like this: rm -ir [foldername].
When it’s too difficult to find a folder or file via Terminal, but you can detect them in Finder, simply drag and drop the file onto the Terminal window to generate its path.
Delete large and old folders using CleanMyMac X
As it happens with folders, they are easy to mess up and lose track of. That's why many apps provide an alternative interface for searching and deleting files which is more flexible than the Finder. For example, using CleanMyMac X (the app we've mentioned above) you can find massive folders that might have been evading you. You also can filter them by file type and other criteria.
The latest released version of this tool looks like this:
The latest released version of this tool looks like this:
This app by developer MacPaw is available for a free download here. Using this app, files are removed for good, and as far as we know, it's irreversible.
Other ways to delete files and folders on Mac
The shortcut combination
We are sure you know how to drag to your files to the Trash. But here is an alternative way which deletes files at once, bypassing the Trash. There’s one less step involved (you don’t have to empty the bin). And you cannot reverse this action.
Select a file, and press [Option + ⌘ + Delete]
Select a file, and press [Option + ⌘ + Delete]
Delete hidden folders on Mac
Some folders on your Mac are made invisible to protect them from accidental deletion. They are system and support files you would ignore most of the time. But what if a folder seems empty but still takes up space? You can apply another shortcut combination to highlight these unseen objects. Then, you can delete them at your own risk.
To highlight hidden folders: [Press Shift + ⌘ + . dot key]
This best works if you open some system folder, like Library
Some folders on your Mac are made invisible to protect them from accidental deletion. They are system and support files you would ignore most of the time. But what if a folder seems empty but still takes up space? You can apply another shortcut combination to highlight these unseen objects. Then, you can delete them at your own risk.
To highlight hidden folders: [Press Shift + ⌘ + . dot key]
This best works if you open some system folder, like Library
Again, delete these folders only if you are sure what they are.
That was how to remove files and folders on your Mac, shown in multiple ways. Want to know more? Explore our blog for a whole universe of Mac tips!
by Chiamaka Ikeanyi
Sometimes, using the default terminal sucks. You want to go out of the ordinary, to add life to the boring terminal and improve your productivity.
Z shell (Zsh) is a Unix shell built on top of bash (the default shell for macOS) with a large number of improvements.
In this walk-through, we will configure iTerm2 with ZSH and its dependencies. This is a no-brainer, and after this, you’ll ponder the reason for not discovering ZSH earlier. Well, since you’re here already, let’s kick-start this.
Keynotes
- Homebrew installation
- iTerm2 installation
- ZSH and Oh My ZSH installations
- Setting up the dependencies to create a beautiful terminal
Step 1: Install Homebrew
Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple’s macOS.
Before installing Homebrew, we need to install the CLI tools for Xcode. Open your terminal and run the command:
If you get an error, run
xcode-select -r
to reset xcode-select
.Then, install Homebrew.
Step 2: Install iTerm2
iTerm2 is a replacement for terminal and the successor to iTerm. Most software engineers prefer iTerm2 over the default terminal that ships with macOS as a result of its cool features. You can integrate zsh into iTerm2 to increase productivity.
To install iTerm2, run the command:
Step 3: Install ZSH
Zsh is a shell designed for interactive use, although it is also a powerful scripting language.
By default, macOs ships with zsh located in
/bin/zsh
.Let’s install zsh using brew and make iTerm2 use it.
Step 4: Install Oh My Zsh
“Oh My Zsh is an open source, community-driven framework for managing your zsh configuration. It will not make you a 10x developer…but you might feel like one”
— Robby Russell
It runs on Zsh to provide cool features configurable within the ~/.zhrc config file. Install Oh My Zsh by running the command
Check the installed version
You can upgrade it to get the latest features it offers.
Restart iTerm2 to dive into the new experience of using Zsh. Welcome to the “Oh My Zsh” world ?.
That’s not all. Now, we will install the dependencies to get the best out of Zsh.
Step 5: Change the Default Theme
Oh My Zsh comes bundled with a lot of themes. The default theme is robbyrussell, but you can change it to any theme of your choice. In this scenario, I changed it to agnoster, an already pre-installed theme.
You then need to select this theme in your
~/.zshrc
. To open the config file (.zshrc), run the command:Or open the file in a text editor with
Set the zsh theme and update your changes
Using a Custom Theme
To install another theme not pre-installed, clone the repository into
custom/themes
directory. In this scenario, we’ll install powerlevel9k,Then, select this theme in your
~/.zshrc
Update your changes by running the command
source ~/.zshrc
Navigate to
iTerm2 > Preferences > Profiles > Colors
if you wish to change the background color of the terminal.The selected theme in this scenario requires powerline fonts. So, let’s install that.
Step 6: Install Fonts
I will be using Inconsolata. Get your preferred font out of these powerline fonts. Then, download and install it.
Or download the entire font.
To change the font, navigate to
iTerm2 > Preferences > Profiles > Text > Change Font
.Now, you can see Inconsolata listed as one of the fonts. Select your preferred font. For fonts that support ligatures like FiraCode, check the “Use ligatures” option to view your arrows and other operators in a stylish manner like ( → ).
Step 7: Install Color Scheme
Let’s change the color scheme to bring out the beauty of our terminal. Navigate to iTerm2-Color-Schemes and download the ZIP folder. Then, extract the downloaded folder cos what we need resides in the schemes folder.
Navigate to
iTerm2 > Preferences > Profile > Colors > Color Presets > Import
- Navigate to the schemes folder and select your preferred color schemes to import them.
- Click on a specific color scheme to activate it. In this scenario, I activated Batman which is my preferred color scheme.
Tada! ? We’re done with the basic settings.
Step 8: Install Plugins
Oh My ZSH comes preloaded with a git plugin. To add more, for instance, docker, auto-suggestion, syntax highlighting and more:
- Clone the Git repository
- Head over to
.oh-my-zsh > custom > plugins
directory to view the cloned directory. To access this, run the commandopen ~/.oh-my-zsh
- Add the plugin to the plugin section of the config file
~/.zshrc
shown below - Update your changes by running the command
source ~/.zshrc
Step 9: Add Aliases
Aliases are shortcuts used to reduce the time spent on typing commands. Add aliases to commands you run in the section shown below.
Thanks for reading.
If you know about other means of improving productivity using ZSH, you can drop them on the comment section, I will be glad to hear from you.