linux basic commands

本文介绍了在Linux系统中常用的命令,包括man手册查询、apt包管理工具、sudo权限提升、su用户切换等,并展示了如何使用这些命令进行文件操作、目录管理及软件安装等基本任务。

1. man - an interface to the on-line reference manuals

$man man

2. apt - advanced package tool

  SEE ALSO: apt-cache, apt-get, apt.conf, sources.list

$apt-cache search mysql

3.sudo - execute a command as another user (sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.)

$sudo apt-get install python2.7

4.su - change user ID or become superuser

cc@debian:~$su
Password:
root@debian:/home/cc#su -- cc
cc@debian:~$

5. ls - list directory contents

$ls -l
$ls -la

6. pwd - print name of current/working directory

$pwd

7. mkdir - make directories

$mkdir test1

8. mv - move (rename) files

$mv test1 test2

9.rm - remove files or directories

$rm -fr test2

10.more, less - file perusal filter for crt viewing (a filter for paging through text one screenful at a time.)

$man more|less

note: '|' is pipeline, see more on wiki about pipeline

 11.grep - grep, egrep, fgrep, rgrep - print lines matching a pattern

$ls -la|grep django-web

 12.chown - change file owner and group

#chown root /u
#chown root:staff /u

 13.chmod - change file mod bits

#mkdir /data
#chmod 777 /data

 

转载于:https://www.cnblogs.com/BugQiang/p/4720060.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值