Liunx ------- 基于Ubuntu系统
bashshell
moye@moye-Lenovo-G50-70m:~$
启动shell的用户名 当前虚拟控制台编号 当前目录
man bash:查看bash的手册内容
/bin:二进制目录,用于存储GNU用户级别的实用程序
/boot:引导目录,存储引导文件
/dev:设备目录,linux在该目录中创建设备节点
/etc:系统配置文件目录
/home:主目录,用户目录
/lib:库目录,存储系统和应用程序库文件
/root:根主目录
/usr:用户安装软件的目录
cd 相对路径或绝对路径
绝对路径: /usr/lib/apache
相对路径: ../ src 返回父目录usr再下降到src
ls -a -F -al -F -R -s :大小
touch test1:创建新文件 (如果显示权限不够需要重新打开终端(快捷键:Ctrl+Alt+T))
ls -il test1:查看该文件所创建的时间
cp test1 test2 :复制文件
-rw-rw-r-- 1 moye moye 0 12月 11 12:48 test1
1719154 -rw-rw-r-- 1 moye moye 0 12月 11 12:48 test2
test2:新文件的索引节点不同,表示这是一个全新的文件,创建时间和修改它的时间是相同的
cp-R dir 1 dir2 :递归复制
文件链接:1 符号链接(软链接) 2 硬链接
cp -l file1 file2 :创建文件之间的硬链接
cp -s file1 file2:软连接
//test:the name of file dir: thename of content
ls -il test*: the test file
mv test33 test5 : rename the file
mkdir dir3:make a content
rmdir dir3:delete a content
rmdir -r dir3: detete a multi-layer content
stat test1: see the file
file test1: see the type of the file
cat test1: see the content of the file
cat – n test1 : see in n line
vim编辑器
建立或打开文件 vi 文件名:vi yunwei.py
如果你启动vim时候没有指定文件名,或者文件不存在,则vim将打开一个新的缓冲区域来进行编辑,如果你在命令行中指定了一个已有的文件,则vim会将文件的整个内容读取到已经准备进行编辑的缓冲区中。
h:左移
l:右移
j:下移一行
k:上移一行
Ctrl +b: 上移一个屏幕的数据
Ctrl +f :下移一个屏幕的数据
G:最后一行
gg: 缓冲的最后一行
esc:命令模式
w filename:将文件另存为指定文件名
x: 删除当前光标位置的字符
dd:删除当前行
dw:删除当前光标位置的单词
d$:删除当前光标开始到行末尾的所有内容
y:复制
p:粘贴