Yes, you can move specific files using the mv command by specifying the filenames you want to move. Here’s how you can do it:
-
Open your terminal.
-
Use the
mvcommand followed by the names of the specific files you want to move and the destination directory. For example, to movefile1.txtandfile2.txtfrom the current directory to a directory namedtarget_directory, you would use:
mv file1.txt file2.txt target_directory/
Notes:
- Ensure that the destination directory exists; otherwise, you'll get an error.
- You can also use wildcards to move files that match a specific pattern. For example, to move all
.txtfiles, you can use:
mv *.txt target_directory/
This command will move all files ending with .txt to the specified directory.
