Skip to content

[newb q] root folders not showing

Hey,

I installed arch for the first time. Havent gotten to installing a DE yet. When I boot up arch and log in as root, 'ls' does not output anything. I know /etc /opt /run etc are there because I can 'cd' in to them, but why are they not shown in the output of 'ls'?

Lastly, when in /etc for instance I cannot go up one directory with cd.., I get BASH - command not found. What gives?

Edited 15 Jul 2019. We only hold this version.

2 points8 comments
Open on Reddit
About this post
Posted
Archived
Edited
Score
2 · 100% up
Kind
Text
ID
cdg2if

Author

39
posts
13
comments
0
media
View profile

8 comments

'ls' does not output anything.

ls, typed just like that with no options, will only show the non-hidden contents of the current working directory. Try typing it in a directory with more stuff in it and maybe even read man ls to learn how it works.

Lastly, when in /etc for instance I cannot go up one directory with cd..

Try cd .. not cd..

I suggest you find a bash tutorial on the web and apply some of your time and effort to it.

2 points

Hey,

Tnx for the reply!

This is all just a bit embarassing.

I have no separate /home partition.

Turns out when I log in as root after boot I end up in [root@ArchLinux ~]$, which is root home?

Anywho, everything is fine. When I cd to \ all folders are there. Adding that extra space to cd .. fixed that for me. Ill be looking at some bash tutorials for the rest of the day and doing some facepalming while im at it.

1 points

If he is in root, ls should list all the directories. It does sound like a real problem.

0 points

When you log in as anyone, default current path is the home, and for root the home is /root. Root's home is empty by default, hence there is nothing.

4 points

If he is in root, ls should list all the directories. It does sound like a real problem.

Nope.

When you log in as root, you begin in the /root directory which is root's home. Note that this is not the same as the root of the file structure.

3 points

Maybe your path is set wrong? Did you try using the full path to ls?

2 points

When you log in as anyone, default work directory is the user's home directory. For root, that home is /root, which is empty by default. And by default, ls with no arguments lists contents of the current work directory, which in your case is /root, which is empty. Hence no output.

You can do ls -a to list including hidden files, which will also have .bash_history and a few other things that end up created in /root. Those are hidden files, as all files that start with a dot.

To get a listing of /, you need to do ls / instead.

Also, cd.. does not work because there is no cd.., there is only cd. Two dots represent the upper directory and needs to be given as an argument to cd, so you should do cd .. instead to get one directory up.

2 points

Why are you logging in as root?

log in as user & use sudo for admin.

Things should be back to normal.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.