[英]linux: most recent file in a directory, excluding directories and . files
[英]Move directories Excluding file
我在目錄中有40個目錄和1個shell.sh文件。 我想將所有目錄移動到除shell.sh文件之外的其他目錄。 僅將40個目錄移至其他目錄,而shell.sh不會將其保留目錄移至同一目錄。 有什么解決辦法嗎?
轉到提到的目錄並在終端中運行:
find . -maxdepth 1 ! -path . -type d -exec mv '{}' destination_path \;
這也適用於名稱中帶有空格的目錄
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.