Linux常用命令

截屏

        (1)系统内置的

Shift + Ctrl + FN + PrintScr

        (2)Flameshot,可以截屏以后在上面勾画、画方框圆框,可以复制到剪切板   

快捷键设置:https://blog.csdn.net/weixin_37926734/article/details/122927648    

录屏:kazam

绘图工具-:kolourpaint

Markdown软件:MarkText

图像处理软件-替代PS:GIMP

安装package

# 普通安装
sudo apt-get install libopenblas-dev
sudo apt install yum

        安装的时候把所有的依赖关系处理好(你安装的这个东西依赖的包版本比较低,你的那些包版本太高了和要新装的这个不适配)

sudo aptitude install 软件包

sudo apt-get install alsa-base

        里面有一些yes和no要选的看这篇文章https://blog.csdn.net/Albert233333/article/details/127577437

卸载包并删除所有相关的配置文件config

sudo apt -y purge package的名字
sudo aptitude -y purge package的名字

# purge命令会清除配置文件
# -y 参数会自动对后面 apt 命令的提示回答是,这个开关通常是危险的,所以在一般情况下不要轻易使用,而在这里,如果你确定这些包的配置文件的清除是没有问题的的话,可以使用这个开关。


# 强力卸载package
sudo apt autoremove pulseaudio

展示本文件夹下所有文件的名字和大小

ls -ll -h

Linux常用命令_第1张图片

返回上一级目录

cd ..

删除一个空的文件夹

rmdir SASNet_ROOT

rmdir 文件夹名字

如果这个文件夹不是空的,里面有东西,如何删除

rm -rf SASNet_ROOT

rm -rf 文件夹名字

清空一个文件夹下所有的东西

rm -rf *

修改文件夹的名字

mv ShanghaiTech datas
mv 原来的名字 新的名字

linux环境中更换系统字体:

        (S1)先安装字体:https://blog.csdn.net/pythonyzh2019/article/details/109510690

        (S2)调用工具,修改字体:——按alt+f2 在运行窗口输入 gnome-tweaks 命令,然后回车。

https://blog.csdn.net/Gyuau/article/details/103085535

安装deb软件安装包

sudo dpkg -i deb包的名字

linux所有命令check-list

https://ss64.com/bash/

复制一个文件夹到另一个位置

cp -r 原文件夹的位置 存到的新的位置

查询这个文件夹或者其他目录下,有没有这个文件

find /home -name "test.txt" # 在/home目录及其子目录下查找test.txt文件,不存在则无输出

find -name "test.txt" # 不写地址,就是查询命令执行的这个目录下有没有"test.txt"

linux目录文件结构下的/opt 表示第三方库软件

进入root用户模式

su root

        输入密码即可进入,命令行前面从美刀符号  $   ,变成了井号  #  ,说明成功了

Linux常用命令_第2张图片

        如果你忘记了密码可以通过下面这句来重置root用户密码

    sudo passwd root

        退出超级用户模式:在终端多次输入exit

用终端打开一张图片

fim -a dog.jpg

ubuntu内调节音量

alsamixer

 出现系统调节音量的图标,可以用左右来选择项目,用上下来调节大小,一般我们要调节的是Master,PCM,Front,这三项就行。把他们全部调到最大。

pavucontrol

Ubuntu恢复官方默认源

https://blog.csdn.net/ynzzxc/article/details/115190762

Ubuntu 终端,安装pytorch包下载网速特别慢,怎么解决?

没那么有用:linux终端联网网速慢,解决ubuntu 上网速度慢的问题_彭元鸿的博客-CSDN博客
应该是有用的:解决Linux-Ubuntu下网速慢的解决方法_Jason噗噗的博客-CSDN博客_ubuntu网速慢解决方法

测试网速的命令

         speedtest-cli

Linux常用命令_第3张图片       

 测试终端是否可以访问一个网站用

        curl www.baidu.com # 拿到网站的HTML源代码

        ping www.baidu.com # 显示网站链接所需时间

ping  #apt-get install inetutils-ping

ifconfig    #apt-get install net-tools 

ip  #apt-get install iproute2  

ubuntu可视化的查看GPU占用

# 在终端输入,即可看到
sysmon

# 安装用下面这句话
pip install sysmon

Linux常用命令_第4张图片

显示GPU占用百分之几

gpustat

安装

pip install gpustat

pip install --user gpustat

pip install git+https://github.com/wookayin/gpustat.git@master

添加到环境变量

