Move A File In Linux

Move A File In Linux – Hello friend, after a long time finally had time to write again. This time I will share about tips and tricks on how to move on Linux.

The one I like from Linux is the command line. We can type certain commands to do something faster, such as copying files and folders in bulk from one folder to another.

For Linux users, especially the system administrator, you will definitely use Command Linux (Terminal) very often. It’s good for server monitoring, maintenance, deployment, installation, etc. Moreover, if Linux is used for Servers, then almost all of these Linux servers do not use GUI, aka the linux Full console (console).

The next question is whether the linux console can do management files such as moving, deleting, deleting, etc.? Then if you can whether it can be the same as Windows, we move files based on what we want, for example we want to move files / folders just last year, or just have a letter, etc.?

Of course you can. Next, I will discuss some linux command lines related to how to move files. Check out the Move A File In Linux tutorial, below:

Move A File in Linux

1. Move all files or folders in a folder to another place

mv / root / location for your desktop / * / folder / destination / you /

For example you have many files in the folder / home / yupi / Downloads / and want to be moved to / root / destination /, then the command is as follows:

# mv / home / yupi / Downloads / / root / destination /

2. Move files or folders with certain extensions

mv /root/lokasifolderanda/*.jpg / folder / destination / you /

For example, if you want to move the folder that has the extension .png le folder / root / destination /, then the command is:

# mv /home/yupi/Downloads/*.png / root / destination /

3. Move files or folders that have certain characters in the subject

mv / root / locale soldered / * character * / folder / destination / you /

For example, you want to move the file in / home / yupi / Downloads / which has the title having the words TahuBulat in the title, whether it’s in the middle, the beginning, or the end of the name. And want to be moved to / root / destination /. Then the command is as below:

# mv / home / yupi / Downloads / * Know Round * / root / destination /

4. Move files containing certain words

grep -rli <your match pattern> * | xargs mv -t <target directory>

For example, you have a lot of Notepad files in / home / yupi / Downloads / but you want to move files that contain the contents of the word “I’m handsome”, then the command is as follows:

# grep -rli “I’m temanteng” * | xargs mv -t / root / destination /

5. Move the file or filder based on the time of modification

find / location / folder / you -mtime -60 -exec mv -t / root / destination / {} +

Suppose you have lots of files in / home / yupi / Downloads / but you want to save the file for 30 days back. Means files that are longer than 30 days will be moved to / root / old-files /. Then the command:

# find / home / yupi / Downloads / -mtime -60 -exec mv -t / root / old-files / {} +

So sharing about Tips on Moving Files on Linux, hopefully useful for readers. if you forget to share with friends in need so that it can be useful for many people. Good luck with the tips and tutorial on Move A File In Linux, which we have given. Hopefully it can help you and be useful.