if you want confirmation use the -v switch/option
created parent dir and subdir and tells you want you did
Code:
mkdir -pv ~/partent/subdir/subdir/subdir
if you are in su off of a user then where are you at and as who?
Code:
userx@slackwhere:~
$ su
Password:
root@slackwhere:/home/userx
# mkdir -pv ~/somesilling/song/oer
mkdir: created directory '/root/somesilling'
mkdir: created directory '/root/somesilling/song'
mkdir: created directory '/root/somesilling/song/oer'
root@slackwhere:/home/userx
# rm -rv ~/somesilling
removed directory '/root/somesilling/song/oer'
removed directory '/root/somesilling/song'
removed directory '/root/somesilling'
I am in my user but look here
Code:
root@slackwhere:/home/userx
# pwd
/home/userx
root@slackwhere:/home/userx
# ls ~/
Desktop GNUstep install-nutyx.md5sum kodi test
Downloads install-nutyx jdk
when I Print Working Directory (pwd) I get my user logged in as su
but when I List Directory (ls) as su in user I get root home dir because I am root, ( not to mistaken as I am groot), if I su - (hyphen) I go into my root home directory.
Code:
root@slackwhere:/home/userx
# su -
Have a nice day!
root@slackwhere:~# pwd
/root
environment changes ...
so when you where logged in as su under a user then issued you cd to change directory to your home dir who where you when you did that? It determines where you will end up at.
Code:
userx@slackwhere:~
$ su
Password:
root@slackwhere:/home/userx
# pwd
/home/userx
root@slackwhere:/home/userx
# cd
root@slackwhere:~
# pwd
/root
root@slackwhere:~
#
Mostly you just need to keep in mind what su and su - do when you're in your terminal as far as directory path placement and rights, for more on that look up "environment variables" linux su su - sudo user