Linux学习笔记(二)命令格式与简单命令
来源:互联网 发布:mac win10 黑屏 编辑:程序博客网 时间:2024/05/29 17:08
本文是我读《鸟哥的Linux私房菜》的学习笔记。
命令格式
命令格式: command [-options] parameter1 parameter2...
例如:
gin@ubuntu :~$ ls -al ~
命令为ls;选项为-al;参数为~ 该命令的功能为列出主文件夹下的所有文件(包括隐藏文件)与相关的文件属性。
其中,-a表示列出主文件夹下的包括隐藏文件在内的所有文件,-l表示列出相关的文件属性。
注意:
- 在Linux系统中,命令区分大小写。
- 命令太长,则用反斜杠(\)来转移[Enter]字符。([Enter]一般是代表一行命令的开始启动,这里以反斜杠来进行转义)
- 命令中无论有多少个连续空格,则一定当做一个空格看。例如:gin@ubuntu :~$ ls -al ~等同于gin@ubuntu :~$ ls -al ~
更改支持语言
使用 echo $LANG命令可以显示当前的支持语言。
使用 LANG = en_US 命令可以更改当前支持语言。en_US 代表美国英语。
如下:
注意:这仅仅是在当前这次登陆更改了支持语言。
几个简单的命令
1.帮助命令:--help
2.显示日期与时间:date
以下是使用date --help帮助命令调出的一些格式
%% a literal %
%a locale's abbreviated weekday name (e.g., Sun)
%A locale's full weekday name (e.g., Sunday)
%b locale's abbreviated month name (e.g., Jan)
%B locale's full month name (e.g., January)
%c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
%C century; like %Y, except omit last two digits (e.g., 20)
%d day of month (e.g., 01)
%D date; same as %m/%d/%y
%e day of month, space padded; same as %_d
%F full date; same as %Y-%m-%d
%g last two digits of year of ISO week number (see %G)
%G year of ISO week number (see %V); normally useful only with %V
%h same as %b
%H hour (00..23)
%I hour (01..12)
%j day of year (001..366)
%k hour, space padded ( 0..23); same as %_H
%l hour, space padded ( 1..12); same as %_I
%m month (01..12)
%M minute (00..59)
%n a newline
%N nanoseconds (000000000..999999999)
%p locale's equivalent of either AM or PM; blank if not known
%P like %p, but lower case
%r locale's 12-hour clock time (e.g., 11:11:04 PM)
%R 24-hour hour and minute; same as %H:%M
%s seconds since 1970-01-01 00:00:00 UTC
%S second (00..60)
%t a tab
%T time; same as %H:%M:%S
%u day of week (1..7); 1 is Monday
%U week number of year, with Sunday as first day of week (00..53)
%V ISO week number, with Monday as first day of week (01..53)
%w day of week (0..6); 0 is Sunday
%W week number of year, with Monday as first day of week (00..53)
%x locale's date representation (e.g., 12/31/99)
%X locale's time representation (e.g., 23:13:48)
%y last two digits of year (00..99)
%Y year
%z +hhmm numeric time zone (e.g., -0400)
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)
%a locale's abbreviated weekday name (e.g., Sun)
%A locale's full weekday name (e.g., Sunday)
%b locale's abbreviated month name (e.g., Jan)
%B locale's full month name (e.g., January)
%c locale's date and time (e.g., Thu Mar 3 23:05:25 2005)
%C century; like %Y, except omit last two digits (e.g., 20)
%d day of month (e.g., 01)
%D date; same as %m/%d/%y
%e day of month, space padded; same as %_d
%F full date; same as %Y-%m-%d
%g last two digits of year of ISO week number (see %G)
%G year of ISO week number (see %V); normally useful only with %V
%h same as %b
%H hour (00..23)
%I hour (01..12)
%j day of year (001..366)
%k hour, space padded ( 0..23); same as %_H
%l hour, space padded ( 1..12); same as %_I
%m month (01..12)
%M minute (00..59)
%n a newline
%N nanoseconds (000000000..999999999)
%p locale's equivalent of either AM or PM; blank if not known
%P like %p, but lower case
%r locale's 12-hour clock time (e.g., 11:11:04 PM)
%R 24-hour hour and minute; same as %H:%M
%s seconds since 1970-01-01 00:00:00 UTC
%S second (00..60)
%t a tab
%T time; same as %H:%M:%S
%u day of week (1..7); 1 is Monday
%U week number of year, with Sunday as first day of week (00..53)
%V ISO week number, with Monday as first day of week (01..53)
%w day of week (0..6); 0 is Sunday
%W week number of year, with Monday as first day of week (00..53)
%x locale's date representation (e.g., 12/31/99)
%X locale's time representation (e.g., 23:13:48)
%y last two digits of year (00..99)
%Y year
%z +hhmm numeric time zone (e.g., -0400)
%:z +hh:mm numeric time zone (e.g., -04:00)
%::z +hh:mm:ss numeric time zone (e.g., -04:00:00)
%:::z numeric time zone with : to necessary precision (e.g., -04, +05:30)
%Z alphabetic time zone abbreviation (e.g., EDT)
简单例子:
显示日历命令:cal
命令格式:cal [ [month] year ]
如下:
计算器:bc
退出是quit命令。
注意:命令行模式有两种命令:
- 一种是该命令会直接显示结果并返回到命令提示符,等待下一个命令。例如cal命令。
- 一种是进入到该命令的环境,知道结束该命令才会回到命令提示符。例如bc命令。
- Linux学习笔记(二)命令格式与简单命令
- 【Linux】Linux命令学习(笔记二)
- linux命令学习笔记二
- 慕课Linux学习笔记:Linux命令格式
- 二.linux学习笔记-命令基本格式及文件处理命令
- 温故而知新--Linux学习笔记(二)实用的简单命令的简单用法
- Linux 学习笔记(一) -----命令基本格式
- Linux学习笔记(一)基本命令格式
- Linux命令与格式
- linux笔记(二)(命令的基本格式及文件处理命令)
- linux命令笔记(二)
- 【Linux学习笔记二】Shell基本命令
- Linux 学习笔记(二) -----文件处理命令
- 【Linux学习笔记】二、权限管理命令
- Linux Shell 学习笔记(二) 命令
- linux 命令学习(二)
- Linux笔记(4)——命令基本格式与文件处理命令
- Linux学习笔记:Linux基础命令之二(Linux命令帮助的获取)
- Hadoop 写SequenceFile文件 源代码
- [Professional.Flash.Mobile.Development]
- Qt 无边框、透明、可移动、的个性窗体案例详解
- 《Linux keepalived与lvs的深入分析》
- W3C DOM 规范和时间线
- Linux学习笔记(二)命令格式与简单命令
- C++语法基础--泛型算法(generic algorithm)--transform
- Http 请求处理流程
- redis java配置
- 推荐18个非常棒的Web和移动开发框架
- mosquitto和python的使用
- 浅谈manacher算法
- C++Builder向DBF读写BLOB字段内容
- 2013Q2 ERP巡检总结