Command problem - mistake corrected!

Quick to answer questions about finding your way around Linux Mint as a new user.
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Command problem - mistake corrected!

Post by T J Tulley »

Original text:
I have a terminal open with prompt in /home - thus: ~/$.
ls -a shows all the contents of my own home file, including Documents.

Revised text:
That referred to a terminal looking at /home in Daryna, while my screen was looking at /home in Celena. That's where I want to operate.
Now my terminal shows the prompt: /media/sda6/theo/Documents$

I have File Browser open showing sda6 which is the partition allocated to /home - it shows /lost+found and /theo (me, the only user).

/theo is open showing, among all the other folders and files, Documents, a folder containing 4 items.
Documents also is open, and shows one folder (62 items) and 3 files - 1 pdf & 2 odt.

The original problem was that I entered cd /Documents, and the prompt duly changed to:
~/Documents$ - and then a command ls -a produced the response, only:
. ..
with no trace of the folder or 3 files.
Now with my terminal correctly addressed the command: ls -a shows the 4 items in Documents, thus:
theo@TJT5Daryna:/media/sda6/theo/Documents$ ls -a
. .. c_xls.pdf GdnITMWJ.odt Local FoldersI4TbkCel man-rsync.odt_0.odt

One of these is the folder named: Local FoldersI4TbkCel. To access this in a command line it is of course necessary to replace the space with ? or * but the command:
less /Local*FoldersI4TbkCel | lpr
produces the response:
/Local*FoldersI4TbkCel: No such file or directory
lpr: Error - stdin is empty, so no job has been sent.

So - essentially, the problem remains. I need to list the contents of that folder. Of course I can see it on the screen if I open it.

I shall be most grateful for advice.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
hal8000
Level 4
Level 4
Posts: 436
Joined: Sun May 04, 2008 2:04 pm
Location: UK

Re: Command problem - mistake corrected!

Post by hal8000 »

T J Tulley wrote:Original text:
I have a terminal open with prompt in /home - thus: ~/$.
ls -a shows all the contents of my own home file, including Documents.

Now with my terminal correctly addressed the command: ls -a shows the 4 items in Documents, thus:
theo@TJT5Daryna:/media/sda6/theo/Documents$ ls -a
. .. c_xls.pdf GdnITMWJ.odt Local F Local FoldersI4TbkCeloldersI4TbkCel man-rsync.odt_0.odt

One of these is the folder named: Local FoldersI4TbkCel. To access this in a command line it is of course necessary to replace the space with ? or * but the command:
less /Local*FoldersI4TbkCel | lpr
produces the response:
/Local*FoldersI4TbkCel: No such file or directory
lpr: Error - stdin is empty, so no job has been sent.

So - essentially, the problem remains. I need to list the contents of that folder. Of course I can see it on the screen if I open it.

I shall be most grateful for advice.
To List the contents of folders in bash type:
ls Documents/Local \FoldersI4TbkCel/*

The \ replaces the space (not a good idea in unix) and * will show you all folder contents.

less /Local*FoldersI4TbkCel | lpr
Fails because youre telling less to look in / directory first
less /home/theo/Documents/Local\FoldersI4TbkCel | lpr

will work has it has the full path, replace theo with whatever username you installed with.
Try googling for basix unix commands, its a bit tricky at first, like anything else new
User avatar
T J Tulley
Level 5
Level 5
Posts: 558
Joined: Wed Jul 18, 2007 10:18 am
Location: Hull, England

Re: Command problem - mistake corrected!

Post by T J Tulley »

Thanks hal8000:

No luck! Here's the terminal record - with my comments in red.
I'm in Celena, not Daryna this time, but the contents of the directory concerned are the same (a backup from Thunderbird).

theo@TJT4Celena:~/Documents$ ls -a
. .. c_xls.pdf GdnITMWJ.odt Local FoldersI4TbkCel man-rsync.odt_0.odt [Note that Local FoldersI4TbkCel is one of the files listed]
theo@TJT4Celena:~/Documents$ less /home/theo/Documents/Local\FoldersI4TbkCel | lpr [Command copied from your post!]
/home/theo/Documents/LocalFoldersI4TbkCel: No such file or directory
lpr: Error - stdin is empty, so no job has been sent.
theo@TJT4Celena:~/Documents$ less /home/theo/Documents/Local*FoldersI4TbkCel | lpr [Tried again with * instead of \]
/home/theo/Documents/Local FoldersI4TbkCel is a directory [I want its contents!]
lpr: Error - stdin is empty, so no job has been sent.
theo@TJT4Celena:~/Documents$ ls Documents/Local\FoldersI4TbkCel/* [Your command for contents to bash]
ls: Documents/LocalFoldersI4TbkCel/*: No such file or directory
theo@TJT4Celena:~/Documents$ ls Documents/Local \FoldersI4TbkCel/* [Tried again with space before \ ]
ls: Documents/Local: No such file or directory
ls: FoldersI4TbkCel/*: No such file or directory
theo@TJT4Celena:~/Documents$

What am I doing wrongly? I could of course rename that file without the space, but it would be a nuisance - it is the name in .Mozilla-Thunderbird copied into Documents, with my coded date added.
Yours hopefully -

Theo Tulley.
Using a PC with 2GB RAM, 3 hdds and a 1.7 GHz Celeron cpu.
Locked

Return to “Beginner Questions”