假设我有这样一条路
/x/xx/file我想同时将/x/子文件夹中的所有文件移动到/x/。这个是可能的吗?
我在Ubuntu 16.04。
子文件夹有不同的名称,我希望将子文件夹中的所有文件,无论深度如何,都移动到/x/。另外,我可能会在/x/中拥有不存在于任何子文件夹中的备用文件。无论如何,任何文件都不应该超出/x/。
发布于 2017-04-11 10:44:23
移动到目标文件夹并执行:
find . -mindepth 2 -type f -print -exec mv {} . \;使用-mindepth 2,它将在不包括当前目录的情况下递归搜索。
发布于 2020-06-17 14:35:49
这取决于子目录的数量。
mv */* .发布于 2023-04-15 11:28:05
这个python脚本应该在windows上完成以下工作:
import pyautogui
import keyboard
import time
# Pause for a few seconds to give you time to switch to the window you want to automate
time.sleep(10)
print("10sec")
while True:
pyautogui.press('enter')
print("Pressed Enter key")
time.sleep(1)
pyautogui.hotkey('ctrl', 'a')
print("Pressed Ctrl+A keys")
pyautogui.hotkey('ctrl', 'x')
print("Pressed Ctrl+X keys")
pyautogui.press('backspace')
print("Pressed Backspace key")
time.sleep(3)
pyautogui.hotkey('ctrl', 'v')
print("Pressed Ctrl+V keys")
pyautogui.press('delete')
print("Pressed Delete key")
time.sleep(1)
pyautogui.press('enter')
print("Pressed Enter key")
time.sleep(1)
pyautogui.press('right')
print("Pressed Right Arrow key")
pyautogui.press('left')
print("Pressed Left Arrow key")
# Listen for the Esc key press and stop the script if detected
if keyboard.is_pressed('Esc'):
break注意:它还删除子文件夹。
https://unix.stackexchange.com/questions/358284
复制相似问题