资讯专栏INFORMATION COLUMN

Linux 常用命令

lingdududu / 888人阅读

摘要:常用命令收集这篇笔记是笔者整理的一些简单有用的命令,供平时查阅。

Linux 常用命令收集

这篇笔记是笔者整理的一些简单有用的 Linux 命令,供平时查阅。

文件权限与用户权限
# change file mod
chmod +rwx file
chmod 777 file
# 数字模式是使用二进制计算出来的,三位分别代表 owner,group,others,4 - r, w - 2, x - 1,则 7 = 4 + 2 + 1 = rwx
chown -c root ./hello.txt # change owner to root
chgrp -c root ./hello.txt # change group to root
# change login shell:
chsh
# or edit /etc/passwd.
# get /etc/passwd file in cygwin system:
mkpasswd -c | sed -e "sX/bashX/zshX" | tee -a /etc/passwd
文件查看与搜索
# 显示文本文件,展示,查看文件开头部分,查看文件尾
cat file | less
head file
tail file

# find [path] [expr]
find /var /usr -name "*.pdf" # use -iname to ignore A or a
find /var -name "*.pdf" -a "*.txt" # -a means and
find /var -name "*.pdf" -type d # d means dir
find /var -name "*.pdf" -size +100c # +100c means more than 100 chars.
find .name "*.sh" ­-type f ­-exec cat {} ; # run `cat` for all finded files.
find . -type f -mmin -10 # any file changed in passed 10 minute.
find . -ctime -10 # change time, by day. ctime = change time, mtime = modified time, atime = access time.
locale # like find, but much speeder becase of using a datebase(update once perday).

# Search bin file path in PATH
which progName
# Search bin file path in system
whereis progName
apropos # 寻找具有 XXX 功能的命令
type CMD # make sure where a cmd from, bash or exec.
文件、文件系统管理
ln source_file target_dir
# make soft link: 
ln -s source_file_or_dir target_dir

tar -cvf  to_filename form_dir # 自动识别后缀名压缩
tar -tvf filename # 自动识别后缀名浏览文件内容
tar -xvf filename # 自动识别后缀名解压
# tar 其他选项: c:创建,x:解压,t:查看

# !!! Very useful !!!
# also work on mac
# check finder"s disk usage
du -sh ./*
用户管理
userdel username
useradd username
groupadd groupname
groupdel groupname
进程管理
ps # list all process 
top # an interact program to manage process
lsof # list opened files
kill 234 # kill a process by pid
nice # run a program with modified scheduling priority
renice # alter priority of running process
其他
history # command history
id # my uid gid etc.
fsck.ext4 -p /dev/sdb1 # rapair EXT4 file system

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/10121.html

相关文章

  • Linux面试必备20个常用命令

    摘要:重点正常停止一个进程。三种模式的转换图命令模式用户刚刚启动,便进入了命令模式。此状态下敲击键盘动作会被识别为命令,而非输入字符。底线命令模式可以输入单个或多个字符的命令,可用的命令非常多。 ...

    leeon 评论0 收藏0
  • Xshell中操作Linux常用命令

    摘要:作为专业的终端模拟器,可以用来登录,从而通过命令来控制系统,下面就讲述下具体操作技巧。图关闭系统以上就是给大家介绍的在中操控的常用命令,希望可以帮助大家更好地借助终端模拟器来控制系统。 Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户、多任务、支持多线程和多CPU的操作系统。Xshell作为专业的终端模拟器,可以用来登录Linux,从而通过...

    mumumu 评论0 收藏0
  • Xshell中操作Linux常用命令

    摘要:作为专业的终端模拟器,可以用来登录,从而通过命令来控制系统,下面就讲述下具体操作技巧。图关闭系统以上就是给大家介绍的在中操控的常用命令,希望可以帮助大家更好地借助终端模拟器来控制系统。 Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户、多任务、支持多线程和多CPU的操作系统。Xshell作为专业的终端模拟器,可以用来登录Linux,从而通过...

    RancherLabs 评论0 收藏0
  • 01Linux常用指令

    摘要:二常用的指令语法功能显示用户当前的身份。的作用是显示当前目录的文件和子目录。语法选项指令功能查看指令的使用规则等。 所有的指令不要强制记忆,选项要多多查一下,多多练...

    ethernet 评论0 收藏0
  • linux 常用命令汇总

    摘要:常用命令汇总本质文件系统,一切皆文件命令选项参数彼此之间要用空格命令本质上就是一个程序文件,选项和参数本质上都是参数中的大小写是敏感的,单词容易拼错建议初学者使用快捷键对命令的自动补全按一下自动补全,如果没有自动补全代表有多个候选项按两 linux 常用命令汇总 linux本质 linux : 文件系统,一切皆文件 命令、选项、参数彼此之间要用空格 命令本质上就是一个程序文件,选项和...

    awesome23 评论0 收藏0
  • linux 常用命令汇总

    摘要:常用命令汇总本质文件系统,一切皆文件命令选项参数彼此之间要用空格命令本质上就是一个程序文件,选项和参数本质上都是参数中的大小写是敏感的,单词容易拼错建议初学者使用快捷键对命令的自动补全按一下自动补全,如果没有自动补全代表有多个候选项按两 linux 常用命令汇总 linux本质 linux : 文件系统,一切皆文件 命令、选项、参数彼此之间要用空格 命令本质上就是一个程序文件,选项和...

    lifefriend_007 评论0 收藏0

发表评论

0条评论

lingdududu

|高级讲师

TA的文章

阅读更多
最新活动
阅读需要支付1元查看
<