一般是这个位置/home/albert/.local/bin,会有一个叫做gpustat的文件
你复制这个路径/home/albert/.local/bin

添加到这个文件的末尾~/.bashrc
具体添加的内容是export PATH=$PATH:/home/albert/.local/bin

最后让系统重置一下环境变量source ~/.bashrc

输入下面这句命令即可

watch -n 1 gpustat    # 每隔1s刷新一次

gpustat -i # 带颜色的显示

Linux疑难杂症汇总

无法删除和修改win10内存储的文件

双系统,Ubuntu系统下,无法删除和修改win10内存储的文件,read-only file system

 (S1)进入windows,关闭快速启动,然后重启进入ubuntu系统

双系统 ubuntu系统下windows文件系统只读解决方案_大黑山修道的博客-CSDN博客_ubuntu只读文件系统

(S2)

再安装两个插件:
sudo apt-get install ntfs-3g             
sudo apt-get install ntfs-config
sudo ntfs-config

打开NTFS权限 图形界面(两个窗口)
(1)点击自动配置,后关闭
(2)点击高级,都选上 关闭即可

https://www.csdn.net/tags/NtDaUg3sMDA1OS1ibG9n.html

Linux下视频旋转

 ffmpeg -i in.mp4 -vf "transpose=1" out.mp4

其中的 transpose=1 表示顺时针旋转 90 度。常用参数:
0 = 逆时针旋转 90 度并垂直翻转
1 = 顺时针旋转 90 度
2 = 逆时针旋转 90 度
3 = 顺时针旋转 90 度并垂直翻转

linux上的视频剪辑:Linux 上最好的视频编辑软件_小Aer的博客-CSDN博客_linux 视频剪辑

报错解决“E: Unable to correct problems, you have held broken packages.”

 安装这个包的  libopenblas-dev  时候报的错

(py3.5_torch1.1.13.1) user_name@user_name:~$ sudo apt-get install libopenblas-dev
    
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    Some packages could not be installed. This may mean that you have
    requested an impossible situation or if you are using the unstable
    distribution that some required packages have not yet been created
    or been moved out of Incoming.
    The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libopenblas-dev : Depends: libopenblas-base (= 0.2.20+ds-4) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

linux 下安装包安装失败“Unable to correct problems, you have held broken packages”的问题_importantxian的博客-CSDN博客_linux安装g++ unable to correct problems问题原因:Ubuntu安装软件时经常会因为软件包之间的依赖关系无法完成安装。解决方案:sudo apt install aptitude:完成aptitude命令安装sudo aptitude install 软件包 :自动安装某个软件包遇见这个选项,选n,再选择 yKeep the following packages at their current version: 1) libssl-dev [Not Installed] 2) node-gyp [Not Installed] 3).https://blog.csdn.net/importantxian/article/details/106788905

一开始使用 sudo aptitude install libopenblas-dev这句话,

(py3.5_torch1.1.13.1) :~$ sudo aptitude install libopenblas-dev
The following NEW packages will be installed:
  libgfortran4{ab} libopenblas-base{a} libopenblas-dev 
0 packages upgraded, 3 newly installed, 0 to remove and 2 not upgraded.
Need to get 8,316 kB of archives. After unpacking 96.8 MB will be used.
The following packages have unmet dependencies:
 libgfortran4 : Depends: gcc-7-base (= 7.3.0-16ubuntu3) but 7.5.0-3ubuntu1~18.04 is installed
The following actions will resolve these dependencies:

     Keep the following packages at their current version:
1)     libgfortran4 [Not Installed]                       
2)     libopenblas-base [Not Installed]                   
3)     libopenblas-dev [Not Installed] 




Accept this solution? [Y/n/q/?] n

然后他让你选,选n,因为他问你下面这些包我们不修改他们,让他们保持原有版本,那当然不行了,选n

The following actions will resolve these dependencies:

      Downgrade the following packages:                                         
1)      cpp [4:7.4.0-1ubuntu2.3 (now) -> 4:7.3.0-3ubuntu2 (bionic)]             
2)      cpp-7 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]          
3)      g++ [4:7.4.0-1ubuntu2.3 (now) -> 4:7.3.0-3ubuntu2 (bionic)]             
4)      g++-7 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]          
5)      gcc [4:7.4.0-1ubuntu2.3 (now) -> 4:7.3.0-3ubuntu2 (bionic)]             
6)      gcc-7 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]          
7)      gcc-7-base [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]     
8)      libasan4 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]       
9)      libcilkrts5 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]    
10)     libgcc-7-dev [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]   
11)     libstdc++-7-dev [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]
12)     libubsan0 [7.5.0-3ubuntu1~18.04 (now) -> 7.3.0-16ubuntu3 (bionic)]      



