Deleting folder on my OS X 10.10.5 by executing a file - osx-yosemite

I have a list of files I want to delete on my mac, how do I automate this without entering each into the terminal with a
"sudo rm -r folderName"
Here is the list of folders:
/Library/Application Support/VMware
/Library/Application Support/VMware Fusion
/Library/Preferences/VMware Fusion
~/Library/Application Support/VMware Fusion
~/Library/Caches/com.vmware.fusion
~/Library/Preferences/VMware Fusion
~/Library/Preferences/com.vmware.fusion.LSSharedFileList.plist
~/Library/Preferences/com.vmware.fusion.LSSharedFileList.plist.lockfile
~/Library/Preferences/com.vmware.fusion.plist
~/Library/Preferences/com.vmware.fusion.plist.lockfile
~/Library/Preferences/com.vmware.fusionDaemon.plist
~/Library/Preferences/com.vmware.fusionDaemon.plist.lockfile
~/Library/Preferences/com.vmware.fusionStartMenu.plist
~/Library/Preferences/com.vmware.fusionStartMenu.plist.lockfile

You could use this in your terminal to remove the files you list and recursively clear out directories in your list.
while read p; do rm -r $p; done <list.txt
list.txt is a list of files/directories with each entry on its own line.
This will loop over that list and call rm -r with the file/directory name.

Related

How to automate commands on Cygwin

Hi I am looking to automate my file transfering to my Jailbroken iPhone over USB with a bash file. Which will launch the relay then do the file transfers
With this here I installed and successfully transfered files to my iPhone with cygwin but now I want to automate the file transfer.
First I need to start the relay with cygwin and those commands are required
cd pyusbmux/python-client/
chmod +x *
./tclrelay.py -t 22:2222
so I created a .sh file that does it but when I launch it cygwin gives me those errors
This is what should happen on the left and the result of the script on the right
How can I make cygwin open with thoses commands
In addition to be sure that tcpON.sh has proper line termination with d2u of dos2unix package:
d2u tcpON.sh
You should add a proper SHEBANG on the first line of your script
https://linuxize.com/post/bash-shebang/
#!/bin/bash
cd /cygdrive/e/Grez/Desktop
cd pyusbmux/python-client/
chmod +x *
./tclrelay.py -t 22:2222
You can use as base the Cygwin.bat and make a tcpON.bat batch file like:
C:
chdir c:\cygwin64\bin
bash --login /cygdrive/e/Grez/Desktop/tcpON.sh
Verify the proper cd command to be sure that you are always in the expected directory.
It is not the only way but probably the most flexible (IMHO)

How to access a WSL instance from another?

I am upgrading my WSL2 instance from Debian 10 to Ubuntu 20.04 LTS, because I need some newer packages.
How do I copy files and directories from Debian to Ubuntu, preserving the permissions and owner? (uid and gid are the same in the two Linuxes.)
Copying to windows first changes the permissions and owner of files.
explorer.exe also changes permissions and owner.
Preferably, I'd also like to avoid having to create a shared disk image file that I could mount from Debian and Ubuntu in turn.
I'd like something simpler, like accessing the second WSL instance directly from the first, e.g.,
$ cp -a <Debian>/myfiles/ <Ubuntu>/myfiles
Is this possible?
See also my similar question: How to access \wsl$\othercontainer\some\file from within a WSL container? where the short answer is:
sudo mkdir /mnt/othercontainer
sudo mount -t drvfs '\\wsl$\othercontainer' /mnt/othercontainer
ls -l /mnt/othercontainer/some/file
NOTE: It looks like symbolic links aren't supported.
Use tar. It will preserve all the file metadata.
In <Debian>, create myfiles.tar.gz:
tar zcvf myfiles.tar.gz myfiles
Copy myfiles.tar.gz to your windows drive e.g. with explorer.exe or with /mnt/c, and then copy myfiles.tar.gz to <Ubuntu>. In <Ubuntu>, untar it:
tar zxvf myfiles.tar.gz myfiles

How do I remove CLion-2016.2.3 completely from Ubuntu 16.04 LTS?

I had installed CLion(2016.2.3) IDE from CLion-2016.2.3.tar.gz file. I accidentally deleted the CLion-2016.2.3.tar.gz file and CLion-2016.2.3 folder(which I got after extracting CLion-2016.2.3.tar.gz). Now CLion isn't working. When I ran dpkg --list from terminal, CLion wasn't present in the output. I want to remove CLion completely(all its files, folders, dependencies, etc.(even the configuration files)). How do I remove it completely?
Run the following command in terminal to find all the directories and files containing clion in their name :-
$ sudo find . -iname "*clion*"
Then delete the directories and files you have found.
To delete directories/files, go to the location of that directory/file in terminal using cd and run the following command :-
$ sudo rm -rf DIRECTORY_NAME/FILE_NAME
Simple Steps are :
Delete the clion folder you have downloaded and extracted.
Remove cache in ~/. using the command : sudo rm -r ~/.Clion.
Also need remove settings: /home/user/.config/JetBrains
You need also to remove settings that are stored in ~/. directory. That's it for Unix/Linux.
All Clion's binaries are store inside the folder you deleted.
But Clion sets up preferences at first launch, and you may have a menu icon which is pointing nowhere.
I suggest you run something like find ~ -iname "*clion*" and investigate what is found. If you are using Gnome2 or MATE desktop you will certainly find .desktop files which are the icons you are looking for.
If you used snap to install you can uninstall using
sudo snap remove --purge clion

trying to download a dataset from a website

I am trying to download a dataset from a website but I can't download the whole folder .. I have to download each file separately which will need a lot of time. I am wondering if there is anyway to download the whole folder at a time??
The website link: http://www.physionet.org/pn4/eegmmidb/
Use wget with the -r switch to turn on mirroring.
This command will do what you want:
wget --no-parent -r http://www.physionet.org/pn4/eegmmidb/
It'll produce a mirror copy of everything from that directory on down.
These two for cycles run in bash should do it:
for S in S{001..109}; do
mkdir ${S}
cd ${S}
for R in R{01..14}; do
file="http://www.physionet.org/pn4/eegmmidb/${S}/${S}${R}.edf"
wget "$file"
wget "${file}.event"
done
cd ..
done

Forcedly update workspace in Accurev

Is there any command to update my workspace forcedly in Accurev, directly replace the local files with the backed files, and don't care about the conflict files, modified files and so on?
I really miss the cvs command cvs update -C -d
According to question, I have similar issues. Usually I just use following commands:
accurev update -9
accurev pop -O -R .
accurev update
No, you will need to run a few operations. You can create a script to force update your workspace.
Basically, you will generate a list of all the modified, kept, overlap, member files, then purge those files, then update your workspace.
Check out the stat section in the CLI manual.
What You can do is delete all the local files from the file system and then do a:
accurev pop -R <path to local workspace directory>
I had similar issue; First take a back up of existing workspace, then Delete all the files in the local work-space folder. Click update button on Accurev. All files will be re-loaded on the workspace.
If you just want to undo all changes you have done in the workspace:
accurev stat -R -m -fl . | xargs -n 1 accurev purge
You can use similar command with rm / accurev pop to force refetch from backend. You can also vary the flags, -m for modified, -k for kept, -a for all.