How to find the path for iCloud folder on MacOS Big Sur - filepath

I am trying to find the path for iCloud folder, some people suggested ~/Library/Mobile\ Documents/com~apple~CloudDocs/ but I couldn't find that directory.

That is the correct directory. You can't open it with the Finder (although it is the directory the Finder will show as iCloud Drive).
If you start Terminal, you can:
cd ~/Library/Mobile\ Documents/com~apple~CloudDocs/
then run
ls -l to see the contents.

Related

How to restore a deleted Jupyter notebook file

I accidentally deleted a jupyter notebook file on my Google Cloud instance. I wonder if there's anyway to restore/recover the file?
Thanks to this link, I found the solution. Files deleted in the browser should probably be in a Trash folder. In my case and on my Google Cloud instance, the deleted files were in the following path.
cd ~/.local/share/Trash/files/
By using ls, list the files and see if your file is in this folder. If yes, then simply using the mv command you can move your deleted file to the path you want.

How to fix "warning: could not open directory" after "git add ." command on Mac OS X Maverick

I'm new to R and RStudio and am currently taking online classes to learn more about data science. In one of my lectures, I'm being asked to create a project in RStudio prior to creating a repository in github and linking the project with git. In order to make a pre-existing project interact with git, the instructions in my lecture are telling me to navigate to the directory containing my project file by using the "cd" command followed by the location of the file and file name. My project file is currently located on my desktop so I typed in "cd ~ /Desktop/temporary_no_version_control" however, the directory doesn't seem to change and remains set on the original location of the file which was in Users/savannahkeiffer. Just so I could complete the assignment, I re-located the file to my user file and tried to follow the rest of the instructions which told me to type "git init" followed by "git add ." which is where I run into the "warning: could not open directory" warning.
I have a macbook which runs on OS X Maverick. I went into my system preferences > security and privacy and selected Full Disk Access where I manually allowed terminal to have access to all the files on my laptop. However, after closing and re-opening RStudio and attempting the commands again, I got the same error.
This is what I entered when I tried to change the directory
Savannahs-MacBook-Air-2:~ savannahkeiffer$ cd ~
/Desktop/temporary_no_version_control
Savannahs-MacBook-Air-2:~ savannahkeiffer$ git init
Reinitialized existing Git repository in
/Users/savannahkeiffer/.git/
And what I got when I changed the location of the project on my laptop in order to complete the assignment (after already giving access to terminal)
Savannahs-MacBook-Air-2:~ savannahkeiffer$ cd ~
/Users/savannahkeiffer/first project/temporary_no_version_control
Savannahs-MacBook-Air-2:~ savannahkeiffer$ git init
Reinitialized existing Git repository in
/Users/savannahkeiffer/.git/
Savannahs-MacBook-Air-2:~ savannahkeiffer$ git add .
warning: could not open directory 'Pictures/Photos
Library.photoslibrary/': Operation not permitted
warning: could not open directory 'Library/Application
Support/MobileSync/': Operation not permitted
warning: could not open directory 'Library/Application
Support/CallHistoryTransactions/': Operation not permitted
warning: could not open directory 'Library/Application
Support/com.apple.TCC/': Operation not permitted
warning: could not open directory 'Library/Application
Support/AddressBook/': Operation not permitted
And so on.. Is this a directory problem or a "git add ." command problem?
It looks like what happened is that when you typed the cd command, you left a space in between the tilde and the rest of the path, so you changed back into your home directory (represented by the tilde). Then, when you tried to do a git init, you tried to initialize your home directory as a Git repository, and then ran into the fact that macOS restricts some programs (in your case, not Terminal, but maybe still Git) from accessing certain directories.
In the shell, the tilde is just a fancy way of spelling the environment variable $HOME, which points to your home directory (in this case, /Users/savannahkeiffer), so it should immediately precede the rest of the path without a space in between.
The best thing to do in this case is switch into your project directory and then initialize a repository there:
cd ~/Desktop/temporary_no_version_control # note the lack of space after the tilde
git init
If you didn't intend for your home directory to be a repository (i.e., you're not storing your dotfiles in a repository there), then you will probably also want to remove the .git directory from your home directory by running rm -fr ~/.git. Be careful when typing this, as rm removes data without prompting and an unfortunate space could result in all your data being deleted.
Hello this was an issue I had also but in Windows. It was a simple fix, user error. I hadn't used gitbash for awhile so I forgot the process with working in gitbash. First mistake I made was after opening gitbash I directly executed the git status command. That's when I got the "warning: could not open the directory" message. You need to using the cd (change directory) command and the dir (directory) command to navigate to the folder that has the files you want to "git add ." and "git commit -m". Once you get to that folder you will be able to use the "git status" command to see your changes then proceed as normal. I had to post this because it took me hours before I realized what I was doing wrong. No other stack post pointed this obvious user mistake. Hope it helps you.