Accept this solution? [Y/n/q/?] y

问你将会把下面这个12个package downgrade降级几个版本,当然允许,选y

The following packages will be DOWNGRADED:
  cpp cpp-7 g++ g++-7 gcc gcc-7 gcc-7-base libasan4 libcilkrts5 
  libgcc-7-dev libstdc++-7-dev libubsan0 
The following NEW packages will be installed:
  libgfortran4{a} libopenblas-base{a} libopenblas-dev 
0 packages upgraded, 3 newly installed, 12 downgraded, 0 to remove and 2 not upgraded.
Need to get 34.5 MB of archives. After unpacking 92.3 MB will be used.
Do you want to continue? [Y/n/?] y
Get: 1 http://mirrors.aliyun.com/ubuntu bionic/main amd64 g++ amd64 4:7.3.0-3ubuntu2 [1,576 B]
Get: 2 http://mirrors.aliyun.com/ubuntu bionic/main amd64 g++-7 amd64 7.3.0-16ubuntu3 [7,566 kB]
Get: 3 http://mirrors.aliyun.com/ubuntu bionic/main amd64 gcc amd64 4:7.3.0-3ubuntu2 [5,192 B]
Get: 4 http://mirrors.aliyun.com/ubuntu bionic/main amd64 gcc-7 amd64 7.3.0-16ubuntu3 [7,445 kB]
Get: 5 http://mirrors.aliyun.com/ubuntu bionic/main amd64 cpp amd64 4:7.3.0-3ubuntu2 [27.5 kB]
Get: 6 http://mirrors.aliyun.com/ubuntu bionic/main amd64 cpp-7 amd64 7.3.0-16ubuntu3 [6,734 kB]
Get: 7 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libstdc++-7-dev amd64 7.3.0-16ubuntu3 [1,461 kB]
Get: 8 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libgcc-7-dev amd64 7.3.0-16ubuntu3 [2,378 kB]
Get: 9 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libubsan0 amd64 7.3.0-16ubuntu3 [126 kB]
Get: 10 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libcilkrts5 amd64 7.3.0-16ubuntu3 [42.5 kB]
Get: 11 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libasan4 amd64 7.3.0-16ubuntu3 [359 kB]
Get: 12 http://mirrors.aliyun.com/ubuntu bionic/main amd64 gcc-7-base amd64 7.3.0-16ubuntu3 [18.8 kB]
Get: 13 http://mirrors.aliyun.com/ubuntu bionic/main amd64 libgfortran4 amd64 7.3.0-16ubuntu3 [492 kB]
Get: 14 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libopenblas-base amd64 0.2.20+ds-4 [3,964 kB]
Get: 15 http://mirrors.aliyun.com/ubuntu bionic/universe amd64 libopenblas-dev amd64 0.2.20+ds-4 [3,860 kB]
Fetched 34.5 MB in 60s (573 kB/s)                                               
dpkg: warning: downgrading g++ from 4:7.4.0-1ubuntu2.3 to 4:7.3.0-3ubuntu2
(Reading database ... 138019 files and directories currently installed.)
Preparing to unpack .../00-g++_4%3a7.3.0-3ubuntu2_amd64.deb ...
Unpacking g++ (4:7.3.0-3ubuntu2) over (4:7.4.0-1ubuntu2.3) ...
dpkg: warning: downgrading g++-7 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../01-g++-7_7.3.0-16ubuntu3_amd64.deb ...
Unpacking g++-7 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading gcc from 4:7.4.0-1ubuntu2.3 to 4:7.3.0-3ubuntu2
Preparing to unpack .../02-gcc_4%3a7.3.0-3ubuntu2_amd64.deb ...
Unpacking gcc (4:7.3.0-3ubuntu2) over (4:7.4.0-1ubuntu2.3) ...
dpkg: warning: downgrading gcc-7 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../03-gcc-7_7.3.0-16ubuntu3_amd64.deb ...
Unpacking gcc-7 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading cpp from 4:7.4.0-1ubuntu2.3 to 4:7.3.0-3ubuntu2
Preparing to unpack .../04-cpp_4%3a7.3.0-3ubuntu2_amd64.deb ...
Unpacking cpp (4:7.3.0-3ubuntu2) over (4:7.4.0-1ubuntu2.3) ...
dpkg: warning: downgrading cpp-7 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../05-cpp-7_7.3.0-16ubuntu3_amd64.deb ...
Unpacking cpp-7 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading libstdc++-7-dev:amd64 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../06-libstdc++-7-dev_7.3.0-16ubuntu3_amd64.deb ...
Unpacking libstdc++-7-dev:amd64 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading libgcc-7-dev:amd64 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../07-libgcc-7-dev_7.3.0-16ubuntu3_amd64.deb ...
Unpacking libgcc-7-dev:amd64 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading libubsan0:amd64 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../08-libubsan0_7.3.0-16ubuntu3_amd64.deb ...
Unpacking libubsan0:amd64 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading libcilkrts5:amd64 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../09-libcilkrts5_7.3.0-16ubuntu3_amd64.deb ...
Unpacking libcilkrts5:amd64 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading libasan4:amd64 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../10-libasan4_7.3.0-16ubuntu3_amd64.deb ...
Unpacking libasan4:amd64 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
dpkg: warning: downgrading gcc-7-base:amd64 from 7.5.0-3ubuntu1~18.04 to 7.3.0-16ubuntu3
Preparing to unpack .../11-gcc-7-base_7.3.0-16ubuntu3_amd64.deb ...
Unpacking gcc-7-base:amd64 (7.3.0-16ubuntu3) over (7.5.0-3ubuntu1~18.04) ...
Selecting previously unselected package libgfortran4:amd64.
Preparing to unpack .../12-libgfortran4_7.3.0-16ubuntu3_amd64.deb ...
Unpacking libgfortran4:amd64 (7.3.0-16ubuntu3) ...
Selecting previously unselected package libopenblas-base:amd64.
Preparing to unpack .../13-libopenblas-base_0.2.20+ds-4_amd64.deb ...
Unpacking libopenblas-base:amd64 (0.2.20+ds-4) ...
Selecting previously unselected package libopenblas-dev:amd64.
Preparing to unpack .../14-libopenblas-dev_0.2.20+ds-4_amd64.deb ...
Unpacking libopenblas-dev:amd64 (0.2.20+ds-4) ...
Setting up gcc-7-base:amd64 (7.3.0-16ubuntu3) ...
Setting up libasan4:amd64 (7.3.0-16ubuntu3) ...
Setting up libgfortran4:amd64 (7.3.0-16ubuntu3) ...
Setting up libcilkrts5:amd64 (7.3.0-16ubuntu3) ...
Setting up libubsan0:amd64 (7.3.0-16ubuntu3) ...
Setting up libgcc-7-dev:amd64 (7.3.0-16ubuntu3) ...
Setting up cpp-7 (7.3.0-16ubuntu3) ...
Setting up libstdc++-7-dev:amd64 (7.3.0-16ubuntu3) ...
Setting up libopenblas-base:amd64 (0.2.20+ds-4) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3 to provide /usr/lib/x86_64-linux-gnu/libblas.so.3 (libblas.so.3-x86_64-linux-gnu) in auto mode
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas/liblapack.so.3 to provide /usr/lib/x86_64-linux-gnu/liblapack.so.3 (liblapack.so.3-x86_64-linux-gnu) in auto mode
Setting up cpp (4:7.3.0-3ubuntu2) ...
Setting up gcc-7 (7.3.0-16ubuntu3) ...
Setting up g++-7 (7.3.0-16ubuntu3) ...
Setting up gcc (4:7.3.0-3ubuntu2) ...
Setting up g++ (4:7.3.0-3ubuntu2) ...
Setting up libopenblas-dev:amd64 (0.2.20+ds-4) ...
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas/libblas.so to provide /usr/lib/x86_64-linux-gnu/libblas.so (libblas.so-x86_64-linux-gnu) in auto mode
update-alternatives: using /usr/lib/x86_64-linux-gnu/openblas/liblapack.so to provide /usr/lib/x86_64-linux-gnu/liblapack.so (liblapack.so-x86_64-linux-gnu) in auto mode
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...

然后这些依赖关系就解决了

ubuntu没有声音解决方案

ubuntu没有声音解决方案

 关于 ubuntu 插入耳机没有声音(麦克风也无法使用)的解决办法 - 爱码网

麦克风不可用

麦克风无法在Ubuntu 16.04上使用

你可能感兴趣的:(1024程序员节)