Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
stan_willems
Posts: 3
Joined: 2020-05-27 09:35

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

#1 Post by stan_willems »

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.

User avatar
roseway
Posts: 1528
Joined: 2007-12-31 22:50
Location: Kent, UK
Has thanked: 3 times
Been thanked: 4 times

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

#2 Post by roseway »

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

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

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

#3 Post by cuckooflew »

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
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

stan_willems
Posts: 3
Joined: 2020-05-27 09:35

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

#4 Post by stan_willems »

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

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

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

#5 Post by Head_on_a_Stick »

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_(com ... tive_paths
deadbang

stan_willems
Posts: 3
Joined: 2020-05-27 09:35

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

#6 Post by stan_willems »

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_(com ... tive_paths
Oh, thanks :)
Now I understand.
How do you close a post?

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

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

#7 Post by cuckooflew »

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
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

Post Reply