Linux学习笔记
kxwang_
【研究领域】
OCSSD | Zns SSD | KV Storage | SSD FTL算法|内核开发
【专业课程】
计算机体系结构 | 操作系统 | 嵌入式系统 | 数据结构 | 数据挖掘 | 深度学习 | 影像处理
【语言 】
英语 |韩语 |C|Python
展开
-
如何两个不同的脚本文件之间传递参数
两个不同的Shell脚本之间如何访问传递的参数取决于它们是如何调用的。选择哪种方法取决于您的需求。通常情况下,通过位置参数传递参数是更常见的方法,因为它更直接并且不需要额外的环境变量设置。但在某些情况下,使用环境变量可以更方便地共享数据。另一种方法是使用环境变量来传递参数。在这种方法中,一个脚本可以设置环境变量,另一个脚本可以读取这些环境变量。这是一种常见的方法,其中一个脚本将参数作为位置参数传递给另一个脚本。等特殊变量来表示,它们分别对应于第一个、第二个、第三个传递的参数,以此类推。原创 2023-09-25 17:30:56 · 1011 阅读 · 0 评论 -
安装了内核重启后内核版本没有更新 调处grub引导界面 (已解决)
最近用虚拟机,安装了内核重启后没有更新,因为虚拟机默认设置了开机自动进入默认内核版本与其修改启动内核顺序,还是把启动高级选择menu调出来方便一些首先, 检查已安装的内核版本$ dpkg -l|grep linux-image修改grub引导界面参数$ vim /etc/default/grub# 显示grub菜单GRUB_TIMEOUT_STYLE=menu# 0代表立即进系统,不会显示menu,这里设置成menu即可# -1代表一直显示menu,直到用户做出选择GRUB_T原创 2022-05-24 15:31:30 · 2209 阅读 · 0 评论 -
Automount a disk in /home
check the new media disksudo fdisk -lformatsudo mkfs -t ext4 /dev/sdcGet the Name, UUID and File System Typesudo blkidyou can get /dev/sdc: UUID="......." TYPE="ext4"Make a Mount Point For Your Drivesudo mkdir /home/diskMount the disks.原创 2022-01-20 18:12:42 · 90 阅读 · 0 评论 -
Install Python 3 on Ubuntu 18.04 or 20.04
Install Python 3 on Ubuntu 18.04 or 20.04Step1 : Check your version of PythonStep 2: Install Supporting SoftwareStep 3: Download the Latest Version of Python Source CodeStep 4: Extract Compressed FilesStep 5: Test System and Optimize PythonStep 6: Install原创 2022-01-19 21:48:38 · 981 阅读 · 0 评论 -
Linux 系统根目录文件结构
Linux 系统根目录文件结构前言一级目录Linux /usr目录前言使用 ls -l / 可以查看到在 Linux 根目录(/)下包含的很多子目录,分为一级目录和二级目录根目录十分重要。一级目录/bin/ :bin 是 Binaries (二进制文件) 的缩写, 这里是可执行二进制文件的目录,这个目录存放着最经常使用的。命令,普通用户和 root 都可以执行,如常用的命令ls、tar、mv、cat等。/boot/ :系统启动目录,保存与系统启动时使用的核心文件,如内核文件和启动引原创 2022-01-17 13:51:03 · 625 阅读 · 0 评论 -
Linux文本文件编辑命令
Linux文本文件编辑命令为每行增加行号使用sed和awk命令删除第一列提取文件的前N行为每行增加行号awk '$0=NR":"$0' original_filename->new_filename使用sed和awk命令删除第一列awk '{$1="";print $0}' original_filename->new_filename或sed -e 's/[^ ]* //' original_filename->new_filename提取文件的前N行head原创 2022-01-03 17:24:39 · 434 阅读 · 0 评论 -
One-Day Study Shell: Part 3 Shell test command
One-Day Study Shell: Part 3 Shell test commandValue TestString TestFile TestValue Testparameterdescription-eqif "=" ; true-neif "!=" ;true-gtif ">" ; true-geif ">=" ; true-ltif "<" ; true-le"if "<=" ; true#!/原创 2021-09-15 18:33:01 · 75 阅读 · 0 评论 -
One-Day Study Shell:Part 2 Shell Path Parameter
One-Day Study Shel:Part 2Shell path parameterShell path parameterGet parameter from shell $nn is a numbern=1 (The first parameter to execute shell )n=2 (The second parameter to execute shell )#!/bin/bash# author:kekeecho "Shell pass parameter~原创 2021-09-15 18:31:56 · 100 阅读 · 0 评论 -
One-Day Study Shell: Part 1 The first Shell & Shell Variable & String & Array & Comment
One-Day Study Shell : Part 1The first ShellShell VariableShell stringShell arrayShell commentThe first ShellCreate a new file “hello.sh”, write codes :#!/bin/bashecho "Hello Shell !"Run Shell: cd to the directory of the file "hello.sh"chmod +x原创 2021-09-15 18:31:15 · 102 阅读 · 0 评论 -
Ubuntu18.04-QEMU install error and solution(4)
errorERROR: glib-2.40 gthread-2.0 is required to compile QEMUsolutionsudo apt install libglib2.0-devsudo apt install libpixman-1-devso you can see原创 2021-06-16 13:36:23 · 202 阅读 · 0 评论 -
Ubuntu18.04-QEMU install error and solution(3)
errorERROR: pkg-config binary 'pkg-config' not foundsolutionsudo apt-get update -ysudo apt-get install -y pkg-configso you can see原创 2021-06-16 13:33:45 · 459 阅读 · 0 评论 -
Ubuntu18.04-QEMU install error and solution(2)
errorERROR: "cc" either does not exist or does not worksolutionsudo apt-get install gccso you can see原创 2021-06-16 13:30:51 · 1719 阅读 · 6 评论 -
Ubuntu18.04-QEMU install error and solution(1)
errorERROR: Python not found. Use --python=/path/to/pythonsolutionsudo apt install pythonso you can see:原创 2021-06-16 13:28:31 · 384 阅读 · 0 评论 -
Linux学习笔记之“vi 编辑器”
一文掌握强大的vi编辑器vi编辑器的初次相遇就是切记“手不要乱敲键盘”我还记得第一次进到vi模式的编辑器中,感觉是死机了,瞎乱敲键盘,最后,弄得乱七八糟,进退两难,如果你也有同样的感受,请跟着文章慢慢来一次如何进入编辑器,保存并退出打开终端,输入vi myfirstfile ,此时如果文件已存在,打开后就是进入这个文件,如果文件不存在,那么就是新建个“myfirstfile ”文件然...原创 2019-07-25 22:05:31 · 160 阅读 · 0 评论