Linux 学习 01 基本命令
来源:互联网 发布:dnf校园网打团网络冲突 编辑:程序博客网 时间:2024/06/04 22:33
参数以-开始
一行输入多条命令,用; 分割
命令后面加 & 表示将命令放在后台运行
关机
[nathan@hadoop ~]$ shutdown -h now
[nathan@hadoop ~]$ poweroff
[nathan@hadoop ~]$ reboot
HELP
几乎所有的命令都可以使用-h或 --help获得使用方法
MAN
[root@hadoop ~]# man ls
[root@hadoop ~]# man -k pass
进入MAN 后,可以用 / 查找,f 前一页,b后一页
有些命令可能会在多个Man章节中出现,可以用
man -k cron
anacron (8) - runs commands periodically
cron (8) - daemon to execute scheduled commands
crontab (1) - maintain crontab files for individual users
crontab (1p) - schedule periodic background work
crontab (5) - tables for driving cron (ISC Cron V4.1)
crontabs (4) - configuration and scripts for running periodical jobs
anacron (8) - runs commands periodically
cron (8) - daemon to execute scheduled commands
crontab (1) - maintain crontab files for individual users
crontab (1p) - schedule periodic background work
crontab (5) - tables for driving cron (ISC Cron V4.1)
crontabs (4) - configuration and scripts for running periodical jobs
然后用man 8 cron 查看
INFO
[root@hadoop ~]# info ls
很多命令的文档都在/usr/share/doc中
history 查看历史记录.保存在 ~/.bash_history
!! 重复前一命令
!字符 重复前一个以字符开头的命令
!数字 重复历史记录中序号命令
!?abc 重复包含abc的命令
!-n 执行几个命令之前的命令
!n 执行历史命令中的第n条
!str 执行已str 开头的命令
history -c 清除历史命令
可以通过ctrl + r 可以查询历史命令
(reverse-i-search)`-a': uname -a
date
作用:获取或者设置日期
用法:date [选项] 显示时间格式(以+开头,后面接格式)
举例:
(1) 以固定格式显示时间:date +'%Y%m%d%H'
(2) 显示明天的日期:date -d ‘tomorrow’ +‘%Y-%m-%d’
(3) 显示前天的日志:date -d ‘1 days ago’ +‘%Y-%m-%d’
nathan@ubuntu:~$ date +'%Y-%m-%d %H:%M:%S'
2014-06-21 21:01:00
2014-06-21 21:01:00
nathan@ubuntu:~$ date +'%Y-%m-%d %H:%M:%S' -d"2014-06-17 00:00:00"
2014-06-17 00:00:00
2014-06-17 00:00:00
[nathan@hadoop ~]$ uptime
22:06:58 up 44 min, 1 user, load average: 0.00, 0.00, 0.00
22:06:58 up 44 min, 1 user, load average: 0.00, 0.00, 0.00
命令别名
[root@www ~]# alias lm='ls -al | more'
取消命令别名
[root@www ~]# unalias lm
0 0
- Linux 学习 01 基本命令
- linux基本命令学习
- Linux基本命令学习
- Linux 基本命令学习
- Linux 基本命令学习
- 基本Linux命令学习
- Linux学习,linux基本命令
- linux基本命令学习笔记
- 【转】linux 基本命令学习
- Linux基本命令学习《一》
- Linux基本命令学习 《二》
- linux学习(三)--基本命令
- linux基本命令学习笔记
- linux学习-------->基本操作命令
- linux基本命令学习笔记
- Linux基本命令学习总结
- linux学习笔记-基本命令
- Linux基本命令-----------------------学习笔记
- 互联网产品经理必读书籍
- SAP BW – Implementing Delta Updates in the Financial Domain
- XCode开发证书生成步骤
- Android listView 之万能Adapter
- JSONObject和JSONArray的排序
- Linux 学习 01 基本命令
- iOS计算项目有多少行代码
- mfc 在原有的按钮上添加位图
- mysql 复制原理图
- commit &rollback
- 安卓工程如何正确导入第三方jar (1) ---问题原因
- UI效果
- python中的==和is
- 【Android】【Framework】AndroidFramework之ContextImpl