SecureCRT common file operation commands

SecureCRT common file operation commands

Common commands:
1. ls only lists file names (equivalent to dir, dir can also be used)
-A: List all files, including hidden files.
-l: List format, including most of the attributes of the file.
-R: Display recursively.
--help: Help for this command.

2. cd change the directory
cd /: enter the root directory
cd: go back to your own directory (different users have different directories, root is /root, xxt is /home/xxt
cd ..: go back to the upper-level directory
pwd: display the current location The directory
mv file 1 file 2: change the name of file 1 to file 2
cp file 1 directory/file 2: copy file 1 to the directory file 2 name can be unchanged or


variable 3.less file name: view the file content.
tail -f log name: view the

log 4.q Exit the open file.

5. Upload the file: rz Select the file to be transferred, OK.

6. Download the file: sz Specify the file name, enter and hit, that is, it will be downloaded to the secureCRT/download directory Next. Seven :

Delete files: rm deletes files, rmdir deletes empty directories. rm -rf forcibly deletes non

-

Such as: rz --help , sz --help .

10. cd command to enter a folder:
mkdir+folder name command to create a folder
sz+file name command to send files from the server to this machine
rz command to transfer files from this machine to the server
ll list the current All files in the directory, including the detailed information of each file
dir Open the current file to the current folder
vi

11. When editing a file:
a Switch to editing mode
ctrl+c Exit editing mode
dd Delete the entire line
: q Exit the current file
: w write and save the current file
-f force the parameters of xx. . .

Other commands:
1.ps -ef //View the server process, the server process displayed in the form of a list.
ps show currently running processes /usr/bin/ps [options] -e show each currently running process -f generate a complete list

2.ant ​​-buildfile CMS_MainTrunk.xml //build package

3.vi test. txt //Browse the file content
i {insert write input}
esc exit insert
:wq! write save and exit vi mode  
: q! do not save and exit vi mode
4. Solve the garbled characters in secureCRT: Options->SessionOptions->Appearance->font change the default to UTF-8, and the Chinese font can be displayed.
6.hostname: check hostname

7.ifconfig check host IP

8. Use ctrl+c and ctrl+v under S-CRT:
Options---Global Options---Edit default Settings go in and click Terminal---Emulation and then click Mapped Keys, click the middle and lower part, use windows copy and paste key, click OK.

9. The command to enter vi:
vi filename : open or create a new file and place the cursor at the beginning of the first line
vi +n filename : open the file and place the cursor at the beginning of the nth line
vi + filename : open the file and place the Place the cursor at the beginning of the last line vi +/pattern filename: open the file and place the cursor
at the first string matching pattern nG: the cursor moves to the beginning of the nth line n+: the cursor moves down n lines n-: the cursor moves up n lines n$: the cursor moves to the end of the nth line H: the cursor moves to the top line of the screen M: the cursor moves to the middle line of the screen L : Move the cursor to the last line of the screen











0: (note the number zero) Move the cursor to the beginning of the current line
$: Move the cursor to the end of the current line

11. Screen scrolling commands:
Ctrl+u: half-screen to the
beginning of the file Ctrl+d: half-screen to the end of the file
Ctrl +f: turn one screen to the end of the file//It seems to be r
Ctrl+b; turn one screen to the beginning of the file

12. Search command:
/pattern: search pattern from the beginning of the cursor to the end of the file
?pattern: search from the beginning of the cursor to the beginning of the file pattern
n: repeat the last search command in the same direction
N: repeat the last search command in the opposite direction

postgres use:
1. Enter the sql running environment.
[test@test bin]$ ./psql -n dbname -U usrname
stay81=# select count(*) from table1;
count
-------
  5986
(1 row)

2. Exit, exit after use, otherwise The connection keeps getting hung up.
stay81=# \q 

3. postgres data export.
[postgres@test bin]$ ./pg_dump -U postgres -t testTable -d testDB > testTable.dump
Or [postgres@test bin]$ ./pg_dump -U postgres -d testDB -t testTable -F c -v > testTable.dump

4. postgres data import.
[postgres@test bin]$ ./psql -U postgres -d testDB < testTable.dump
or [postgres@test bin]$ ./pg_restore -U postgres -d testDB < testTable.dump

5. Put the database directory on one host Dump to another host.
pg_dump -h host1 -p 5432 dbname | psql -h host2 -p post1 dbname
or ./pg_dump -U postgres -d testDB1 -t testTable | ./psql -U postgres -d testDB2
-U is username, -d is DB name, -t is the table name, if the entire database is exported, this is not required.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326834667&siteId=291194637