Common SecureCRT commands

Source: Internet
Author: User
Tags psql
Common commands: 1. ls only lists file names (which is equivalent to dir and dir can also be used)-A: lists all files, including hidden files. -L: a list that contains most attributes of a file. -R: recursive display. -- Help: the help of this command. II. change the cd directory cd/: Enter the root directory...

Common commands:
1. ls only lists file names (equivalent to dir, dir can also be used)
-A: lists all objects, including hidden objects.
-L: a list that contains most attributes of a file.
-R: recursive display.
-- Help: the help of this command.
II. change directory with cd
Cd/: Enter the root directory
Cd: Return to your own directory (different directories vary by user, root is/root, xxt is/home/xxt
Cd...: return to the parent directory
Pwd: displays the current directory
III. less File name: view the file content.
IV. q: exit the opened file.
5. upload a file: select the file to be transferred and click OK.
6. download File: sz specifies the file name. press enter to download the file to the secureCRT/download directory.
7. delete files: rm delete files, and rmdir delete empty directories.
 
8. display the 20 recently entered commands: history 20
 
9. obtain the help command -- help to view the detailed parameters of the command, such as rz -- help and sz -- help.

 
10. run the cd command to enter a folder:
Command for creating a folder by mkdir + folder name
Sz + command for sending file names from the server to the local machine
Rz command for transferring files from the local machine to the server
Ll list all files in the current directory, including detailed information about each file
Dir to the current folder
Vi open the current file
11. when editing a file:
A switch to edit mode
Ctrl + c exit edit mode
Dd deletes the entire row
: Q: exit the current file.
: W write and save the current file
-F forcibly xx parameters...
 
Other commands:
1. ps-ef // view the server processes, which are displayed in the list.
Ps: displays the processes currently running in the system/usr/bin/ps [option]-e: displays a complete list of each currently running process-f
 
Actual operation:
--------------------------------------
1. the sshclient connects to the 10.5.1.55system (see the remote client startup instructions for securecrt.doc).
$ Cd/home/bea2/user_projects/csdomain/bin
2. view the weblogic92 service process
$ Ps-eaf | grep weblogic
Bea2 327926 331940 0 13:08:45 pts/4 grep weblogic
Webadmin 421908 368956 0 Sep 24-/usr/java5_64/bin/java-Xms256m-Xmx512m-da-Dplatform. home =/home/weblogic/bea/weblogic92-Dwls. home =/home/weblogic/bea/weblogic92/server-Dwli. home =/home/weblogic/bea/weblogic92/integration-Dweblogic. management. discover = true-Dwlw. iterativeDev = false-Dwlw. testConsole = false-Dwlw. logErrorsToConsole =-Dweblogic. ext. dirs =/home/weblogic/bea/patch_weblogic923/profiles/default/sysext_manifest_classpath-Dweblogic. name = AdminServer-Djava. security. policy =/home/weblogic/bea/weblogic92/server/lib/weblogic. policy weblogic. server
Bea2 491796 385044 17 00:12:50 pts/6 182: 55/usr/java5_64/bin/java-Xms6g-Xmx8g-javaagent: /home/bea2/user_projects/csdomain/Introscope/wily/Agent. jar-Dcom. wily. introscope. agentProfile =/home/bea2/user_projects/csdomain/Introscope/wily/IntroscopeAgent. profile-Dcom. wily. introscope. agent. agentName = AdminServer-da-Dplatform. home =/home/weblogic/bea/weblogic92-Dwls. home =/home/weblogic/bea/weblogic92/server-Dwli. home =/home/weblogic/bea/weblogic92/integration-Dweblogic. management. discover = true-Dwlw. iterativeDev =-Dwlw. testConsole =-Dwlw. logErrorsToConsole =-Dfile. encoding = GBK-Dibm. stream. nio = true-Dweblogic. ext. dirs =/home/weblogic/bea/patch_weblogic923/profiles/default/sysext_manifest_classpath-Dweblogic. name = AdminServer-Djava. security. policy =/home/weblogic/bea/weblogic92/server/lib/weblogic. policy weblogic. server
Note: Follow the prompts above to view the processes started by the login user bea2. Note that bea2 marked in red is owned by the process and 491796 is the process number.
3. run the following command to kill the process:
$ Kill-9 491796 (find the system process number based on 2 operations)
Note: After you execute the $ ps-eaf | grep weblogic command, the weblogic process with this process number is not displayed.
4. start the service
$./QuickRun. sh
 
-------------------------------------------------------------------
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! Exit vi mode without saving
4. I usually use the ps-ef command to view the server processes displayed in the form of a list; use the command pstree to view the server processes, so that the server processes displayed in the form of a tree are displayed.
The advantage of the Pstree command is that you can immediately find the parent process of a process. You may need to use the-p option to display the PID of each process, and the-u option to display the user name that starts the process.
In general, this tree structure is relatively long, so you need to execute pstree-up | less, which will allow you to view the entire process tree structure.
5. secureCRT garbled solution: Options-> SessionOptions-> Appearance-> font to default into the UTF-8, you can display the Chinese font.
 
6. hostname: check hostname
7. ifconfig query host IP address
8. use ctrl + c and ctrl + v in the S-CRT:
Options --- Global Options --- Edit default Settings, click Terminal --- Emulation, click Mapped Keys, click "use windows copy and paste key", and click "OK.

 

1. enter the SQL running environment.
[Test @ test bin] $./psql-n dbname-U usrname
Stay81 = # select count (*) from table1;
Count
-------
5986
(1 row)
9. run the following command to access vi:
Vi filename: open or create a 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 line n
Vi + filename: open the file and 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
10. move the cursor command:
}: Move the cursor to the beginning of the paragraph
{: Move the cursor to the end of the paragraph
NG: Move the cursor to the beginning of line n
N +: Move the cursor down n rows
N-: Move n rows above the cursor
N $: Move the cursor to the end of line n
H: Move the cursor to the top line of the screen
M: Move the cursor to the middle line of the screen
L: Move the cursor to the last line of the screen
0: (note the number is zero) move the cursor to the beginning of the current row
$: Move the cursor to the end of the current row
11. screen tumble commands:
Ctrl + u: half screen at the beginning of the file
Ctrl + d: Flip the half screen to the end of the file
Ctrl + f: flip the screen to the end of the file // It seems to be r
Ctrl + B; open a screen at the beginning of the file
 
12. search command:
/Pattern: Search for pattern from the beginning of the cursor to the end of the file
? Pattern: Search for pattern from the beginning of the cursor
N: Repeat the previous search command in the same direction.
N: Repeat the previous search command in the reverse direction.

Postgres usage:
2. EXIT. exit after use. Otherwise, the connection will be suspended.
Stay81 = # \ q
3. postgres data export.
[S @ test bin] $./pg_dump-U postgres-t testTable-d testDB> testTable. dump
Or [S @ test bin] $./pg_dump-U postgres-d testDB-t testTable-F c-v> testTable. dump
4. s data import.
[S @ test bin] $./psql-U postgres-d testDB <testTable. dump
Or [S @ test bin] $./pg_restore-U postgres-d testDB <testTable. dump
5. one host dumps the Database Directory to another.
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 the user name,-d is the DB name, and-t is the table name. this option is not required if the entire database is exported.
6. php execution.
[Test @ test bin] $/usr/bin/php-q./batchstart. php
 

Practice:
/Home/absys6 $ ls
Dvlp dvlp_bak20090413 personal tmp
/Home/absys6 $ cd dvlp
/Home/absys6/dvlp $ ls
/Home/absys6/dvlp $ cd SV_POLICY
/Home/absys6/dvlp/SV_POLICY $ ls
Include src
/Home/absys6/dvlp/SV_POLICY $ cd src
/Home/absys6/dvlp/SV_POLICY/src $ ls
/Home/absys6/dvlp/SV_POLICY/src $ ls * pc // filter files
/Home/absys6/dvlp/SV_POLICY/src $ grep VIP * pc // code that lists all. pc files containing VIP.
/Home/absys6/dvlp/SV_POLICY/src $ vi PlyPrmCnt. pc // view the entire file.

Author "☆cainiao Afan's path to growth"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.