2023-07-26 Ubuntu使用记录

1.查找字母,数字开头的文件,移动到上级目录om

find ./ -name '[A-Z]*' -type d | xargs -I % sh -c "mv '%' ./om"
find ./ -name '[0-9]*' -type d | xargs -I % sh -c "echo '%' "
find ./ -name '[a-z]*' -type d | xargs -I % sh -c "echo '%' "
find ./ -name '[0-9]*' -type d | xargs -I % sh -c "mv '%' ./om".

2.删除当前目录下的空目录

find ./ -type d -empty -delete

3.写入dns :

echo "nameserver 223.5.5.5" >>/etc/resolv.conf

4.写入清华源:

deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-security main restricted universe multiverse
" >/etc/apt/sources.list 

5.挂载ntfs文件系统:

mount -t ntfs-3g -o uid=root,gid=root,fmask=133,dmask=022 /dev/sda1 /media/one 
mount /dev/sdb1 /media/two/ 

6.文件权限:

权限.png

7.解压,压缩:

打包和压缩:tar -zcvf 文件名 目录 z通过gzip指令处理备份文件;
解压缩:tar -xzvf 文件名 x从备份文件中还原文件;v显示操作过程;f指定备份文件;-f指定包的文件名
sed -i "/hello/s#/g#'/g#g" pictures.txt | grep hello

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • [1] 多核CPU和单核CPU的优点和缺点,是否所有程序在多核CPU上运行速度都快?为什么? 优点:多线程 在一个...
    a狂飙的蜗牛阅读 1,801评论 0 0
  • 一、文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件) ls...
    会飞的鱼Coo阅读 4,575评论 1 23
  • 一、文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件) ls -a 列出当前目录文件(包括隐含文件) ls...
    小杰的简书阅读 2,559评论 0 45
  • 一、文件/文件夹管理 ls 列出当前目录文件(不包括隐含文件)ls -a 列出当前目录文件(包括隐含文件)l...
    路痴千行阅读 2,456评论 0 5
  • Ubuntu 常用命令大全 查看软件 xxx 安装内容 #dpkg -L xxx 查找软件 #apt-cache ...
    guiwuzhe阅读 2,611评论 0 14