Linux命令总结

1.备份
cpio

tar

dump

dd
cp


2.磁盘管理
df -h /root
du -sh /root
fdisk
mount
ex2
fscn
lvm

3.swap区建立2种方法

4.X11

5.sudo 命令配置

6.quota配置

7.find

8.umask

9. ssh sftp shttp

 

10. shell中ftp操作:EOC

ftp -n "$host" > "$basedir"/"$filename".log 2> "$basedir"/"$filename".log <<EOC 
user    $id         $pw 
binary 
cd      $remodir 
put     $filename 
bye 
EOC

(from vbird linux)

11. xargs

cat delete_file.txt |xargs rm -f

 

12login shell:. /etc/profile   /etc/profile.d

 none login shell: ~/.bash_profile  ~/.bashrc   /etc/bashrc

 

13.suid vs. sudo

     sticky : files in directory with the sticky bit set can only be removed by owner or root regardless of the write

      sgid: file created in directory with sgid bit set have group  affiliations of the group of the directory

       Both sgid and sticky bit are set on the group directory

14. vi

ctrl+d ctrl +u

1G

G

H M L: current screen

yy yw yl dd dw dc cc cw cl

2yy

p P

a i

!!command: output of command is inserted into file

!}command: text as input

:1,10s/sting1/sting2/g:  use sed to replace sting1 witn sting2 globally from line 1 to line 10

 1,$(  %   ): from line 1 to the lastest line

  .,.+10: current line to +10

 

:r file   read file into

:1,20w file

 

:set all

:set number

:se nonu

 

15. Magic SysRQ: http://en.wikipedia.org/wiki/Magic_SysRq_key

16.OOPS

17.User management

useradd  /etc/passwd /etc/shadow /etc/group
passwd
usermod
id userid
chown
usermod -g 
usermod -L
usermod -U
userdel -r username
chage

newusers filename

groupadd
groupmod
groupdel


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值