Linux: change location of hidden file/folder

This commit is contained in:
Shreya 2020-06-21 01:06:45 +05:30
parent eea5352084
commit 87bfe41c50
1 changed files with 11 additions and 11 deletions

View File

@ -1,35 +1,35 @@
HIDDEN_FILE = '/var/tmp/.monkey-hidden-file' HIDDEN_FILE = '$HOME/.monkey-hidden-file'
HIDDEN_FOLDER = '/var/tmp/.monkey-hidden-folder' HIDDEN_FOLDER = '$HOME/.monkey-hidden-folder'
def get_linux_commands_to_hide_files(): def get_linux_commands_to_hide_files():
return [ return [
'touch', # create file 'touch', # create file
HIDDEN_FILE, HIDDEN_FILE,
'&&' '&&'
'echo \"Successfully created hidden file: {}\" |'.format(HIDDEN_FILE), # output 'echo \"Successfully created hidden file: {}\" |'.format(HIDDEN_FILE), # output
'tee -a', # and write to file 'tee -a', # and write to file
HIDDEN_FILE HIDDEN_FILE
] ]
def get_linux_commands_to_hide_folders(): def get_linux_commands_to_hide_folders():
return [ return [
'mkdir', # make directory 'mkdir', # make directory
HIDDEN_FOLDER, HIDDEN_FOLDER,
'; touch', # create file '; touch', # create file
'{}/{}'.format(HIDDEN_FOLDER, 'some-file'), # random file in hidden folder '{}/{}'.format(HIDDEN_FOLDER, 'some-file'), # random file in hidden folder
'; echo \"Successfully created hidden folder: {}\" |'.format(HIDDEN_FOLDER), # output '; echo \"Successfully created hidden folder: {}\" |'.format(HIDDEN_FOLDER), # output
'tee -a', # and write to file 'tee -a', # and write to file
'{}/{}'.format(HIDDEN_FOLDER, 'some-file') # random file in hidden folder '{}/{}'.format(HIDDEN_FOLDER, 'some-file') # random file in hidden folder
] ]
def get_linux_commands_to_delete(): def get_linux_commands_to_delete():
return [ return [
'rm', # remove 'rm', # remove
'-r', # delete recursively '-r', # delete recursively
'-f', # force delete '-f', # force delete
HIDDEN_FILE, HIDDEN_FILE,
HIDDEN_FOLDER HIDDEN_FOLDER
] ]