How to share/transfer an Atom installation (packages and settings) from one Mac to another?

Is it possible to copy Atom from one Mac to another, including all installed packages, settings etc?
There are several ways to synchronize your settings and packages between Atom installations:
Git: Create a public or private Git repo and store the contents of your local ~/.atom folder in there. Ignore the following files/directories in a .gitignore file:
storage
compile-cache
dev
.npm
.node-gyp
Use a package like sync-settings. This will store your configuration in a GitHub Gist.
Dropbox (or similar): Move your ~/.atom folder to your Dropbox folder and then symlink it from there to its original location. This has the downside of syncing everything in ~/.atom, even the things you could ignore.
Use stars to select your favorite packages. On the Atom web site, create an account and mark your favorite packages with stars. Then use apm stars --install to install all starred packages on any machine. Downside: This only works for packages, not for settings.
More details:
https://discuss.atom.io/t/syncing-settings-packages-between-machines/1385
As a user who uses a dotfile management system such as RCM, I prefer independent config files.
For now, Atom doesn't officially provide a packages.cson file to manage plugins, but as the post Syncing settings & packages between machines mentioned, there is a plugin called package-sync that will generate a packages.cson file for us.
So with the help of package-sync, now I can just sync those mininal config files to have my Atom settings and packages consistent across multiple machines.
This is how to do it (Use ubuntu as an example):
Install Atom, and install package-sync through Edit-->Preferences-->Install as the screen shot shows:
Open your command pallete and type: Create Package List and there will be a packages.cson file under your ~/.atom folder.
Edit the gitignore file:
$ gedit ~/.atom/.gitignore
Make sure the content is:
blob-store
compile-cache
dev
storage
.node-gyp
.npm
.apm
packages/
atom-shell/
This is a screenshot of the .gitignore file:
This makes sure the content downloaded by Atom from the Internet will not get synced to your dotfiles repo.
Move the .atom folder to the dotfile repo:
$ mv ~/.atom ~/dotfiles/tag-atom/atom
Relink the folder:
$ ln -s ~/dotfiles/tag-atom/atom ~/.atom
Or if you have rcm installed:
$ rcup
Now go to another machine, and install Atom and package sync. Update your dotfiles repo, and then Open your Atom command pallete and type: sync
Now your Atom settings will get synced and integrated with the RCM dotilfe management system.
This is the files in my ~/.atom folder that get synced:
I recently built a package that syncs automatically your Atom settings and packages across multiple computers. A little bit like the bookmark synchronization mechanism in Google Chrome. It's called atom-package-sync. Maybe it could fit your needs.
You can sync your packages via package-list.txt file and a simple shell script.
Create the package-list.txt file
apm list --installed --bare > package-list.txt
Install missing packages on another host
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
INSTALLEd_PKGS=$(apm list --installed --bare)
for PKG in $(cut -f1 -d# $BASEDIR/package-list.txt); do
grep -q $PKG <<< $INSTALLEd_PKGS || apm install $PKG
done
The .atom folder contains the packages folder, which can be rather huge. Unfortunately OneDrive doesn't allow you to exclude folders, so I went with a git option.
I excluded the packages from git and instead I committed a text file containing my packages (my-packages.txt).
To re-install packages I need to run: apm install --packages-file my-packages.txt.
To generate the my-packages.txt, I need something like this on a Bash shell: ls packages | xargs -n 1 echo | cut -d/ -f1 > my-packages.txt
I sync my Atom settings between Windows, macOS, and Linux machines using Resilio Sync Home. It is free and the files are not saved on the "cloud" (like Dropbox or Gists), but it requires that, at least, two machines are online in order to sync the current settings.
I do not want to sync caches, installation specific settings, et al., I update the .sync/IgnoreList file that is created in the synced directory (i.e., the ~/.atom directory). Unfortunately, you will have to update this on each machine that you sync (ironically, the IgnoreList file is not synced). By default, the file specifies various temporary files to be omitted from syncing, so you'll need to add the following:
## Atom-specific
/packages/node-debugger/debugger.log
\packages\node-debugger\debugger.log
/.apm
\.apm
/.node-gyp
\.node-gyp
/.npm
\.npm
/blob-store
\blob-store
/compile-cache
\compile-cache
/dev
\dev
/recovery
\recovery
/split-diff
\split-diff
/storage
\storage
Some of the omitted directories are package-specific (e.g., split-diff). Because Windows has different path delimiters than other platforms, I need to specify both(!!)
Install Resilio Sync Home on your first machine
Add the .atom directory to Resilio to be synced.
Update its IgnoreList file, as shown above. Save this file for the other machines you want to sync with.
Send a Resilio "Read & Write" link of that folder to the other machines you want to sync with or copy the "Read & Write" key to be used on the other machines. To do this, in Resilio's folder view, click on the .atom folder's menu (vertical dots on the right edge) and select "Copy Read & Write key". Save it for later.
Then on your other machines,
Install Resilio Sync Home
Create .atom/.sync
Copy the IgnoreList from your first machine to that directory
Add the .atom directory to be synced with the other machine. You should add the folder using "Enter key or link," then enter the key you copyed, above.
Wait until syncing is done before opening Atom. The first time will may take a few minutes.
Now I don't need to go around installing/removing packages on every machine, separately!
FYI: Changes to files and directories are saved in .sync/Archive, for some period of time, if you should need to recover them.

Why a folder name is different in Windows Explorer than command line or cygwin?

I have been using Robocopy to backup my computer files. I have been using the following command:
robocopy C:\Users\ J:\backup\ *.* /a /XD AppData /XJD /R:0 /s
When I look into my J drive in Windows Explorer I see folder named J:\Users\ but when I use dir from the command line I see a folder named j:\backup. The backup and user folder seem to be the same. I also tried looking at the content of the J drive in cygwin and see the backup folder but do not see a Users folder. What is going on? Is robocopy the culprit?
Just go into the backed up folder and delete the desktop.ini file. The folder name will revert back to the directory name. You copied the desktop.ini file from the source "users" folder that is causing the issue. You can and desktop.ini to your exclusions list with out any issues to your back up. They get created on the fly anyway if they are not present.
I tested this on a windows 7 pro machine just to verify.
The problem is not related to robocopy. The link below describes the problem.
https://superuser.com/questions/381110/windows-explorer-sees-different-file-name-from-cmd/381159#381159

XCode 4.3.2 - How to change repositories

My project is currently stored on a remote SVN server. I need to move that project to a BitBucket git server. I've already added the repository to XCode but how do I move the project over?
Not entirely sure if this is the correct way to do it, but here's how I accomplished it:
You can either copy the project to a new location or update the existing project. I choose to make a copy. I also went ahead and moved the projects to the local path for the new repo.
In Xcode - Open the Project and go to File - Source Control - Hide Remote Status
The go to File - Source Control - Repositories and remove the SVN repo.
Close the project
Using Terminal, show all hidden files.
Using Finder, go to the project directory and remove all of the .svn files (include those bundled in the project file. (There has to be a better way to do this step)
I committed the cleaned project and files to the new repo.
Open the project in Xcode.
Xcode should have already picked up on the new repo and you should be ready to go.
RE: (There has to be a better way to do this step)
Open Terminal
Navigate to the root of your local working copy
At the terminal command prompt, enter: find . -type d -name '.svn' -print -exec rm -rf {} \;
Hit enter to delete all '.svn' folders in and below the working copy directory

Resources