码迷,mamicode.com
首页 > 系统相关 > 详细

Linux 命令行基础

时间:2019-09-30 20:08:09      阅读:116      评论:0      收藏:0      [点我收藏+]

标签:directory   inter   multi   asi   hid   term   alt   linux   ls -l   

You can also open the terminal by pressing CTRL + ALT + T on your keyboard.

  • $whoami
    • username
  • 命令行内的复制粘贴
    • Ctrl+Shift+C or V
  • 制表符补全
    • 按 Tab
    • 例如~/Documents/Odin-Project/Web-Development-101/javascript/calculator/ 可以这样操作:cd Doc[tab]O[tab]W[tab]j[tab]cal[tab]
  • 进入项目目录并键入 code . 打开所有项目文件
  • Home Directory (~)
  • Present Working Directory (pwd)
  • List Files and Directories (ls)
    • $ ls
    • $ ls /usr/local/Listing a Different Directory
    • $ ls -aListing All Files (-a), Using the -a flag we can see both “visible” and “hidden” files and directories.
    • $ ls -lLong Form Listing (-l)
    • $ ls -lhHuman Readable Sizes (-h)
    • $ ls -lhSSorting by Size (-S), default: sorting by name
    • $ ls -ltSorting by Last Modified Time (-t)
    • $ ls -lrReverse Sort (-r)
  • Link
    • $ ln a.txt b.txtcreating a hard link
    • $ ln -s a.txt b.txt created a symbolic link
  • Change Directories (cd)
    • $ cd ~/Documents
    • $ cd ..Navigating Up (..)
    • $ cdNavigating to the Home Directory
  • Creating Directories (mkdir)
    • $ mkdir foo
    • $ mkdir -p a/b/cCreate Intermediate Directories (-p)
    • $ mkdir -v aVerbose Output (-v)
  • Copying Files (cp)
    • $ cp a.txt b.txtCopying a Single File, 1: source, 2: file copy
    • $ cp a.txt b.txt fooCopying Multiple Files
      front: source files, end: directory
    • $ cp -v a.txt b.txta.txt -> b.txt
    • $ cp -Rv foo barCopying Directories (-R)
    • $ cp -f a.txt b.txtForce Overwriting of a File (-f)
    • $ cp -i a.txt b.txtConfirm Overwriting of a File (-i)overwrite b.txt? (y/n [n])
  • Deleting Files (rm)
    • $ rm -v a.txtuses the -v flag to list files that were deleted using the rm command.
  • Moving Files (mv)
    $ mv -v a.txt b.txt
    ==
    $ cp a.txt b.txt
    $ rm a.txt

详见:Conquering the Command Line Chapter 1

Linux 命令行基础

标签:directory   inter   multi   asi   hid   term   alt   linux   ls -l   

原文地址:https://www.cnblogs.com/lonelyWMW/p/11613836.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!