Linux 基础

来源:互联网 发布:500px知乎什么意思 编辑:程序博客网 时间:2024/06/16 17:12

入门教程(鸟哥):http://cn.linux.vbird.org/linux_basic/linux_basic.php

路径切换:
cd - 当上一条cd命令正确时,返回上一个非cd操作路径

修改文件读写权限:
先看文件夹下文件状态:ll
修改文件权限:chomd 777 +[filename]

ps:
r=4,w=2,x=1
若要rwx属性则4+2+1=7;
若要rw-属性则4+2=6;
若要r-x属性则4+1=5。

查找指定进程:
ps -ef|grep [keywords]

查找占用文件的进程:
lsof | grep [filename]

ps: 强制杀进程:kill -9 [pid]

ssh免密登录/拷贝
~/.ssh/id_rsa.pub 访问机的密钥
~/.ssh/authorized_keys 被访问机录入访问机密钥

增加免密访问帐号
ssh-copy-id [-i [identity_file]] [user@]machine
or
scp ~/.ssh/id_rsa.pub [user@]10.10.10.10:~
The authenticity of host ‘10.10.10.10 (10.10.10.10)’ can’t be established.
RSA key fingerprint is fc:97:3d:2b:06:06:84:af:fb:c3:61:89:e6:99:fa:51.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘10.10.10.10’ (RSA) to the list of known hosts.
Password:
id_rsa.pub
===# cat ~/id_rsa.pub >> ~/.ssh/authorized_keys

生成tags文件:
在当前目录下运行:Ctags -R .

原创粉丝点击