terminal - Is it possible to write a bash script that changes the current directory to a random one? -
of course there little no point this, idea struck me today , haven't seen on it. suppose exercise on efficiency, if consider every directory under (/).
first idea comes mind:
pipe recursive ls command file, use wc count number of lines, generate random integer , use pick line file created.
ls -r / >> file_list.txt count=$(wc -l file_list.txt)
etc. can here.
Comments
Post a Comment