sudo

新手在ubuntu下用命令安装apache2及卸载

允我心安 提交于 2020-01-07 19:01:08
1、安装命令 sudo apt install apache2 注:apt命令用来安装 2、查看是否安装成功 sudo systemctl status apache2 安装成功会显示:active(running) 3、 查看apache2的版本: apache2ctl -v 注:-v(-version) 4、在客户端浏览器输入 http://localhsot 5、服务的开启关停 cd /etc init.d/apache2 start 启动服务 init.d/apache2 stop 停止服务 init.d/apache2 restart 重启服务 6、网站目录路径 cd cd /var ls cd www ls cd html ls 卸载apache2 1、停止服务 cd /etc init.d/apache2 stop 2、卸载 sudo apt-get purge apache2 sudo apt-get autoremove 3、检查下是否有没有卸载在文件 whereis apache2 根据文件的目录进行如下命令的删除 sudo rm -rf /etc/apache2 注:在终端用复制粘贴sudo rm -rf挨个删除不同目录下的文件:ctrl + shift + c,ctrl + shift + v rm -rf rm - 移除文件或者目录 rm -rf *

docker容器离线安装

佐手、 提交于 2020-01-07 18:44:14
一、下载docker-18.03.1-ce.tgz,上传到/home目录下 二、解压docker到当前路径下 tar zxvf docker-18.03.1-ce.tgz 三、拷贝docker下的所有文件到/usr/bin下 sudo cp docker/* /usr/bin/ 四、开启docker守护进程 sudo dockerd & 五、查看docker docker --verison docker info docker images docker ps -a 来源: 51CTO 作者: changelf 链接: https://blog.51cto.com/7136516/2461818

Linux下Nginx搭建

大憨熊 提交于 2020-01-07 18:27:53
1) 安装依赖 prce库 进入/usr/local目录,依次键入以下命令: 下载压缩包:$ wget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz 解压缩:$ tar -zxf pcre-8.42.tar.gz 进入解压后目录:$ cd pcre-8.42 执行安装:$ ./configure $ make $ sudo make install zlib库 进入/usr/local目录,依次键入以下命令: $ wget http://zlib.net/zlib-1.2.11.tar.gz $ tar -zxf zlib-1.2.11.tar.gz $ cd zlib-1.2.11 $ ./configure $ make $ sudo make install OpenSSL 进入/usr/local目录,依次键入以下命令: $ wget http://www.openssl.org/source/openssl-1.1.1b.tar.gz $ tar -zxf openssl-1.1.1b.tar.gz $ cd openssl-1.1.1b ./config --prefix=/usr/local/ssl shared zlib-dynamic $ make $ sudo make install 2) 安装Nginx-1

linux 中好玩的命令

馋奶兔 提交于 2020-01-07 18:19:50
1.screenfetch:显示系统、主题信息 安装使用: sudo apt install screenfetch screenfetch 效果图: 2. linux_logo:linux版本logo图片及系统信息 安装使用: sudo apt install linuxlogo linux_logo 效果图: 查看内置的logo列表: linux_logo -f -L list Available Built-in Logos: Num Type Ascii Name Description 1 Classic Yes aix AIX Logo 2 Classic Yes bsd FreeBSD Logo 3 Banner Yes bsd_banner FreeBSD Logo 4 Classic Yes irix Irix Logo 5 Classic Yes openbsd OpenBSD Logo 6 Banner Yes openbsd_banner OpenBSD Logo 7 Banner Yes solaris The Default Banner Logos 8 Banner Yes banner-simp Simplified Banner Logo 9 Banner Yes banner The Default Banner Logo 10 Classic

su命令 ,sudo命令 ,限制root远程登录

匆匆过客 提交于 2020-01-07 17:48:44
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> su命令 作用用于切换用户 - user : 彻底切换用户 [root@centos001 ~]# su - user1 //彻底切换到另一个用户 上一次登录:三 11月 1 20:21:13 CST 2017pts/1 上 [user1@centos001 ~]$ id uid=1000(user1) gid=1000(user1) 组=1000(user1) 环境=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023 [user1@centos001 ~]$ 登出 [root@centos001 ~]# su user1 //不加-的时候,切换了后其实还是在root目录之下 [user1@centos001 root]$ pwd /root - -c "命令“ user :在切换用户的同时执行一条命令 示例: [root@centos001 ~]# su - -c "touch /tmp/aming001" user1 //切换用户同时执行一个命令,创建一个文件aming001 [root@centos001 ~]# ls -lt /tmp/ |head 总用量 124 -rw-rw-r--. 1 user1 user1 0 11月 1 21:24

nginx的常用命令

…衆ロ難τιáo~ 提交于 2020-01-07 14:09:50
1.HomeBrew安装nginx 搜索 brew search nginx 安装 brew install nginx 2.启动nginx sudo nginx 3.停止nginx服务 sudo nginx -s stop 4.重启nginx服务 sudo nginx -s reload 来源: https://www.cnblogs.com/changchangchang/p/12155822.html

升级linux内核版本

只谈情不闲聊 提交于 2020-01-07 14:07:58
1、安装公钥 sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 2、下载内核 sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm 3、查看内核版本 sudo yum -y --disablerepo="*" --enablerepo="elrepo-kernel" list available 4、安装最新版本 sudo yum -y --enablerepo=elrepo-kernel install kernel-ml 或yum --enablerepo=elrepo-kernel install kernel-lt 5、查看机器上所有能用内核 sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg 6、编辑配置文件 sudo vi /etc/default/grub GRUB_TIMEOUT=5 GRUB_DEFAULT=0 GRUB_DISABLE_SUBMENU=true GRUB_TERMINAL_OUTPUT="console" GRUB_CMDLINE_LINUX="rd.lvm.lv=centos

c++:internal compiler error:killked(program cclplus) 解决办法

旧城冷巷雨未停 提交于 2020-01-07 04:03:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 在jetson nano上编译PCL GPU版本时,出现internal compiler error:killked(program cclplus)错误,通过网上教程,增加了swap空间,jetson自带4G内存,默认SWAP只有2G,可以临时调整SWAP空间为4G,方法如下: //设置交换空间大小为64M*32 = 2G sudo dd if=/dev/zero of=/swapfile bs=64M count=32 //创建交换文件 sudo mkswap /swapfile //开启交换空间 sudo swapon /swapfile //关闭交换空间 sudo swapoff /swapfile //查看交换空间 //free -m 来源: oschina 链接: https://my.oschina.net/u/4228078/blog/3151191

Google Cloud VM when sudoing asks for password

断了今生、忘了曾经 提交于 2020-01-07 03:12:25
问题 I've been working with a Google Cloud debian VM and had no problem at all doing super user tasks using sudo (sudo was not asking for password). Today I connected via SSH as usual and when I try to sudo something it started asking for password: We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password