There is a .tar.gz archive that is downloaded using wget . As a result, I have an archive in the folder. After I unpack this archive into another folder with the command
tar -xf myfile.tar.gz -C someDir I know that there will be only one folder in the archive, but I don’t know its name, since When packing, the name may change (for a version number, for example).
Question: How can I write the name of this unpacked folder into a variable, if I know that its name will start with MyDistr_2000.3000.5000 , for example?
Got the folder name in the console like this:
ls -t someDir | head -1 What command can I use to write the folder name?