设置环境变量,主要看你用的shell是哪一种:
echo $SHELL
比如我们要把/usr/xbin路径,添加到当前用户的PATH中去:
sh:
~/.shrc
PATH=${PATH}:/usr/xbin
export PATH
bash:
~/.bashrc
export PATH=${PATH}:/usr/xbin
csh,tcsh:
~/.cshrc,~/.tcshrc
set path=($path /usr/xbin)
Learn and share.
设置环境变量,主要看你用的shell是哪一种:
echo $SHELL
比如我们要把/usr/xbin路径,添加到当前用户的PATH中去:
sh:
~/.shrc
PATH=${PATH}:/usr/xbin
export PATH
bash:
~/.bashrc
export PATH=${PATH}:/usr/xbin
csh,tcsh:
~/.cshrc,~/.tcshrc
set path=($path /usr/xbin)
1、从服务器上下载文件
scp username@servername:/remote_path/remote_filename /local_path
2、上传本地文件到服务器
scp /local_path/local_filename username@servername:/remote_path
3、从服务器下载整个目录
scp -r username@servername:/remote_path/remote_foldername /local_path
4、上传目录到服务器
scp -r /local_path/local_foldername username@servername:/remote_path
1、APT安装及卸载软件
#查看已安装的软件 dpkg -l | grep ssh #查找软件 apt-cache search ssh #安装软件 sudo apt-get install ssh #卸载软件 sudo apt-get remove ssh #或者 sudo dpkg -r ssh #purge软件 sudo apt-get remove --purge ssh sudo dpkg -P ssh
2、重启网络(方法一)
ifconfig eth0 down ifconfig eth0 up
3、重启网络(方法二)
/etc/init.d/networking restart
4、刷新机器名
/etc/init.d/hostname.sh start
5、刷新环境变量
source /etc/profile
6、查看本地网络状态
ip addr netstat -na #UDP类型的端口 netstat -nupl #TCP类型的端口 netstat -ntpl
7、测试远程网络状态
ping ip_addr telnet ip_addr port traceroute ip_addr
1、挂载NTFS文件系统:
mount -t ntfs-3g /dev/sdb1 /mnt/winc -o force
2、挂载VirtualBox共享目录:
mount -t vboxsf 共享名称 /mnt/vbshare/
3、改变目录及文件所属
chown -R usergroup:user path_to_folder
4、查找
find path -name filename
find path -type f -exec grep -l - l stringtofind {} \;
5、枚举文件夹下文件大小
du -h
6、查看文件夹大小
du -sh
7、查看硬盘使用情况
df -lh
8、查看内存使用情况
vmstat free -m
#.tar tar xvf FileName.tar tar cvf FileName.tar FolderName #.gz gzip -d FileName.gz gzip FileName #.tar.gz tar zxvf FileName.tar.gz tar zcvf FileName.tar.gz FolderName #.bz2 bzip2 -d FileName.bz2 bzip2 -z FileName #.tar.bz2 tar jxvf FileName.tar.bz2 tar jcvf FileName.tar.bz2 FolderName #.Z uncompress FileName.Z compress FileName #.tar.Z tar Zxvf FileName.tar.Z tar Zcvf FileName.tar.Z FolderName #.zip unzip FileName.zip zip -r FileName.zip FolderName
如果您是刚入门的人,建议先搞清楚下面几件事情:
1、BIOS、GRUB、Linux内核的启动顺序
2、Linux内核、Linux包管理、Linux发行版是什么,选一个你喜欢的主流版本(用的人多,帮你填坑的人才多哦)
3、你的世界从此没有了C、D、E盘,只有根目录
4、读写设备,就是在读写文件
5、扔到你的鼠标,干掉图形界面,一旦习惯后,你会发现世界会更美好
6、选定一个你喜欢的编辑器,坚持下去
这个系列,其实是陆续记录下来,但还没有进行很好的整理,所以后面的章节顺序,和这里的顺序,是不一致的。
如果不全,请使用man,或者google。
开始正文:
01、第一个命令
man
02、目录及文件操作
pwd
ls
cd
mkdir
rmdir
touch
rm
mv
cat
head
tail
chown
chmod
find
ln
03、压缩及解压操作
tar
gzip
bzip2
compress
uncompress
zip
unzip
04.用户操作
who
whoami
finger
useradd
userdel
groupadd
groupdel
password
05、进程管理
ps
pstree
top
kill
cron
06、关机与重启
reboot
shutdown
07、服务管理
/etc/init.d/xxx stop/start/restart
service xxx stop/start/restart
08、网络基本操作
ifconfig
ifup
ifdown
route
netstat
nslookup
host
ping
telnet
ftp
ssh
scp
09.挂载操作
mount
umount
fdisk
10、硬件
du
df
dd
iostat
free
vmstat
11、编辑器
vi
grep
awk
12、包管理
apt
13、图形界面
startx
#格式:IP\实例名,端口号 #例如: 192.168.100.99\NEOTEST,1500
1. Basic Tools
These tools are the foundation of the JDK. They are the tools you use to create and build applications.
| Tool Name | Brief Description |
| java | The launcher for Java applications. In this release, a single launcher is used both for development and deployment. |
| javaw | The launcher for Java gui applications. |
2. Security Tools
2.1. These security tools help you set security policies on your system and create applications that can work within the scope of security policies set at remote sites.
| Tool Name | Brief Description |
| keytool | Manage keystores and certificates. |
| policytool | GUI tool for managing policy files. |
| javacpl | The Java Control Panel is a multipurpose control panel. It allows you to view and set a wide range of parameters controlling how, or if, Java technology runs on your computer. It lets you view and delete temporary files used by the Java Plug-in, which allows Java technology to be used by your Web browser to run applets; and Java Web Start, which allows you to run Java applications over the network. It allows you to control certificates, making it safe to run applets and applications over the network. It enables you to view an active deployment rule set, and to manage the exception site list. It allows you to set runtime parameters for applets that run with Java Plug-in and applications that run with Java Web Start. It provides a mechanism for updating your version of the Java platform so that you always have the latest Java Runtime Environment (JRE). And it allows you to set options for debugging, applet handling, etc. |
| ssvagent | ???ssvagent is run when java detects registry is not correct and then ssvagent tries to recover it. |
2.2. These security tools help you obtain, list, and manage Kerberos tickets.
| Tool Name | Brief Description |
| kinit | Tool for obtaining Kerberos v5 tickets. Equivalent functionality is available on the Solaris operating system via the kinit tool. For example, for Solaris 11, see the kinit reference page. |
| klist | Command-line tool to list entries in credential cache and key tab. Equivalent functionality is available on the Solaris operating system via the klist tool. For example, for Solaris 11, see the klist reference page. |
| ktab | Command-line tool to help the user manage entries in the key table. Equivalent functionality is available on the Solaris operating system via the kadmin tool. For example, for Solaris 11, see the kadmin reference page. |
3. Speed Up Tools
| Tool Name | Brief Description |
| jqs | Java Quick Starter (JQS), introduced in the Java SE 6 update 10 release, improves the initial startup time of Java applets and applications by periodically prefetching some of the most heavily used Java Runtime Environment files into memory (occupying no more than 20Mb of RAM). Later, when Java is launched, much less disk I/O is required and as a result, startup is much faster. The JQS service will perform runtime checks to determine if the system is running on battery power. If so, prefetching will be suspended until AC power is restored. This scenario is most common on laptop PCs. |
| jqsnotify | ??? |
4. Remote Method Invocation (RMI) Tools
These tools help to create applications that interact over the Web or other network.
| Tool Name | Brief Description |
| rmiregistry | Remote object registry service. |
| rmid | RMI activation system daemon. |
5. Java IDL and RMI-IIOP Tools
These tools are used when creating applications that use OMG-standard IDL and CORBA/IIOP.
| Tool Name | Brief Description |
| tnameserv | Provides access to the naming service. |
| orbd | Provides support for clients to transparently locate and invoke persistent objects on servers in the CORBA environment. ORBD is used instead of the Transient Naming Service, tnameserv. ORBD includes both a Transient Naming Service and a Persistent Naming Service. The orbd tool incorporates the functionality of a Server Manager, an Interoperable Naming Service, and a Bootstrap Name Server. When used in conjunction with the servertool, the Server Manager locates, registers, and activates a server when a client wants to access the server. |
| servertool | Provides ease-of-use interface for the application programmers to register, unregister, startup, and shutdown a server. |
| jbroker | ??? |
| java-rmi | ??? |
6. Java Deployment Tools
Utilities for use in conjunction with deployment of java applications and applets on the web.
| Tool Name | Brief Description |
| javafxpackager | Packages JavaFX applications for deployment. See Deploying JavaFX Applications for more information. |
| pack200 | Transforms a JAR file into a compressed pack200 file using the Java gzip compressor. The compressed packed files are highly compressed JARs, which can be directly deployed, saving bandwidth and reducing download time. |
| unpack200 | Transforms a packed file produced by pack200 into a JAR file. |
7. Java Web Start Tools
Utilities for use in conjunction with Java Web Start.
| Tool Name | Brief Description |
| javaws | Command line tool for launching Java Web Start and setting various options. |
| jp2launcher | ??? |
8. Java Access Bridge Tools
| Tool Name | Brief Description | jabswitch | ??? |
1. Basic Tools
These tools are the foundation of the JDK. They are the tools you use to create and build applications.
| Tool Name | Brief Description |
| appletviewer | Run and debug applets without a web browser. |
| apt | Annotation processing tool. |
| extcheck | Utility to detect Jar conflicts. |
| jar | Create and manage Java Archive (JAR) files. |
| java | The launcher for Java applications. In this release, a single launcher is used both for development and deployment. |
| javac | The compiler for the Java programming language. |
| javadoc | API documentation generator. |
| javah | C header and stub generator. Used to write native methods. |
| javap | Class file disassembler |
| jdb | The Java Debugger. |
2. Security Tools
2.1. These security tools help you set security policies on your system and create applications that can work within the scope of security policies set at remote sites.
| Tool Name | Brief Description |
| keytool | Manage keystores and certificates. |
| jarsigner | Generate and verify JAR signatures. |
| policytool | GUI tool for managing policy files. |
2.2. These security tools help you obtain, list, and manage Kerberos tickets.
| Tool Name | Brief Description |
| kinit | Tool for obtaining Kerberos v5 tickets. Equivalent functionality is available on the Solaris operating system via the kinit tool. For example, for Solaris 11, see the kinit reference page. |
| klist | Command-line tool to list entries in credential cache and key tab. Equivalent functionality is available on the Solaris operating system via the klist tool. For example, for Solaris 11, see the klist reference page. |
| ktab | Command-line tool to help the user manage entries in the key table. Equivalent functionality is available on the Solaris operating system via the kadmin tool. For example, for Solaris 11, see the kadmin reference page. |
3.Internationalization Tools
This tool helps to create localizable applications.
| Tool Name | Brief Description |
| native2ascii | Convert text to Unicode Latin-1. |
4. Remote Method Invocation (RMI) Tools
These tools help to create applications that interact over the Web or other network.
| Tool Name | Brief Description |
| rmic | Generate stubs and skeletons for remote objects. |
| rmiregistry | Remote object registry service. |
| rmid | RMI activation system daemon. |
| serialver | Return class serialVersionUID. |
5. Java IDL and RMI-IIOP Tools
These tools are used when creating applications that use OMG-standard IDL and CORBA/IIOP.
| Tool Name | Brief Description |
| tnameserv | Provides access to the naming service. |
| idlj | Generates .java files that map an OMG IDL interface and enable an application written in the Java programming language to use CORBA functionality. |
| orbd | Provides support for clients to transparently locate and invoke persistent objects on servers in the CORBA environment. ORBD is used instead of the Transient Naming Service, tnameserv. ORBD includes both a Transient Naming Service and a Persistent Naming Service. The orbd tool incorporates the functionality of a Server Manager, an Interoperable Naming Service, and a Bootstrap Name Server. When used in conjunction with the servertool, the Server Manager locates, registers, and activates a server when a client wants to access the server. |
| servertool | Provides ease-of-use interface for the application programmers to register, unregister, startup, and shutdown a server. |
6. Java Deployment Tools
Utilities for use in conjunction with deployment of java applications and applets on the web.
| Tool Name | Brief Description |
| javafxpackager | Packages JavaFX applications for deployment. See Deploying JavaFX Applications for more information. |
| pack200 | Transforms a JAR file into a compressed pack200 file using the Java gzip compressor. The compressed packed files are highly compressed JARs, which can be directly deployed, saving bandwidth and reducing download time. |
| unpack200 | Transforms a packed file produced by pack200 into a JAR file. |
| packager | ??? |
7. Java Web Start Tools
Utilities for use in conjunction with Java Web Start.
| Tool Name | Brief Description |
| javaws | Command line tool for launching Java Web Start and setting various options. |
8. Java Troubleshooting, Profiling, Monitoring and Management Tools
| Tool Name | Brief Description |
| jcmd | JVM Diagnostic Commands tool – sends diagnostic command requests to a running Java Virtual Machine. |
| jconsole | A JMX-compliant graphical tool for monitoring a Java virtual machine. It can monitor both local and remote JVMs. It can also monitor and manage an application. |
| jmc | The Java Mission Control (JMC) client includes tools to monitor and manage your Java application without introducing the performance overhead normally associated with these types of tools. |
| jvisualvm | A graphical tool that provides detailed information about the Java technology-based applications (Java applications) while they are running in a Java Virtual Machine. Java VisualVM provides memory and CPU profiling, heap dump analysis, memory leak detection, access to MBeans, and garbage collection. See Java VisualVM for more information. |
9. Java Web Services Tools
| Tool Name | Brief Description |
| schemagen | Schema generator for Java Architecture for XML Binding. |
| wsgen | Tool to generate JAX-WS portable artifacts. |
| wsimport | Tool to generate JAX-WS portable artifacts. |
| xjc | Binding compiler for Java Architecture for XML Binding. |
10. Monitoring Tools
You can use the following tools to monitor JVM performance statistics.
| Tool Name | Brief Description |
| jps | JVM Process Status Tool – Lists instrumented HotSpot Java virtual machines on a target system. |
| jstat | JVM Statistics Monitoring Tool – Attaches to an instrumented HotSpot Java virtual machine and collects and logs performance statistics as specified by the command line options. |
| jstatd | JVM jstat Daemon – Launches an RMI server application that monitors for the creation and termination of instrumented HotSpot Java virtual machines and provides a interface to allow remote monitoring tools to attach to Java virtual machines running on the local system. |
11. Troubleshooting Tools
The following tools can be used for specific troubleshooting tasks.
| Tool Name | Brief Description |
| jinfo | Configuration Info for Java – Prints configuration information for a given process or core file or a remote debug server. |
| jhat | Heap Dump Browser – Starts a web server on a heap dump file (for example, produced by jmap -dump), allowing the heap to be browsed. |
| jmap | Memory Map for Java – Prints shared object memory maps or heap memory details of a given process or core file or a remote debug server. |
| jsadebugd | Serviceability Agent Debug Daemon for Java – Attaches to a process or core file and acts as a debug server. |
| jstack | Stack Trace for Java – Prints a stack trace of threads for a given process or core file or remote debug server. |
12. Scripting Tools
The following tool can be used to run scripts that interact with the Java platform.
| Tool Name | Brief Description |
| jrunscript | Script shell for Java – Runs a script. |
13. Java Plug-in Tools
Utilities for use in conjunction with the Java Plug-in.
| Tool Name | Brief Description |
| htmlconverter | Converts an HTML page (file) containing applets to the OBJECT / EMBED tag format for Java Plug-in. |
处理方法为:
1、开始-》运行-》services.msc
把Print Spooler服务停掉
2、删除打印缓存文件夹中所有内容
C:\Windows\System32\spool\PRINTERS
3、开启Print Spooler服务
4、刷新打印任务列表