Tag Archives: macbook

[Solved] Source Zsh error: zsh problem: compinit:503: no such file or directory

zsh problem: compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew
[oh-my-zsh]  Solution:

## zsh problem: compinit:503: no such file or directory: /usr/local/share/zsh/site-functions/_brew

Solution:

```zsh
sudo ln -fsv /opt/homebrew/completions/zsh/_brew /usr/local/share/zsh/site-functions/_brew

brew cleanup && source ~/.zshrc
```

Then it was solved.

Mac realizes file interaction (upload and download) between terminal and server

The Mac comes with SSH, as explained in the last post.
This article mainly introduces the use of SCP command to achieve the file upload and download
1. Download files from the server
SCP username @ servername:/path/filename/Users/MAC/Desktop (local directory)
For example: SCP [email protected]:/root/test. TXT/Users/MAC/Desktop
Download /root/test.txt from the server to the local /Users/ MAC /Desktop directory.
Notice the space between the two addresses!
2. Upload files locally to the server
scp /path/filename username@servername:/path ;
For example: SCP/Users/MAC/Desktop/test. TXT [email protected]:/root /
3. Download the entire directory from the server
Scp-r username@servername:/root/ (remote directory) /Users/ MAC /Desktop (local directory)
For example: scp-r [email protected]:/root/ /Users/ MAC /Desktop/
4. Upload the directory to the server
scp -r local_dir username@servername:remote_dir
For example, scp-r test [email protected]:/root/ Upload the test directory in the current directory to the server’s /root/ directory
5. Finally, it introduces a software that can also easily realize the file interaction between local and server. FinalShell