码迷,mamicode.com
首页 > 系统相关 > 详细

Linux常用命令

时间:2021-06-10 18:03:13      阅读:0      评论:0      收藏:0      [点我收藏+]

标签:打开   load   src   默认端口   关闭   系统   ssh命令   openssh   ftp   

Linux常用命令

0 设定root密码:

sudo passwd root

1.新建命令

1.1新建文件

touch new filename
vi filename

1.2新建文件夹

mkdir /home filename

2.删除命令

2.1删除文件:

rm filename

2.2删除文件夹

rm -rf dirname

3.移动文件

cd 到文件所在目录,mv filename 指定目录
例子:
mv test.txt /home/Downloads

4.查看虚拟机ip地址

ipconfig
inet后就是ip地址

5.打开二进制文件

bless filename

6.更换镜像源

更换源步骤如下:

6.1备份源列表:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.old

6.2命令行打开sources.list文件:

sudo gedit /etc/apt/sources.list

6.3修改sources,list文件【本例更改为阿里镜像源】

6.3.1阿里镜像源

deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse

deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse

6.3.2 中科大镜像源

deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

6.3.3 清华镜像源

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

6.3.4 163镜像源

deb http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.163.com/ubuntu/ bionic-backports main restricted universe multiverse

6.4更新并升级:

sudo apt-get update && sudo apt-get upgrade

7.赋予软件安装包权限

sudo chmod a+x qt-opensource-linux-x64-5.12.8.run

8.SSH服务的启动与关闭

8.1启动SSH命令

sudo /etc/init.d/ssh start

8.2停止SSH命令

sudo /etc/init.d/ssh stop

8.3启动SSH命令

sudo /etc/init.d/ssh restart

8.4系统默认端口为22,修改可执行以下命令:

sudo vim /etc/ssh/sshd_config

8.5卸载SSH服务:

sudo /etc/init.d/ss stop
卸载sftp服务
sudo apt-get remove openssh-sftp-server
卸载openssh-server服务
sudo apt-get remove openssh-server

Linux常用命令

标签:打开   load   src   默认端口   关闭   系统   ssh命令   openssh   ftp   

原文地址:https://www.cnblogs.com/TSCCG/p/14869363.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!