Showing posts with label Mac Tools. Show all posts
Showing posts with label Mac Tools. Show all posts

Tuesday, April 22, 2025

Fix the "ls: Operation Not Permitted" Error on Mac

Recently, I encountered an issue when trying to execute the ls command in Terminal. This is a commonly used command to display the contents—files and directories—within a specific path. I need to know what's there before I do anything.

ls Error

  1. MyMac-MBP13:~ auser$ ls
  2. Applications Untitled.html
  3. Desktop downloadtemp
  4. Documents iCloud Drive (Archive)
  5. Downloads iCloud Drive (Archive) - 1
  6. Library iCloud Drive (Archive) - 2
  7. Movies test
  8. Music test.aiff
  9. Pictures test.html
  10. Programming tmp
  11. Public vc.swift
  12. Sites
  13. MyMac-MBP13:~ auser$ cd ~/Library/Application\ Support/MobileSync/
  14. MyMac-MBP13:MobileSync auser$ ls
  15. ls: .: Operation not permitted
  16. MyMac-MBP13:MobileSync auser$

After searching online, I discovered that this issue is due to a security enhancement introduced by Apple in the latest macOS: System Integrity Protection (SIP). By default, the Terminal app does not have the privilege of Full Disk Access. My current macOS version is Sequoia 15.3.2.

Change System Settings

According to a solution on the CleanMyMac blog titled “How to fix the ‘ls: .: operation not permitted’ error in Terminal,” I needed to adjust a setting in System Settings.

Initially, when I navigated to Privacy & Security, I couldn’t find the Full Disk Access option.

I wasn’t sure where the setting was—until I tried searching for “Full Disk.”

I turned it on.

The hidden setting was revealed. As expected, Terminal did not have Full Disk Access by default. I enabled it by entering my admin password. Now, the ls command works anywhere in the console, after re-opended.

  1. MyMac-MBP13:Application Support auser$ ls Mob*
  2. Backup
  3. MyMac-MBP13:Application Support auser$

Revert the Setting (Optional)

I believe Apple’s SIP is a great safety feature. After finishing my work in Terminal, I turned off Full Disk Access for the Terminal app to restore the default setting. I’m writing this blog post for future reference, in case I need to do similar work in Terminal again.

References

Other Blogs

Tuesday, February 26, 2019

Open Attachment Winmail.dat in Mail App

This is quite annoying issue. I frequently receive emails from Windows platform with attachment. The attachment file is displayed as Winmail.dat file in Mail on Mac side. The dat extension name cannot be correctly identified on Mac.

Further search on web, I realize that this is a command issue. Today I found a simple solution to get the issue resolved. What I need is an app called TNEF's Enough. This is a free app and now available in App Store.

With this app, open the saved attachment file Winmail.dat. It will reveal the type of file hidden within the dat. Double click will prompt a Window to save the revealed file.


References


Tuesday, April 17, 2018

Remove Folder/File by Using Terminal

Normally, you can remove files/folders from Finder just by selecting files/folders first and then hitting "delete" key. However, I encountered a special case that I could not remove a folder in Finder. I got a prompt message saying that the folder is in use. Actually this is a misleading message. The folder is not in use and I could not delete it even after I tried to restart my mac.

Further investigation, I found that the folder is in kind of nested loop endless. It is in my Trash. I don't know why it is like that.



Full Path to the Folder


The first thing I need is to find the path to the folder. The file/folder full path is not obviously available in Finder.

There is a way to obtain the full path from folder's Info. Just locate the folder in Finder, and hit Command+i combination keys. This will bring up an info window.

For example, the following is the info window for the folder in my Trash.




Highlight Where section, kit Command+c keys to make a copy. This will copy the full path of the folder to clipboard, ready for use.

Terminal to Rescue

Use spotlight to open Terminal. This can be easy done by pressing Command+space keys, and type in terminal in spotlight search area. Press enter key to open Terminal.

I remember that there is a command tool to remove folders. It is the command of rm.

First I have change current location to the path where the folder is. Use the following command cd to change the current location or directory or path:

  1. cd /Users/dchu/.Trash

Before removing the folder, I have to make sure the folder is there. Use ls command to show the content of the current directory, with -F switch to show folder:

  1. ls -F
  2. iPhoneDev copy 6.00.02 PM/

Now it is time to remove the folder. Use rm command with -R switch. This switch will force to remove the folder as well as any contents, such as files and folders, within the folder.

  1. rm -F iPhoneDev\ copy\ 6.00.02\ PM/
Tip: when you type in folder's name, you can just type in a few characters like "iPho" first, and press tab key to get the complete name filled out.

