Open a terminal and execute this command:
mv -v ~/Downloads/* ~/Videos/
It will move all the files and folders from Downloads folder to Videos folder.
To move all files, but not folders:
If you are interested in moving all files (but not folders) from Downloads folder to Videos folder, use this command
find ~/Downloads/ -type f -print0 | xargs -0 mv -t ~/Videos
To move only files from the Download folders, but not from sub-folders:
If you want to move all files from the Downloads folder, but not any files within folders in the Download folder, use this command:
find ~/Downloads/ -maxdepth 1 -type f -print0 | xargs -0 mv -t ~/Videos
here, -maxdepth
option specifies how deep find should try, 1
means, only the directory specified in the find command. You can try using 2
, 3
also to test.
See the Ubuntu find manpage for a detailed explanation
Execute:
find -type f -name "specificFileName" -exec sed -i.bak 's/foundWord/replaceWithWord/' '{}' \;
This will only replace first seen 'foundWord' with 'replaceWithWord', in case you wanted to replace all these 'foundWord's add sed's "g" enabler to having replace all seen
find -type f -name "specificFileName" -exec sed -i.bak 's/foundWord/replaceWithWord/g' '{}' \;
note: This will copies the 'specificFileName's as their backup files and name them with "specificFileName.bak", by dropping the "-i.bak" you will tell 'sed' to inplace replace,
Best Answer
You can use
locate
or
find
For locate the system has to build a database of files. If the database is not built it will not find anything. Also if you add new files they will not be found until the database is updated again. You can updated the database with
updatedb
.