ls and dir doesn't show anything on debian 10 solved

New to Debian (Or Linux in general)? Ask your questions here!

ls and dir doesn't show anything on debian 10 solved

Postby stan_willems » 2020-05-27 09:49

I've installed debian 10 32bit on a laptop and tried to use ls but then it prints nothing. And when I use ls -a I get this:
Code: Select all
root@acer-aspire-one:~# ls  //This prints nothing
root@acer-aspire-one:~# ls -a
.  ..  .bashrc  .profile

And dir doesn't show anything either
Code: Select all
root@acer-aspire-one:~# dir  //This prints nothing
root@acer-aspire-one:~# dir -a
.  ..  .bashrc  .profile
Last edited by stan_willems on 2020-05-28 06:09, edited 1 time in total.
stan_willems
 
Posts: 3
Joined: 2020-05-27 09:35

Re: ls and dir doesn't show anything on debian 10

Postby roseway » 2020-05-27 10:53

If you use ls or dir without any parameters it prints the contents of the current directory. In your example you're logged in as root and the current directory is /root. On installation /root is empty, so your result it expected. Try specifying a directory path, e.g.:

Code: Select all
ls /bin
Eric
User avatar
roseway
 
Posts: 1514
Joined: 2007-12-31 22:50
Location: Kent, UK

Re: ls and dir doesn't show anything on debian 10

Postby cuckooflew » 2020-05-27 13:15

The answer given by roseway is correct,but I would like to add some comments.
First ,some advice,you probably should exit root and login as normal user, it is very risky working as root when you still do not know any basics.
As you can see the 'ls-a' does show the hidden files,as it should.
Try
Code: Select all
# login <username>
Let us know what that shows, where i show <username> would be the user name you set when you installed. After you become a normal user, try using :
Code: Select all
$ cd /home/<username>
then the 'ls' command,since this is a fresh install ,the /home/user directory may be empty as well,it might have some directories that are default, eg: Desktop,Documents,Downloads,etc....these also would be empty.
You can type the help command,and get a list of some commands, there is much more yu can do, I suggest reading one of the many tutorials on basic Linux commands, if for some reason you can not use a search engine, please tell us, me or someone else can post some links to some tutorials.
Please Read.. What we expect you have already Done.
Does any one know about this ?
Users browsing this forum: Google Knows, and
My grand father knows all about everything:
…one flew east, one flew west,
One flew over the cuckoo’s nest.
cuckooflew
 
Posts: 377
Joined: 2018-05-10 19:34
Location: Some where out west

Re: ls and dir doesn't show anything on debian 10

Postby stan_willems » 2020-05-27 14:50

Hi, I've logged into my user account and it gives this output
Code: Select all
stan@acer-aspire-one:~$ ls
help
stan@acer-aspire-one:~$ cd /Instagram-Scheduler
stan@acer-aspire-one:/Instagram-Scheduler$

So ls doens't show the folder Instagram-Scheduler but I can cd into it.

And what Eric says works
Code: Select all
stan@acer-aspire-one:~$ ls /bin
'['                                   netcat
 2to3-2.7                             networkctl
 aa-enabled                           newgrp
 aa-exec                              ngettext
 addpart                              nice
 apropos                              nisdomainname
 apt                                  nl
//And so on
stan_willems
 
Posts: 3
Joined: 2020-05-27 09:35

Re: ls and dir doesn't show anything on debian 10

Postby Head_on_a_Stick » 2020-05-27 16:19

stan_willems wrote:Hi, I've logged into my user account and it gives this output
Code: Select all
stan@acer-aspire-one:~$ ls
help
stan@acer-aspire-one:~$ cd /Instagram-Scheduler
stan@acer-aspire-one:/Instagram-Scheduler$

So ls doens't show the folder Instagram-Scheduler but I can cd into it.

You called the full path for the cd command so the Instagram-Scheduler directory isn't in your home directory.

Try
Code: Select all
ls /

See also https://en.wikipedia.org/wiki/Path_(computing)#Absolute_and_relative_paths
User avatar
Head_on_a_Stick
 
Posts: 12129
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: ls and dir doesn't show anything on debian 10

Postby stan_willems » 2020-05-27 16:32

Head_on_a_Stick wrote:
stan_willems wrote:Hi, I've logged into my user account and it gives this output
Code: Select all
stan@acer-aspire-one:~$ ls
help
stan@acer-aspire-one:~$ cd /Instagram-Scheduler
stan@acer-aspire-one:/Instagram-Scheduler$

So ls doens't show the folder Instagram-Scheduler but I can cd into it.

You called the full path for the cd command so the Instagram-Scheduler directory isn't in your home directory.

Try
Code: Select all
ls /

See also https://en.wikipedia.org/wiki/Path_(computing)#Absolute_and_relative_paths


Oh, thanks :)
Now I understand.
How do you close a post?
stan_willems
 
Posts: 3
Joined: 2020-05-27 09:35

Re: ls and dir doesn't show anything on debian 10

Postby cuckooflew » 2020-05-27 19:43

You edit the subject line on your first post, add the word solved to it. The topic never gets closed, someone may have additional comments or questions later, but adding the word solved lets everyone know you have solved it, it also helps on the search engines when someone searches for answers to a similar question or problem.
Please Read.. What we expect you have already Done.
Does any one know about this ?
Users browsing this forum: Google Knows, and
My grand father knows all about everything:
…one flew east, one flew west,
One flew over the cuckoo’s nest.
cuckooflew
 
Posts: 377
Joined: 2018-05-10 19:34
Location: Some where out west


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 10 guests

fashionable