Answer the question
In order to leave comments, you need to log in
How to use result of ls command in mv command?
I'm looking for a way not to use the mouse when renaming files.
This is usually done like this:
ls *.txt
mv somelongfilename.txt shortname.txt
Answer the question
In order to leave comments, you need to log in
The file name does not have to be copied at all, it can simply be typed from the keyboard.
And for mass renaming in Linux there is a rename command .
If there is only one file:mv `ls -1 old_mask` new_name
why do you need ls at all? Write a small bash script and that's it
for i in `ls`;do mv $i 123${i}; done
will add 123 to all files in the directory in the name
I don’t know how much easier this option is, but 100% convenient https://github.com/mooz/percol
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question