How to make a link to a random file from a folder in Linux?

0 like 0 dislike
8 views
I have a images folder, the files in it 0.jpg, 1.jpg, ...
As can be done, for example, the link /home/user/image.jpg were given a random image from a folder?
by | 8 views

1 Answer

0 like 0 dislike
the reference to file "hard", i.e. exactly pointing to a particular file. i.e., to a random file via FS just does not work.

you can get the file name, causing the script to bash via " , which will generate the name with the required name, or to give content to calgonit file.
generate a random number from a range is done in shuf
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
7 answers
0 like 0 dislike
1 answer
asked May 21, 2019 by catquistador
0 like 0 dislike
2 answers
110,608 questions
257,186 answers
0 comments
33,856 users