I’m trying to create an inventory of the contents of about twenty memory sticks, used over the last 15 years.
If I plug a stick into my hp desktop running ubuntu 22.04, it often shows a list of folders longer than can be seen on screen.
Trying to take a screen shot, which would list the file names visible, I can only get part of the contents, and need to take several shots, and paste them together to get all the contents of that particular stick.
Is there a way round this that anyone can suggest ? I’m used to being able to print out whole pages that don’t appear on the screen, but the file system program doesn’t show this -
I’ve tried a couple of times but got nowhere. First lesson was how to cope with spaces in the name.
Then how to get the path - at first all I got seemed to show the stick path was Home/FLASH_DRIVE. But opening the ‘Files’ after I’d connected the stick showed its path to be Computer/media/john/FLASH DRIVE.
So feel that the old grey cells have learnt new lessons !
If grey1beard copy-and-pasted that, I can understand why there are problems. Look carefully at the quotes. Those are some kind of typographic quotes and the shell is quite particular about what kind of quotes it wants. These (') are fine and so are these ("). But these (`) aren’t (they actually mean command substitution) nor are these (´) or these (‘) or any of the many others that can be found in Unicode. The shell wants codepoint U+0022 or U+0027. On a US-keyboard you should get the right quotes by hitting the second key to the left of the enter key in the middle row of the main keyfield.
Thanks @hdd-gehrke I don’t know why, but my iPhone characters do not always come through as “good for code”. Another problem character is a double-dash presents as a single wide dash.
If I do this:
—dry-run
I typed a double-dash but as you can see the characters are not right.
I should know better than suggesting code or command on this thing
My later reply was from my desktop, all good there.
Another thing you can try to get the right path to the flash drive is command completion. You use the tabulator key for that.
Just type
tree -a /media/john/FLA
and hit the tabulator key. Unless there’s something else starting with ‘FLA’ in that directory the shell should complete that to tree -a /media/john/FLASH\ DRIVE (the Backslash is another way to do quoting; it takes away the special meaning of the next following character; space characters have the special meaning ‘word separator’ and putting a backslash before a space neutralizes that so the space becomes just another part of the name).
BTW, instead of tree – which gives a nice but not all that informative view of the contents – I’d use ls with the option --long --recursive or -lR (those mean the same thing, the first variant is easier to understand, the second is faster to type). This gives you a lot more information, not just the directory structure and the files in there but also permissions, ownership, size, and modification date for each file.
There will be a short delay, as I have a BBQ to clean after a week without power (ice storm!), so you might guess what that entails.
Please bare in mind that my alternative route is to produce a print out of screen shots, albeit with some cut and pastes, but in the long run that may be quicker for my needs.
However, I’m learning greatly through this inquiry, and hopefully others may benefit.