Kit enter key and the folder is gone!

Note: there may be spaces within file or folder names. The spaces in a file or folder name can be specified by escape char \, just like above example.

References





Wednesday, March 18, 2015

Edit Movie from DVD

I rarely use DVDs. However, recently I got a request to edit movie from DVD. I thought I had a post long time ago. I tried that; unfortunately, the app I tried is no longer supported by the current OS.

In short time, I found a solution to rip DVD. The app is an open source project: HandBrake. I downloaded the app for Mac. I had to allow any app for temporary from System Preference:Security so that the app could be opened.




I tried HandBrake and it did the job as my expectation, ripped DVD to m4p movie file. Then I used Quicktime Trim feature to cut pieces we need to finish our work.

Reference





Saturday, July 17, 2010

Podcast Capture 2 and Producer 2

In past weeks, I have been watching WWDC10 videos. At the end of each show, I see the end with "Made with Podcast Producer":



I did not understand what it is. Then I google it. Hah hah!, I found it. It is a Mac application, actually a server application. Apple web page has detail information about the new version of Podcast Producer 2, and YouTube has show on this one as well, several videos by MacBookPirate.

However, Podcast Producer 2 is a Server application. I don't have Mac Server yet. Mac Mini Sever is a very attractive box I want. That may be my excuse to get one. Just I don't have time to get it yet. Interesting finding is that I also found there is a counter part application for client. It is called as Podcast Capture 2. It is available in my Mac as I found it from my spotlight:



And here are some screenshots I have about it, first is the launch:



and the next for log in:



since I don't have a Mac Server, so I am stuck here. Here is the help information:



When I get my Mac Mini server, I'll give it a try for sure. It looks like that this tool is an end-to-end application to make, process and distribute podcast. Not only you may host podcast server, you can also submit podcasts to iTunes. That will be great.

Saturday, January 30, 2010

Show/Hide System Files

toolsI had a post in 2008 about "Show/Hide Hidden Files". Here I found another tool which contains this feature as well: TinkerTool, which is free as well. It has the same with to enable/disable "Show hidden and system files" in Finder tab and a button to relaunch Finder.



Most Mac tool applications actually have some scripts behind it. Quickly, I found out that there is a setting to make Finder to display system files: AppleShowAllFiles in com.apple.Finder default settings. This can be verified in a Terminal:

[MyMac]~ [user]$ defaults read com.apple.Finder | grep Apple
    AppleShowAllFiles = 0;


The default setting value is 0, which means disabling Show hidden and system files. To set this enabled, type the following command:

[MyMac]~ [user]$ defaults write com.apple.Finder AppleShowAllFiles 1


To verify its value, you may use alternative way to read value:

[MyMac]~ [user]$ defaults read com.apple.Finder AppleShowAllFiles
1


The Finder would not immediately be able to show hidden files. It has to be relaunched. One way to launch it is to Force Quit from Apple menu:



The short-cut key for this Command+Option+esc, then select Finder to relaunch it. The above snap-shot actually shows the wrong keys when I tried to take a snap of this menu by using Command+shift+4 key. The Force Quit... becomes Force Quit Finder with extra key shift. Manu shortcut keys are very handy. This Apple support web page lists Mac shortcut keys.

To relaunch Finder in command scripts, you can use ps and grep to find the current Finder process id,

[MyMac]~ [user]$ ps -ax | grep Finder
2357 ??     0:00.21 /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder


and then use Kill and Open to relaunch it (your Finder process id may be different):

[MyMac]~ [user]$ kill 2357 && open /System/Library/CoreServices/Finder.app


Notice, the application Finder is within the Finder.app package, and you just need to use package to launch it.

Saturday, December 19, 2009

Install Growl Extras: growlnotify

toolsI have Growl on my Mac for long time. I cannot remember when I got it. I think I installed it because it was recommended as one of must-haves. It is a notification application based on Growl Notification Protocol (GNTP). Many applications support GNTP and send notifications to Growl such as Browser, Mails, Chat, XMarks, ...

I am interested in script function to send notification to Growl. In this way, I have much more control in my OS to auto-generate notifications. Growl has growlnotify in Extra for this purpose. Here is the way to install it.

Download Growl to my Mac first (1.2 for this time). Growl-1.2.dmg is saved in my local ~/Download/ folder. Double click on this file from Finder, this one will be mounted a package or drive-like in Windows in my /Volumes/:

    /Volumes/Growl-1.2/

Since I have this already installed. I close the installation Finder.



