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

Shell Commands

时间:2015-09-13 09:19:09      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:

Most commands operate like this: 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.

 

 

 

 

 

 

 

 

 

Reference: http://linuxcommand.org/lc3_lts0020.php

tell you what kind of file it is.

Shell Commands

标签:

原文地址:http://www.cnblogs.com/freyfly/p/4804043.html

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