只是简单记录我使用的命令,没有什么参考价值,我只是用于整理
chown
chmod permissions filename
Where,
permissions
can be read, write, execute or a combination of them.filename
is the name of the file for which the permissions need to change. This parameter can also be a list if files to change permissions in bulkWe can change permissions using two modes:
- Symbolic mode: this method uses symbols like
u
,g
,o
to represent users, groups, and others. Permissions are represented asr, w, x
for read write and execute, respectively. You can modify permissions using +, - and =.- Absolute mode: this method represents permissions as 3-digit octal numbers ranging from 0-7.
How to Change Permissions using Symbolic Mode
The table below summarize the user representation:
USER REPRESENTATION DESCRIPTION u user/owner g group o other We can use mathematical operators to add, remove, and assign permissions. The table below shows the summary:
OPERATOR DESCRIPTION + Adds a permission to a file or directory – Removes the permission = Sets the permission if not present before. Also overrides the permissions if set earlier. Example:
Suppose, I have a script and I want to make it executable for owner of the file
zaira
.Current file permissions are as follows:
Let's split the permissions like this:
df -H
The output of df -H will report how much space is used, available, percentage used, and the mount point of every disk attached to your system
如何设置python3.8为默认python的版本
如何查看 pip
指向哪个 python
版本和 package 包的安装路径?
1> 查看pip3链接的版本
$ pip3 -V
pip 21.2.4 from /opt/homebrew/lib/python3.8/site-packages/pip (python 3.8)2> 修改pip默认使用的Python版本
which pip 查看其路径
sudo vim /usr/local/bin/pip
#!/usr/bin/python 变成指定的版本。
Steps to Git clone on Ubuntu
git-clone@ubuntu:~$ sudo apt install git git-clone@ubuntu:~$ git --version git-clone@ubuntu:~$ git clone https://gitlab.com/cameronmcnz/gitlab-made-easy.git git-clone@ubuntu:~$ cd my-github-repo git-clone@ubuntu:~$ git config --global user.email "ubuntu-clone@example.com" git-clone@ubuntu:~$ git config --global user.name "cameronmcnz" git-clone@ubuntu:~$ touch my-file.html git-clone@ubuntu:~$ git add . git-clone@ubuntu:~$ git commit -m "good commit message" git-clone@ubuntu:~$ git push origin master
how to create pr open a TXT file
sudo gedit 文件名
error:sudo: gedit: command not found
how to install python3.5 + setuptools+pip
vim: command not found
How to Fix “Vim Command Not Found” Error in Ubuntu
:wq是保存并退出
多python共存,如何设置默认的python版本
2 用户级修改
为某个特定用户修改Python版本,只需要在其home目录下创建一个alias。step1:打开该用户的~/.bashrc文件:
vim ~/.bashrc
ps:如果没有vim,就看上面一个link,安装下vim就好了,
step2:添加新的别名来修改默认Python版本:
alias python='/usr/bin/python3.5'
PS:我要设置的默认版本是python3.5.这里的path是python3.5的路径,我的在local中,
step3:重新登录或者重新加载.bashrc文件,使操作生效:$ . ~/.bashrc
step4:检查当前的Python版本:$ python --version
这里就会显示python 3.5.0,就是成功了。
这个并不是系统级的修改,系统级的修改可以参考:【Python】Ubuntu修改默认Python版本_remo0x的博客-CSDN博客_ubuntu 更换python版本
ImportError: cannot import name 'HTTPSHandler'
step1: 复制一个文件过来
复制3.9版本中的ssl.so到3.5版本中,但是复制的文件应该是适应3.9的,而不是3.5的,只需要改名就可以了吗?根据下面的文章是这样的,但是我认为不是,还在尝试,我尝试了,修改文件名字是没有用的,可能不兼容
ImportError: No module named _ssl
python - ImportError: No module named _ssl - Stack Overflow
报错信息是
(base) ubuntu@gpu-ws:~$ sudo yum install openssl-devel There are no enabled repos. Run "yum repolist all" to see the repos you have. You can enable repos with yum-config-manager --enable <repo>
yum 相当于是sudo apt-get,因此只需要尝试使用该命令进行安装就可以了。
step2:
修改python的module中的Setup.dist文件,不要注解SSL部分,重新编译该文件,安装python,会在安装python成功后,直接将该包安装成功。
python卸载 - ubuntu
常见指令失效,报错信息是: Package 'libpython3.5-minimal' is not installed, so not removed
brew安装后无法使用,
其他人在服务器中安装了brew,但是我登录后,却显示是no command,然后我查找资料,发现可能是安装后没有激活,或者说是配置环境,然后参考这个文章,尝试配置环境,但是我找不到其他人配置的路径,但是我看了一个/home处输入.bash_profile后,看到了有两个配置信息,不知道是谁配置的,由于我也无权利修改该文件,只能搁置。然后我上了brew官网又重新安装了一下。但是输入那个命令后,我还是找不到安装路径,但是输入brew确实是可以使用了。
删除文件/文件夹
实例:
删除文件夹实例:
rm -rf /var/log/httpd
这句代码的意思是:删除/var/log/httpd目录以及其下所有文件、文件夹
删除文件实例:
rm -f /var/log/httpd/access.log
这个将会强制删除/var/log/httpd/access.log这个文件
复制文件
cp 要复制文件的path 目的path