TLCL

TLCL

Winter Lv4

TLCL

  • Why Linux?

    • linux 人们会发现只有键盘才是计算机的一个灵魂,使用命令行不是为了看起来高深莫测,而是为解决复杂问题提供一个简化的可能!

    • shell 解释 是kernel outermost layer os向用户提供的一个interface有两种类型的,一种是CLS cmdline形式的 而对应的有相关的scriped language 例如bash 还有就是xwindows 驱动的GUI

  • 贴个网址 TLCL

  • bash

  • command

    • shift+ctrl+6 切出wsl

    • winter——主机名,SPIKE——用户名

    • date 时间 calendar 日历

    • ls ~ ~ symbolized stand for the user directory ls could specify the dr you wanna check.

    • we could add some format cmd to reveal more details ls -l

    • the meaning of the long format - indicate the file type and then the next three letters indicates the access rights and then

    • f11 keystroke could full-screenize the console

    • file check the brief info of a file

    • everything is file and mostly the text file only contain ascii code

    • configuration file or the actually source file most stored in text file format

    • less less is more and the up down arrow q h n some key cmd you should know

    • there are some standard pathname in unix-like system just feel free to explore , and dont mind ,we could hardly mess up for the administrator keep everything in order

    • wildcard just the regular expression also grep

      • * mean the any chars ? one single char [set] [!set] [[:key:word​]]
    • mkdir dirc and … eg mkdir dir1 dir2 dir3

    • cp mv rm like the copy paste and cut delete in windows

      • when you want to handle a directory you need to use option -r recrusive
      • Be careful with the combo of wildcard and rm so just invoke the ls first to check if the files listed are u really wanna remove no more change to restore the files
      • use the . to indicate the workplace
      • if you wanna some warning remeber to use op -i
      • mv is rename also the same time if the file2 exists then is act like move ifnot then like the rename
    • the /etc is text configured file and the bin is usually executable and /usr/ is the largest folder in linux

    • 这个ln 指令 ln -s 创建符号连接 有一点像windows的快捷方式 ln创建的是硬的链接 早期 智能文件 不能目录

    • What is cmd a new set of useful cmds

      • 所以命令的本质 有 一个可执行的二进制c函数 2shell python ruby脚本程序 3 shell内置 builtins 4 shell小函数 5 别名
      • use the type cmd to check the type of one cmd type [cmd]
      • which to check which is the cmd only used for the binary cmd
      • help cmd used for the buildins cmd –help the same
      • man ls use the manual very simple but difficult to read
      • apropos + cmd check the tips 挺有用的 apropos vim
      • info 一个更友好的 提示 有超链接
        • n 下一个超链接结点 p 上一个 u当前结点菜单 enter进入
      • zless 可以查看 .gz文件
      • whatis 一个简单的描述
    • 可以一行多个命令 用;隔开

    • alias 在自己命名之前先使用 type查看一下是否已经是已存在的命令 unalias 取消别名

    • Evrything is a  file

    • > 重定向 标准输入输出 错误 > 改变标准输出 注意因此 每一次使用时都会使文件重写

    • > 从头开始 >> append  file discripitor 文件描述符 0 1 2 2> 表示方法

    • 新的方法来同时重定向我们的标准输入与输出&>     dev/null 一个没用的数据桶 可以用作丢弃一些不用的显示信息

    •  cat 与standard input 有关 cat 单独就是echo ctrl+z强制退出运行 ctrl+d EOF

    • ctrl+d 是 EOF

    • | pipeline cmd1|cmd2 将1中的标准输出作为二中的标准输入    cat No?.txt > poem.txt 连续连接文件的例子

    • ***filter 过滤器 ls -l /usr/bin /bin | sort |uniq [-d看见重复内容]| less ***

    • 注意上面几个指令在无参数情况下都是默认接受标准输入 所以 可以使用管道符 很方便  wc 计数

    • 快乐的echo cmd  is special when use the echo it will do some process called expansion   obviously  when you see the echo it just mean use the regular expression 

      • ***~ echo ~ 显示当前的目录 echo $((expr)) 进行幂展开 ***
      • 花括号展开 可以展开字符串表达式
      • Parameter expansion 参数展开 very important echo $USER 就像这样  一个查看变量的命令 printenv | less
      • command substitution use $(cmd) eg ls -l $(which cp)     file $(ls /usr/bin/* | grep zip) 旧标准中有一个which cp可以代替 $()
      • “”  sleep 单引号 echo -e $转义字符
      • ctrl l     ctrl d   ctrl t  alt u alt l alt t alt f alt b
      • tab alt ? alt * ctrl k ctrl y set | less TLDR
    • .. 代表的是父文件 . 代表当前的工作文件

    • dr 磁盘空间情况 free 内存空间情况

    • exit 退出程序

    • ls most used cmd in shell

    • $ 用户 # superuser rootuser

    • file navigation·

      • pwd print name of workplace directory
      • cd change directory
      • ls list contents
      • 我们都处于 文件中间 home 通常初始 时 文件树 只有一棵 对于普通用户只有 user里具有写权限 其余需要 root
      • absolute pathname relative pathname
        • / 根目录 .. / 父目录 ./ 当前工作目录 通常默认有这

      • cd + pathname

        • cd 或者是 cd ~默认进入用户文件夹
      • cd ~user_name 进入对应名字 的用户文件夹

        • cd - 回到先前 的文件夹
      • cd .. 回到父文件

    • . 开头的文件夹 通常是不显示的 隐藏的 注入configuration 类的文件

  • 用 . _ - 代替文件名 中的空格

  • 支持 鼠标中间 paste 双击 copy 或者 选择 copy

    • 上下键 寻找历史命令最大500个

    • ls指令再探dd

      • short option -l 一个字母 可以组合 -lt
    • long option –reverse 全称
  • 其实无论怎样都可以 command –help 查看更多

  • file

    • 查询文件 类型 file + filename
  • Less

    • less 查看文本文件 everything is file

    • ascII as-key

  • 键盘高级操作

    • 自动补全

      • tab 单击
      • Alt + ? 显示可能的补全列表
      • Alt + * 插入所有可能的补全操作
  • Post title:TLCL
  • Post author:Winter
  • Create time:2023-05-06 15:02:35
  • Post link:https://spikeihg.github.io/2023/05/06/TLCL/
  • Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
if (hexo-config('comment.enable') == true && hexo-config('comment.use') != "") { if (hexo-config('comment.use') == "waline") { @require "./waline.styl" } else if (hexo-config('comment.use') == "gitalk") { @require "./gitalk.styl" } else if (hexo-config('comment.use') == "twikoo") { @require "./twikoo.styl" } } .comments-container { display inline-block margin-top $spacing-unit width 100% #comment-anchor { width 100% height 10px } .comment-area-title { width 100% margin 10px 0 font-size 1.38rem color var(--default-text-color) font-family "Noto Sans", "Noto Sans SC",sans-serif font-weight bold i { color var(--default-text-color) } +redefine-tablet() { margin 5px 0 font-size 1.2rem } } }
On this page
TLCL