Article October 20, 2019

linux指令记录

Words count 7.2k Reading time 7 mins. Read count 1000000

根目录下的子目录的简单说明

/bin:主要放置基本命令。
/boot:主要放置与系统启动相关的文件。
/dev:主要放置设备文件。
/etc:主要放置配置文件。
/home:主要是所有用户的个人主目录。
/lib:主要存放库文件。
/lost+found:当文件系统发生故障时,用于存放找不到正确存储位置的文件。
/media:主要用于可移除设备的自动挂载,比如cdrom、usb盘等。
/mnt:临时挂载其他文件系统。早期系统中只有/mnt,可用于挂载cdrom、usb盘等,增加了/media目录用于自动挂载设备后,/mnt目录主要用于临时挂载。
/opt:可以将一些应用程序安装到该目录。
/proc:该目录是虚拟文件系统,其文件放在内存而非磁盘,主要保存系统运行时的一些信息,比如进程信息、内核信息等。
/root:系统管理员root的个人主目录。
/run:主要存放程序运行时的一些信息,如进程PID等。
/sbin:主要存放系统命令,例如系统管理员对系统进行设置的一些命令等。
/srv:用于存放服务程序需要使用的文件。
/sys:与/proc类似,也是虚拟文件系统,用于记录内核相关信息,比如硬件设备信息等。
/tmp:用于存放临时信息,如用户或者程序运行时的一些临时文件等,系统重新启动时,会删除该目录下的文件。

更换Unbuntu的源:

sudo gedit /etc/apt/sources.list
-----------------------------------------------------------------------------
#阿里云的源:
deb http://mirrors.aliyun.com/ubuntu/ xenial main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main

deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main

deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates universe

deb http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security universe
-----------------------------------------------------------------------------
sudo apt-get update
sudo apt-get upgrade

设置中文的方法:

sudo apt-get install  language-pack-zh-han*

然后再在语言设置中修改语言即可

安装中文输入法:

sudo apt-get install fcitx
sudo dpkg -i sogoupinyin_2.3.1.0112_amd64.deb

再到语言设置中改一下就可以了

加快PIP下载的办法:

cd ~   先切换到home文件夹下;

ls -a   查看是否有.pip的文件,没有的话创建

mkdir .pip  创建.pip文件夹

cd .pip    进入.pip文件夹

touch pip.conf  创建pip.conf的文件

在 pip.conf文件内添加以下内容, 可用vim也可以手动打开复制粘贴
[global]
   index-url = https://pypi.tuna.tsinghua.edu.cn/simple

安装angr的方法:

因为我直接用kali安装,所以不在乎python的问题,不想创造虚拟环境直接安装

pip install angr
pip install monkeyhex
-------------------------------
安装CFG可视化
CFG可视化:angr-utils能够实现CFG(以及其他流图)的可视化
-------------------------------
git clone https://github.com/axt/bingraphvis
pip install -e ./bingraphvis
git clone https://github.com/axt/angr-utils
pip install -e ./angr-utils

更换主题:

首先要安装下gnom-tweaks-tool:

sudo add-apt-repository universe
sudo apt install gnome-tweak-tool

解决没有安装gnome的方法:

https://blog.csdn.net/m0_37407587/article/details/87911749

最后就可以安装主题了

编译汇编代码:

vim hello.asm
nasm -f hello.asm
ld -m  elf_i386 -s -o hello hello.o

docker安装:

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg-agent \
    software-properties-common
---------------------------------------------------
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
----------------------------------------------------
sudo apt-key fingerprint 0EBFCD88
----------------------------------------------------
sudo apt-get update
----------------------------------------------------
sudo apt-get install docker-ce
----------------------------------------------------

doker加速安装镜像的方法:

sudo tee /etc/docker/daemon.json <<-'EOF'
>{ 
>"registry-mirrors": ["https://8mae0prx.mirror.aliyuncs.com"] 
>}
>EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
0%