I was trying to set up Tomcat to use with Java, and somehow moved /Users/me to /usr/local/me. When I try to open any icons on desktop, they do not open, but everything that was already open still functions / saves fine (at least it seems).
My question: How can i move (user) tori from usr/local/tori back to Users/tori where it belongs, without breaking anything? (I've had enough "fun" for the week).
Everything that follows is just context to how I got there and may well be irrelevant for answering, I am including it in case it is relevant. Thank you so much!!
Current situation:
When I start a new terminal session, I get:
No home directory: /Users/tori mkdir: //.bash_sessions: Permission denied touch: //.bash_sessions/817C7D82-8749-4B96-9AC6-CAA07F9CE1B0.historynew: No such file or directory
$USER
/ who / w / whoami output: tori, the right user at least.
$ finger tori
Outputs: .. Directory: /Users/tori (note: there is not a Users/tori when I cd into Users).
Commands I ran leading up to current situation:
$ sudo ln -s /Applications/tomcat-apache-9.0.30
--- I did enter password. I realize I did not put the desired name of the link after this, doubt this caused the error.
$ sudo chown -R tori /Applications/tomcat-apache-9.0.30
--- I was NOT prompted to enter password
$ sudo chmod +x /Applications/tomcat-apache-9.0.30/bin/*.sh
I was NOT prompted to enter password
$ sudo chmod +x ./bin/*.sh
+ I did enter password. Is to make all .sh files executable. I was trying to execute bin/catalina.sh start
(and variants thereof) to start Tomcat server (I didn't get it to start yet).
$ bin/catalina.sh start
Output:
bin/catalina.sh: /bin/sh^M: bad interpreter: No such file or directory
$ sed -i -e 's/\r$//' catalina.sh
Attempt to fix ^M errors (I tried to brew install dos2unix and got errors).
$ sudo chown -R $USER ~/.bash_sessions; chmod 700 ~/.bash_sessions
Output:
chown: //.bash_sessions: No such file or directory
chmod: //.bash_sessions: No such file or directory
EDIT
output of ls -la /usr/local/tori
,as suggested:
total 960
drwxr-xr-x+ 66 tori staff 2244 Dec 24 20:39 .
drwxr-xr-x 16 root wheel 544 Dec 24 20:57 ..
-r-------- 1 tori staff 7 Nov 17 2017 .CFUserTextEncoding
-rw-r--r--@ 1 tori staff 18436 Dec 29 17:20 .DS_Store
drwx------@ 3 tori staff 102 May 5 2018 Applications
drwx------+ 44 tori staff 1496 Dec 24 21:01 Desktop
/usr/local/tori
); this is critical. 3rd, you mention a script namedcatalina.sh
; we don’t know what’s in that script. Finally, you didn’t say what version of macOS you’re using. If it is Catalina, you should be prevented from doing this – Allan Dec 30 '19 at 0:16sudo
caches you’re password for a time period (1 min. I think) so entering subsequentsudo
commands after previously entering a password won’t require it again. This is normal. – Allan Dec 30 '19 at 0:18