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

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
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 | 18 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

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,187 answers
40,796 users