Then open a Terminal and change the directory to the growlnotiy:

[MyMac]~ [user]$ cd /Volumes/Growl-1.2/Extras/growlnotify/
[MyMac]]:growlnotify [user]$ ls

The ls command is used to verify that there is install.sh file there. The script file contains installation scripts, you can use cat install.sh to display its content.

Run the installer script:

[MyMac]:growlnotify [user]$ ./install.sh

It will prompt to enter your root or admin password. After your correct password, the package will be copied to your /usr/local/bin and it is ready for use.

To test it out, type the following commands. First change the current path to your home. Then run growlnotify command:

[MyMac]:growlnotify [user]$ cd
[MyMac]:~ [user]$ growlnotify


Type anything, and press Ctrl+D to end the message. You should be able to see the message out to Growl right away. Here is an example:

[MyMac]]:growlnotify [user]$ growlnotify
ENter a notification description, following by new line, followed by Ctrl+D (End
of file). To cancel, press Ctrl+C.
This is my test notification to Growl!


Sunday, February 8, 2009

Rename Files Tool: NameChanger

toolsI posted a blog on some greate Mac software tools in Nov 2008. One of them is NameChanger.

Very often, I need to change names of picture or video files from camera or camcorder to my Mac. This tool is a great one to rename files. Here is the interface of NameChanger:



It provides a wide range of options to rename files and they are good enough to accomplish my need.


For example, the first step I do is to use the Sequence option to rename the entire names to files with sequence numbers and a proper extension name such as .dv. The Sequence has additional options available from a window:


After that, I then use the Prepend option to add whatever prefix words at the beginning of the files. Just two actions to rename files in the format I need.

Saturday, January 31, 2009

Audio CD Ripper Tool: Max

Today, I tried to do recording from my audio CD by using Audacity and could not figure out a way to record from internal device. From Audacity, I only have option to record from Mac's microphone.

The another alternative is to find out a ripper application. I found one called as Max. This is the one I need for my job and it does the job well. Here is the interface of the program:



Before you rip tracks, you should set up your output format and directory first. What I did for the format is mp3 from the Max->Preference..., then Format tab. Add available output formats first (select and then + button). In the upper panel, make sure the output formats are checked. The Output tab is the location for ripped files. You can change it from default Audio to anywhere you like.

Now it is ready to go! Click on Encode tool button. The ripper process window is displayed:



Nice thing is that the Max is free!

