【常用命令】conda、linux、ros

一、conda

(0)获取帮助

conda -h
conda xxx -h

(1)列出所有环境

conda info -e

(2)创建新环境

conda create -n xxx python=3.8

(3)删除环境

conda remove -n xxx --all

(4)激活环境

conda activate xxx

(5)退出环境

conda deactivate

(6)安装包

conda install xxx

(7)清除conda多余的包

conda clean -a

(8)显示当前环境的包

conda list

(9)查看当前conda源

conda config --show channels

(10)配置conda镜像

//打开源文件
sudo gedit ~/.condarc

(11)清华阿里官方换源

清华源官网:https://mirrors.tuna.tsinghua.edu.cn/help/anaconda/
阿里源官网:https://developer.aliyun.com/mirror/anaconda

conda卸载包

conda uninstall XXX
conda remove XXX
pip uninstall  XXX

二、linux

(1)打开命令行

ctr+alt+T

(2)显示当前路径

pwd

(3)查看ubuntu版本

lsb_release -a 

(4)查看ip地址

ifconfig

(5)打开ubuntu换源文件

sudo gedit /etc/apt/sources.list

(6)清华、阿里官方换源

阿里源官网:https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/

(7)环境变量

sudo gedit ~/.bashrc
source ~/.bashrc

(待改)查看cuda版本

cat /usr/local/cuda/version.txt

(8)pip下载指定清华、阿里(阿里快)

-i http://mirrors.aliyun.com/pypi/simple  --trusted-host mirrors.aliyun.com
-i https://pypi.tuna.tsinghua.edu.cn/simple --trusted-host  pypi.tuna.tsinghua.edu.cn

(9)查看内存使用情况

free -m

(10)查找、查看软件包

apt-cache search 软件包名
apt-cache show 软件包名

(11)查看当前用户名

whoami

(12)查看ubuntu内核

uname -r

(13)wget

  • wget命令用来从指定的URL下载文件

(14)mkdir

mkdir 文件名
mkdir -p 文件名/子文件

(15)复制文件

cp 源文件 目标文件
cp -r 源文件夹 目标文件夹

(15)删除文件

rm -rf 目录名字
表示向下删除、直接删除不询问

三、ROS

1.文件系统相关命令:(-h 显示用法)

计算图:

rqt_graph

编译工作空间:

catkin_make

创建功能包:

catkin_create_pkg 【功能包】 【std_msgs rospy roscpp】

运行节点:

rosrun 【功能包】【代码文件】

2.通信相关命令:(-h 显示用法)

节点相关:

rosnode list, info【节点名】

话题通信:

rostopic list, info【话题名】, pub【话题名】【参数】,echo 【话题名】,hz【话题名】

话题数据:

rosmsg list, info【数据包名】, package【功能包名】

服务通信:

rosservice list, info【服务话题名】,call【服务话题名】【输入参数】

服务数据:

rossrv list, info【数据包名】, package【功能包名】

参数服务器:

rosparam list,set,get

3.命令

(1)查看ROS版本

roscore
rosparam get /rosdistro

四、其他

(1)cuda测试

	import torch
	torch.__version__
	torch.cuda.is_available()

(2)禁止conda开机自启


(3)gedit clone 过慢

#运行这个,然后重启终端,再git clone
sudo apt-get install gnutls-bin
git config --global http.sslVerify false
git config --global http.postBuffer 1048576000

(4)Nano 开风扇(0-255)

sudo sh -c 'echo 150 > /sys/devices/pwm-fan/target_pwm'

(5)python

5.1 查看电脑所以python环境

py -0p

猜你喜欢

转载自blog.csdn.net/weixin_44029896/article/details/125661931