Skip to content

Instantly share code, notes, and snippets.

@vipulgupta2048
Created July 30, 2019 12:37
Show Gist options
  • Select an option

  • Save vipulgupta2048/5b2f321468fd69941997575e54105914 to your computer and use it in GitHub Desktop.

Select an option

Save vipulgupta2048/5b2f321468fd69941997575e54105914 to your computer and use it in GitHub Desktop.
[Homework] Creating your own copy util for Linux Distributions
#!/usr/bin/env python3
import sys
import shutil
arg = sys.argv
source = str(arg[1:2])[2:-2]
dest = str(arg[2:3])[2:-2]
print("Source location of the file is {}".format(source))
print("Destination of the file {}".format(dest))
new = shutil.copy(source, dest, follow_symlinks=True)
print("copying ......... DONE!")
print("Files have been moved to {}".format(new))
# instructions: Copy file to /bin directory, run command `sudo chmod 777 vipulcopy` to use this as a command in the terminal
# Author: vipulgupt2048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment