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)
Command | Result |
---|---|
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)
Command | Action |
---|---|
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.
时间: 2024-10-13 12:22:33