Linux command: move all files and folders in the current folder to a new folder under the current folder.

for example, the file structure is as follows:

file1
file2
directory/file3
directory/file4

now move all the above files and folders to a new folder newDirectory . How does the command line implement?
filenames may be irregular filenames, and there may be a large number of them.

Mar.26,2021

if it is bash (other shell is not clear), directly mv * newDirectory/ . Because when mv newDirectory newDirectory is executed, an error will be reported that it cannot be copied, but ignore this error


you execute mv * / home/test/ directly under your current directory, as long as you have this test directory. In this way, all the current files will be moved to


sudo mv file {1pm 2} directory* newDirectory/

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e4bec8-4d20d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e4bec8-4d20d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?