Shell Commands

reference: http://linuxcommand.org/index.php

 

What does most commands operate look like?  "command -options arguments".

 

pwd (print working directory)

cd (change directory).

    Absolute pathname: "cd /home/students" ;

    Relative pathname: "cd .." (parent directory) and "cd ./students" (currently working directory,  the "./" can be omitted)

    Shotcuts:

    "cd " to your home directory"

    "cd ~user_name" to the home directory of the specified user

    "cd - "  to the previous one

ls (list files and directories)

 

Examples of the ls command
CommandResult
ls

List the files in the working directory

ls /bin

List the files in the /bin directory (or any other directory you care to specify)

ls -l

List the files in the working directory in long format

ls -l /etc /bin

List the files in the /bin directory and the /etc directory in long format

ls -a 

show all files include hiddend files(begig with ".")

ls -la ..

List all files (even ones with names beginning with a period character, which are normally hidden) in the parent of the working directory in long format

 

 

less (view text files)

Keyboard commands for the less program
CommandAction

Page Up or b

Scroll back one page

Page Down or space

Scroll forward one page

G

Go to the end of the text file

1G

Go to the beginning of the text file

/characters

Search forward in the text file for an occurrence of the specified characters

n

Repeat the previous search

h

Display a complete list less commands and options

q

Quit

 


file
 (
tell you what kind of file it is.

 

转载于:https://www.cnblogs.com/freyfly/p/4804043.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值