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.

 

posted on 2015-09-13 09:03  freyfly  阅读(147)  评论(0编辑  收藏  举报

导航