参考:http://www.renfei.org/blog/mac-os-x-terminal-101.html

One command line includes 4 parts: Command Name、Options、Arguments、Extras .

man <command-name> :  Give the manual of this command.

绝对和相对路径

/ : Root directory

..  : Parent directory.

目录操作

pwd : Print working directory, which will show the absolute path of current folder.

ls  : List directory contents.      Ls –la  : List all contents including hidden contents.

cd : Change directory.

   mkdir : Make directories.

rmdir:  Remove directories.

   mvdir:  Move or rename a directory.

处理特殊字符(space, bracket, quotation mark, !, $, &, *, ;, \, …)

\ : Use back slash before the character.        cd Punlic/Drop\ Box/      ( = cd “Public/Drop Box”).

文件操作

cp  : Copy files.

mv : Move files.

rm :  Remove files

vi:  or vim :  A programmers text editor

nano:  Nano's another editor, an enhanced free pico clone.

   cat : Concatenate and print files.  It reads files sequentially, writing them to the standard output.

cat file1 : Will print the contents of file1 to the standard output.

cat file1 file2 > file3:  Will sequentially print the cntents of file1 and file2 to the file3.

cat file1 – file2 – file3:   ???

od:  Octal, decimal, hex, ASCII dump

less:

which:  Locate a program file in the user’s path.

find :   find . -name "*.c" -print

    file:  Determine file type.

head:  Display first lines of a file.  head -10 filename.

  tail:  Display the last part of a file.

cut:  Cut out selected portions of each lie of a flie.

colrm:  Remove columns from a file.    colrm 8 20 filename

diff: Compare files line by line.

sort: Sort lines of text file.

uniq:  Report or filter out repeated lines in a file.

comm: Select or regject lines common to two files.

wc:  Word, line, character, and byte count.

nl: Line numbering filter.        nl file1 > file2

进程操作

  ps : Process status     ps u

  kill : Terminate or signal a process.               kill -9 30142

The kill utility sends a signal to the processes specified by the pid operand(s).

     Only the super-user may send signals to other user's processes.

Some of the more commonly used signals:

      1  HUP (hang up)

      2  INT (interrupt)

      3  QUIT

      6   ABRT (abort)

      9  KILL (non-catchable, non-ignorable kill)

      14   ALRM (alarm )

      15  TERM (software termination signal)

时间操作: 

  date:  Display or set date and time.

  cal:  Display a calendar and the date of easter        cal 4 2015.

time: time command execution (totoal time elapsed.)

系统管理

w:  Display who is logged in and what they are doing.

  who:

whoami:

su  : Substitute user identify.

Sudo : Substitute user do, or super user do.  It allows a permitted user to execute a command as the superuser or another user.

Unix commands in Mac OS X的更多相关文章

  1. 【转】mac os、linux及unix之间的关系

    mac os.linux及unix之间的关系   unix 是由贝尔实验室开发的多用户.多任务操作系统 linux是一类Unix操作系统的统称,严格来说,linux系统只有内核叫“linux”,而li ...

  2. 【转】从Mac/OS和iOS开放源码浅谈UNIX家谱

    阅读数:1245 苹果公司在各类开源项目中长期贡献着自己的力量,但其UNIX系统技术一直都属于闭源阵营(这一点可以从NUX OS阵营和家谱图中得到答案).然而,以封闭闻名的苹果公司,2017年国庆期间 ...

  3. mac os、linux及unix之间的关系

    unix 是由贝尔实验室开发的多用户.多任务操作系统 linux是一类Unix操作系统的统称,严格来说,linux系统只有内核叫“linux”,而linux也只是表示其内核,但因为习惯使然,人们 习惯 ...

  4. 常用Linux/Unix/Mac Os命令

    常用Linux/Unix/Mac OS命令 参考: 1.50 Most Frequently Used UNIX / Linux Commands (With Examples)

  5. There are inconsistent line endings in the 'xxx' script. Some are Mac OS X (UNIX) and some are Windows.问题解决

    在Window上使用Visual Studio编辑Unity3D脚本时常会出现类似如下警告: 警告 1 There are inconsistent line endings in the 'Asse ...

  6. 操作系统Unix、Windows、Mac OS、Linux的故事

    电脑,计算机已经成为我们生活中必不可少的一部分.无论是大型的超级计算机,还是手机般小巧的终端设备,都跑着一个操作系统.正是这些操作系统,让那些硬件和芯片得意组合起来,让那些软件得以运行,让我们的世界在 ...

  7. Unix、Windows、Mac OS、Linux系统故事

    我们熟知的操作系统大概都是windows系列,近年来Apple的成功,让MacOS也逐渐走进普通用户.在服务器领域,恐怕Linux是无人不知无人不晓.他们都是操作系统,也在自己的领域里独领风骚.这都还 ...

  8. [转]操作系统Unix、Windows、Mac OS、Linux的故事

    [写得很江湖气,可惜找不到原作者了] 文章转自:http://blog.csdn.net/wenmingchan/article/details/49925379 http://www.jb51.ne ...

  9. 【转】操作系统Unix、Windows、Mac OS、Linux的故事

    电脑,计算机已经成为我们生活中必不可少的一部分.无论是大型的超级计算机,还是手机般小巧的终端设备,都跑着一个操作系统.正是这些操作系统,让那些硬件和芯片得意组合起来,让那些软件得以运行,让我们的世界在 ...

随机推荐

  1. python3获取当前目录(转)

    转自:http://www.elias.cn/Python/GetPythonPath?from=Develop.GetPythonPath 1.  以前的方法 如果是要获得程序运行的当前目录所在位置 ...

  2. leetcode 136. Single Number ----- java

    Given an array of integers, every element appears twice except for one. Find that single one. Note:Y ...

  3. sql中的字符串匹配、函数大全

    假设你想建立一个与Yahoo功能相似的Internet目录.你可以建立一个表用来保存一系列的站点名称,统一资源定位器(URL),描述,和类别,并答应访问者通过在HTML form中输入要害字来检索这些 ...

  4. 【BZOJ1009】【HNOI2008】GT考试

    依旧看人代码写,不过我觉得自己慢慢写一个也可以写成? 原题: 阿申准备报名参加GT考试,准考证号为N位数X1X2....Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字.他的不 ...

  5. ARM的工作模式和寄存器

    以前学的时候学的是S3C6410的开发板,它是三星公司推出的基于ARM v6架构(指令集),处理器是ARM11. ARM架构是构建每个ARM处理器的基础. 目前最新的是ARM v8架构:http:// ...

  6. 黑马程序员——JAVA基础之程序控制流结构之判断结构,选择结构

    ------- android培训.java培训.期待与您交流! ---------- 程序控制流结构:顺序结构:判断结构:选择结构:循环结构. 判断结构:条件表达式无论写成什么样子,只看最终的结构是 ...

  7. SoftmaxLayer and SoftmaxwithLossLayer 代码解读

    SoftmaxLayer and SoftmaxwithLossLayer 代码解读 Wang Xiao 先来看看 SoftmaxWithLoss 在prototext文件中的定义: layer { ...

  8. 在AndroidStudio中引入SlidingMenu第三方库的步骤

    步骤一:        在GitHub上下载库文件     步骤二:         在需要引入库的项目中导入一个Moudle,如下图:     步骤三:         将下载后的Slidingme ...

  9. SSH三大框架合辑的搭建步骤

    v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...

  10. oracle组件

    目前在用的四个oracle版本 Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProductionWith the Parti ...