Method/Steps
-
Open the software, click New, enter the IP address you want to access in the Host field, and choose any name you like.
-
After clicking File, click Open:
-
You will then see the session you just created:
-
Click Connect, and the screen below will appear. Enter the username and password to connect successfully.
-
Commonly used commands:
Commonly used commands in suse linux
(1) Command ls — list files
ls displays files in the current directory
ls -la gives a long listing of all files in the current directory, including “hidden” files that begin with a dot
ls a* lists all files in the current directory that begin with the letter a
ls -l *.doc gives all files in the current directory that end with .doc
(2) Command cp — copy files
cp afile afile.bak copies the file to a new file named afile.bak
cp afile /home/bible/ copies the file afile from the current directory to the /home/bible/ directory
cp * /tmp copies all non-hidden files in the current directory to the /tmp/ directory
cp -a docs docs.bak recursively copies the docs directory in the current directory to a new directory named docs.bak, preserves file attributes, and copies all files, including hidden files beginning with a dot. For convenience, the -a option includes the -R option.
cp -i prompts the user before overwriting
cp -v tells the user what it is doing
cp -r
(3) Command mv — move and rename files mv aflie bfile renames afile to bfile
mv afile /tmp moves afile from the current directory to the /tmp/ directory
(4) Command rm — delete files and directories rm afile deletes the file afile
rm * deletes all files (non-hidden files) in the current directory. The rm command does not delete directories unless the -r (recursive) option is also specified.
rm -rf domed deletes the domed directory and all of its contents
rm -i a* deletes all files in the current directory that begin with the letter a, and prompts the user for confirmation each time a file is deleted
(5) Command cd — change directory
cd switch to the home directory
cd ~ switch to the home directory
cd /tmp switch to the /tmp directory
cd dir switch to the dir directory in the current directory
cd / switch to the root directory
cd .. switch to the parent directory
cd ../.. switch to the grandparent directory
cd ~ switch to the user’s directory; for example, if the user is root, it switches to /root
(6) Command mkdir — create a directory
mkdir phots creates a directory named photos in the current directory
mkdir -p this/that/theother creates the specified nested subdirectories in the current directory
(7) Command mkdir — delete a directory
mkdir will delete an empty directory
(8) Commands more, less — view file contents
more /etc/passwd view the contents of /etc/passwd
Function: display output one page at a time
more file
The more command can also be used together with other commands through the pipe symbol (|), for example: ps ux|more ls|more
less /etc/passwd view the contents of /etc/passwd
(9) Command grep — search file contents
grep bible /etc/exports searches all lines containing bible in the exports file
tail -100 /var/log/apache/access.log|grep 404 Search for lines containing “404” in the last 100 lines of the WEB server log file access.log
tail -100 /var/log/apache/access.log|grep -v googlebot In the last 100 lines of the WEB server log file access.log, find lines that were not accessed by google
grep -v ^# /etc/apache2/httpd.conf In the main apache configuration file, find all non-comment lines
(10) Command find — find files
find .-name *.rpm Find rpm packages in the current directory
find .|grep page Find files whose names contain page in the current directory and its subdirectories locate traceroute Find files whose names contain traceroute anywhere in the system
(11) Command vi — edit files
gvim Open the program
vi /etc/bubby.txt Edit the file /etc/bubby.txt with vi
vim /etc/bubby.txt Edit the file /etc/bubby.txt with vi
Shortcut operations:
Switch windows: alt+1,alt+2
Full screen: alt+Enter
Suspend vim (pause): ctrl+z. After suspending, you can perform other shell operations. When finished, use the fg command to switch back to the vim interface and continue editing
:MR: View historical file records (note: MR must be uppercase)
:sp Horizontal split window
:vsp Vertical split window, convenient for coding while comparing multiple files (as shown below:) emacs /etc/bubby.txt Edit the file /etc/bubby.txt with emacs
(12) Commands rz, sz — file upload and download
Run the command Sudo rz to receive a file. xshell will pop up a file selection dialog box. After selecting the file and closing the dialog box, the file will be uploaded to the current directory in linux.
Run the command Sudo sz file to send a file to windows (the save directory can be configured). It is much more convenient than the ftp command, and the server no longer needs to enable FTP service.
(13) Command cat — display file contents
cat file
(14) Command ps — view processes ps [options]
DESCRIPTION: The ps command displays information about running processes. If you want to display continuously updated process information, use the top command instead.
View every process on the system using standard syntax.
ps -e
ps -ef
ps -eF
ps -ely
(15) Command kill — terminate a process
[[email protected] ~]# kill -signal %jobnumber
[[email protected] ~]# kill -l
Parameters:
-l : this is a lowercase L; it lists which signals kill can currently use. There are 62 signals in total.
signal : indicates what kind of instruction is given to the job specified after it! Using man 7 signal, you can see:
-1 : reread the configuration file once (similar to reload);
-2 : equivalent to pressing [ctrl]-c on the keyboard;
-9 : immediately forcefully kill a job;
-15: terminate a job in the normal programmatic way. This is different from -9.
Example 1: Find the current background jobs in the bash environment and delete that job.
[[email protected] ~]# jobs
[1]+ Stopped vim bashrc
[[email protected] ~]# kill -9 %1
[1]+ Killed vim bashrc
(16) Command stop, start — restart tomcat
./catalina.sh stop
./catalina.sh start
(17) Command top — view CPU and memory
(18) Command pwd — view the current path
(19) Command tar — package and extract rar
tar -cvf **.tar a.jsp b.java package a and b into **.rar
tar -xvf **.tar a.jsp b.java extract **.tar
(20) Command tail — view detailed file information
tail -f aaa.txt view detailed information for the aaa.txt file
tail -n x aaa.log x: the last few lines
(21) Command head — view a file’s name and extension
head -n x aaa.log x: the first several lines aaa.log: the name and extension of the file to be viewed
(22) Command diff — compare file contents
diff dir1 dir2 compares whether the file lists of directory 1 and directory 2 are the same, but does not compare the actual contents of the files; if different, it lists them
diff file1 file2 compares whether the contents of file 1 and file 2 are the same; if they are text-format files, the differing content will be displayed; if they are binary code, it only indicates that the two files are different
comm file1 file2 compares files and displays the different content in the two files
(23) Command ln — create links
ln source_path target_path hard link
ln -s source_path target_path symbolic link
(24) Command touch — create an empty file
touch aaa.txt creates an empty file with the filename aaa.txt
(25) Command man — view help for a command
man ls displays the help content for the ls command
(26) Command w — display detailed information about logged-in users
Sarge:~# w
(27) Command who — display logged-in users
Sarge:~# who
(28) Command last — view which users have logged into the system recently
Sarge:~# last
(29) Command date — system date setting
date -s “060520 06:00:00″ sets the system date to 6:00 on May 20, 2006.
(30) Command
clock — clock setting
clock –r reads the time parameters from the system BIOS
clock –w writes the system time (such as the time set by date) into the BIOS
(31) Command uname — view system version
uname -R displays the version of the operating system kernel
(32) Commands reboot, shutdown — shut down and restart the computer
reboot restart the computer
shutdown -r now restart the computer; restart it after stopping services
shutdown -h now shut down the computer; shut down the system after stopping services
halt shut down the computer
Generally, use shutdown -r now; when restarting the system, it shuts down the relevant services. The same applies to shutdown -h now.
(33) Command su — switch user
su – switch to the root user
su – zhoulj switch to the zhoulj user,
Note: – is very important. If you use -, the user’s environment variables will be used.
(34) Command free — view memory and swap partition usage
Sarge:~# free -tm
(35) Command uptime — the current time, how long the system has been running since boot, the number of connected users, and the system load over the last 1, 5, and 15 minutes
Sarge:~# uptime
(36) Command vmstat — monitor virtual memory usage
# vmstat
(37) Command iostat — disk throughput
-c show only the CPU line
-d show disk lines
-k display disk output in kilobytes
-t include timestamps in the output
-x include extended disk metrics in the output
(38) Command clear — clear the screen
clear
(39) Restart tomcat
(40) Change user with chown
Change the owner or group of a file or directory chown -R -h owner file
– The R (recursive) option means the same operation is also performed on files in all subdirectories.
– The h option means that when changing the owner of a symbolic link file, the target file pointed to by the link is not affected
chown -R xh test1 (all files in the test1 directory and its subdirectories will have their owner changed to xh)
1. Check the process ID of the process to be restarted
Ps –ef|grep xxxx
2. Kill the project’s process
Kill the second column first, then the first column
Sudo kill -9 x x
(x is the process ID; when killing multiple processes, separate them with spaces)
3. Restart tomcat
First find the tomcat bin directory Cd tomcat/bin;
Then run sudo ./run.sh to start tomcat.
Maven packaging command: mvn clean package –Dmaven.test.skip=true

