Page 1 of 1

How to make a copy and delete command line.

Posted: 28 Dec 2016, 23:03
by Jack
How would I do this?

Copy this ALPM_DB_VERSION. from /mnt/sdb1/var/lib/pacman/local/ALPM_DB_VERSION to /mnt/sdb2/build/001-core/var/lib/pacman/local.

And this?

Delete this when done ALPM_DB_VERSION from /mnt/sdb2/build/001-core/var/lib/pacman/local/ALPM_DB_VERSION.

And this?

Delete this when done /var/cache/pacman/pkg/*.pkg.tar.xz

I have never done this before I have use MC to do all of my copy delete and move.

I'm trying to building a script but not sure how to do it. So what would the command line look like?

Re: How to make a copy and delete command line.

Posted: 29 Dec 2016, 00:25
by Ed_P
copyanddelete.sh

Code: Select all

#!/bin/sh

cp  /mnt/sdb1/var/lib/pacman/local/ALPM_DB_VERSION   /mnt/sdb2/build/001-core/var/lib/pacman/local/

echo
echo Press Enter when ready to delete the files.
read

rm  /mnt/sdb2/build/001-core/var/lib/pacman/local/ALPM_DB_VERSION 
rm  /var/cache/pacman/pkg/*.pkg.tar.xz
Something like this what you're looking for Jack?

Save it in your /home/guest folder then in terminal mode make it executable with:
chmod +x copyanddelete.sh
then you can run it with ./copyanddelete.sh

Needless to say you can change the copyanddelete name to whatever is more meaningful to you.

Re: How to make a copy and delete command line.

Posted: 29 Dec 2016, 01:22
by Jack
Thanks ED_P that what I was looking for. When I get done I will post what I'm doing with it.