As usual, for the installation, I put the decompress folder (Max-0.8.1) to MyApplication folder where is the tools I use (I separate them from Mac's default applications). The next thing is create an alias of Max.app and put it to my Utility folder on the Dock. In case I have not used this tool for a while, I can always find them from my Dock. Even Mac's Spotlight is great to find application, you may not recall the name of program you need.

Tuesday, January 27, 2009

Mac Mouse Cursor Location Tool

Finally, I found a very nice mouse locator tool by 2Point5fish.com It is free! It is specially useful for demo or show cases.

The tool come with configuration in system preference in other area. It is easy to configure. I use F5 key to toggle it and set it indefinitely when it is on. Here is the example of the mouse locator:



From the provider's web site, you may find out more different cursors for use and instructions available as well.

Saturday, November 15, 2008

Great Free Mac Applications!

As I mentioned in my previous blog, UsingMac.com's new blog on 100+ Free Applications for Mac lists a wide range of great Mac applications. I have already used some.

I just browsed some of them and found some really attractive:
  • Sytem Tool: Onxy for cleaning system
  • Sytem Tool: Loginnox to change Login background.
  • File Management: Punakea to add tags to files.
  • File Management: NameChanger to rename files with easy UI.
  • Social Network: Syrinx to make Twit easy on desktop.
  • Porgramming IDE: NetBeans to provide IDE for multi programming languages in Windows and Mac.
  • Image Editor: Seat Home 3D Design is actually a cool application for home design with 3D view.


I have not install all of them. Just a peak of them I am very impressed with their features and UI.

Web Browser Not Responding

Recently, I have experienced some problems to browse some web sites such as gmail and cnet news. For the gmail, I could not do anything when I logged in, no mater what browser I am using: Safari, Firefox or Fluid. I also tried it in different account. It looks like a system issue. For CNET News, my browser FF does not respond any more when it is opened.

I had to Fore Quite them from Apple menu. It is quite annoying! Then I tried to find out a way to resolve the problem. I tried to google "Mac Browser Not Repsonding" but I found no direct solutions. However, some forums and Apple support page do provide some relevant suggestions. Basically, the problem might be caused by some plug-ins those web sites are using, web sites with some embedded JavaScript trying to detect if client side is active, or Java version issues.

I would not like to reinstall my applications to get them back to work. For Safari, I just cannot do it! Reinstalling OS would be the way back to Windows. Restore from Time Machine might be the last resolution. Those problems are just caused from those web pages. I can still use my browser to majority of other sites.

Anyway, cut it in short. I get my browsers back to those web sites. For CNET News web page, I know it is FF issue. I understand that the cache for FF is not critical. To remove cache from FF's Preference does not work. You have to do it from Finder. Locate the cache in ~/Library/Cache/Firefore/Profiles/[profile]/Cache, where [profile] may be different for each account. In my account it is "t896s3zg.default". ~/ is the home directory of your account. I did is to remove this Cache content. After it, I don't have any problem to CNET News. I think CNET News web page uses Adobe Flash plug-in and update it without any any notice.

For gmail Not Responding problem, it is much harder. It may be something located in /Library/Caches. I would not removing its content unless I know what I am doing. What I did is to use system cleaning tool: Onxy. This tool is recommended by UsingMac.com blog recent article: 100 Free Applications for Mac. This is the tool which helps me to resolve the issue. I installed this one and use its Cleaning:



This is really great tool to clean my system. I just use the default cleaning settings. I did realize that the content of /Library/Caches/ has been cleaned after the running. One thing I have to do is to restart my Mac to get the problem of Not Responding out!

Saturday, November 8, 2008

Set Screen Saver with a Shortcut Key

I got a very impressive screen saver from Wakaba's web page. The screen saver has so many options to select:



One question I have immediately is that how I can use shortcut key to invoke the screen saver? Unfortunately, Mac does no have a key available right from OS. However, this can be done in many other ways. I don't like hot corner from System Preference/Screen Saver. I often get my mouse jump around to a corner to activate it. I need a key like Windows Ctrl-Sht-Del key like.

Bran Halmkamp posted a nice blog on this topic. What he did is to create a link to the screen saver program (far away in /System/...) in a Terminal, and to add trigger to the link by using Quicksive's Trigger.

Here is the command to create the link:
$ sudo ln -s /System/Library/Frameworks/ScreenSaver.framework
/Versions/A/Resources/ScreenSaverEngine.app/ /MyApplications/Screen\ Saver.lnk

I would like to add some comments to the command:
  • sudo is a command to allow the supperyser to execute the following command.
  • ln -s is a command create a symbolic link from source to target.
  • the '\' in the target is the a scape key to allow a space in the target link file name, so that 'Sacreen Saver.lnk' is created in the folder "MyApplications"

I think that I mentioned in my previous blog that I have created a MyApplication folder in the root. This is folder where I put all the applications I found from Web or other sources. They are not part of Mac OS Applications.



The last step is to define a hot key in Quicksilver's Triggers. This can be done by adding a new one and drag the link file to the Command column. Finally assign a key to the trigger.

This is a really great experience to bring my UNIX commands back. If you cannot remember or don't know the command, you can always get manual information by the command man [topic].

Tuesday, November 4, 2008

root user: Equivalent of Windows Administraor user

By default, iMac disables root user for none-Mac server OS. I did not realize it. I thought my name has administrator privilege. But it is not always true. For example, my user name account cannot access to other user's account data or folder.

When I tried to learn to write Dojo web application with PHP server, I encountered one problem. My PHP server by default was not available. It was not loaded by Apache. I found out that I have to change httpd.conf file in /private/etc/apache2 to remove the comment out for the line of loading PHP module.

I tried to use VIm to modify this file, but I could not save it. The file is actually owned by "root" user, which is equivalent Windows Administrator user. On Apple's web site, there is one page about how to enable root user.

The steps are very simple. I followed the instruction, logged out. Then I see "Others" in the log-in list. Type "roor" and the password, I can log in to the root account. As a root user, you can access all the files, including httpd.conf file I mentioned above. I made a change, and logged in to my account again. My test php page is working as expected.

This information is not intended for normal users. As a programmer, you may need this to configure the system. In this sense, iMac OS is very secured OS.

Sunday, November 2, 2008

Zip Quick Look

By the default, iMac does not display the content of a zip file when you use Quick Look to view it(select a file and then press space key). I found a tool to do the job, called as Zip Quick Look PlugIn.

To install it, download Zip.qlgenerator.zip first. Unzip the file. Copy or drag the Zip.generator to /Library/QuickLook/, make a QuickLook folder if you don't have one.

Then restart the Finder. Here I learned a new tip to restart Finder:
  • locate the Finder in Dock,
  • press Ctrl+Opt+click or Opt+right click;
  • you will see a list of context menu, and select Relaunch.

It will relaunch Finder. Now you should be able to view the content of a zip file.

Show/Hide Hidden Files

In Unix system, you can make files/folders as hidden by using . before a file/folder name. iMac is Unix based OS, so there are many files/folders are arrange in this way.

The problem is that by default, hidden files/folders are not visible in Finder. Then if you want to view or copy a file to a hidden folder, you have to go to Terminal to use cd to the folder. For example, I obtained a Vim plugin and need to install it to from my download folder to the .vim/pugin foler. I can't do it in the Finder. In Terminal, I have to know the name of download folder which is very long. I need something to enable Finder to show hidden files/folders.

I found one from web: Show/Hide Files.app. The program is very simple to use. From Spotlight(Command+space, type Show), you launch the program. Here are some snapshots of the application:

You have option to show or hide hidden files. After you make your choice(show for example), you will see the second window.



Normally, you should select "Restart Finder" to take the immediate effect. This will restart Finder to make hidden files visible. Click the last window to close the application.

The last picture shows an example of my .vim/plugin folder in Finder.

Saturday, November 1, 2008

VIM The Best Editor

I just started to learn VIM. It is the best text editor. The main reason I need a good editor is that I am doing programming in both Mac and Windows platforms. VIM can handle the text files in both system very well.

VI has been used for so many years. It was started as UNIX text editor. Its UI interface looks very simple and plain. I remembered that when I first used UNIX or IBM ACS system, I was lost the first time in VI. I was told that VI is very powerful tool and programmers just love it when they know how to use it. However, I have never got chance to learn it. One thing about VI is that it is a Muscle Memory tool.

Anyway, I am convinced to learn it since I started to use VIMPERATOR add-on for Firefox. I love it so much. I have to admit that it takes some time to learn it. However, when you know and memorize most common keys, it is so convenient with keyboard. You don't need mouse.

VIM is a Vi Improved text editor. It brings more power to VI. After about 2 weeks using, I just used a iceberg of its power. I am totally convinced that it is the tool as a program cannot be without. There are still many things to learn. I think when I repeat these commonly used features, my programming work will be more productive for sure.

Monday, October 27, 2008

FTP: CyberDuck

I found a ftp program for mac: CyberDuck. It is a very nice program, as far as my first experience. I wanted one for transferring files between my iMac and my internet' web page. I can use it to transfer files and create folder easily.

This program is an open source project, therefore, free!

Saturday, October 11, 2008

Firebox Add-ons

This is a great tool add-on for Firfox. I just added this one to my favorite add-on list.

I watched one of Asp.Net MVC tutorial shows: #7 ASP.NET MVC Storefront Part 7: Routing and UI Work, where FireBug add-on was mentioned along with one feature for the New IE. Since I use Mac most of time, I went to FireBug page and downloaded the add-on. It is so great! By clicking on FireBug button on the bottom status bar, you will see a panel view of FireBug:

Actually, it is not only for developers to use it. None-developers may use it for many cases. For example to copy some text in a linked text. There are many other tools can do the same thing, but this is an example you may extend to do other similar things.

First, you click on "FireBug" icon on the status bar, as marked as green 1. Then you can see the view of FireBug panel. Click on Inspect as marked as 2. Hover the web page, you will see selections and responding tags in the Firebug. Click on a selection, the Inspect is toggled off. Finally, you can expand the view in HTML to find the text you want to copy. Isn't FireBug a great add-on!

Monday, September 29, 2008

SQLite and SQLite Database Browser

SQLite is an excellent Opensource database. Today, I tried it in my iMac. It is pre-installed in my iMac. In a Terminal console, you just type sqlite3 . Then you are in SQLite with the database opened.

You can use create table, select, insert SQL statements to create table, select data from a table and insert data to a table. There are some internal commands to view tables and schema such as .table .schema. There are more information in the SQLite web page's document.

I prefer to use a UI tool to manage my database. There is one called as SQLite Database Browser. It is very simple but provides all the functions for creating tables, browsing data with editing and deleting rows, and modifying tables. I really like this tool. I think this one is also available for Windows.

SQLite's database is file based database. You can use SQLite console or browser to create a database. The file is binary file. Apple's Objective-C provides framework APIs to SQLite database and it is also available for iPhone development SDK called as libsqlite3.0.dylib. I think .Net must provide framework classes for SQLite as well.

I can see there are many great potential uses for SQLite. The database file is a SQL database. It can handle massive data with great performance. I think I'll use it in my applications.