本文是我讀《鳥哥的linux私房菜》的學習筆記。
命令格式: command [-options] parameter1 parameter2...
例如:
gin@ubuntu :~$ ls -al ~
命令為ls;選項為-al;引數為~ 該命令的功能為列出主資料夾下的所有檔案(包括隱藏檔案)與相關的檔案屬性。
其中,-a表示列出主資料夾下的包括隱藏檔案在內的所有檔案,-l表示列出相關的檔案屬性。
注意:
使用echo $lang命令可以顯示當前的支援語言。
使用lang = en_us命令可以更改當前支援語言。en_us 代表美國英語。
如下:
注意:這僅僅是在當前這次登陸更改了支援語言。
1.幫助命令:--help
以下是使用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)
簡單例子:
顯示日曆命令:cal
命令格式:cal [ [month] year ]
如下:
計算器:bc
退出是quit命令。
注意:命令列模式有兩種命令:
linux命令學習筆記二
find etc name passwd 2 1 tee file.txt wc l root foundation36 find etc name passwd 2 1 tee dev pts 0 file.txt wc l etc passwd etc pam.d passwd 2 可以切換到普...
linux學習筆記(二)目錄處理命令
mkdir option directory p 遞迴建立 eg mkdir p japan canglscd 到家目錄 cd 返回上次目錄 cd 到上一層目錄 ctrl l 清屏快捷鍵 相對路徑 相對於當前目錄 絕對路徑 相對於home pwd print working directory 列印...
linux學習筆記(一)命令的基本格式
root localhost root 當前登陸使用者 localhost 主機名.家目錄,home下的二級目錄 當前登陸超級使用者命令 選項 引數 例如 ls l ls lh顯示格式 前10位 第一位表示檔案型別,後面9位表示使用者和組 所有者u 所屬組g 其他人o 的許可權 用 r讀 w寫 x執...