Share some shell usage and scripts that you may not know, simple & powerful!
Before reading the following sections, readers are strongly encouraged to open a shell experiment. These are not the big roads in the shell textbooks :)
1,!$:
!$ Is a special environment variable that represents the last string of the previous command. Such as: you may be like this:
$mkdir mydir$mv mydir yourdir$cd yourdir
can be changed to:
$mkdir mydir$mv !$ yourdir$cd ! $
2, sudo !! Execute the previous command as root.
Scenario example: For example, when Ubuntu uses apt-get to install a package, it needs to be rooted. We often forget to add sudo before apt-get. Every time you have to add sudo and re-type this line of commands, then you can easily use sudo!!
[Note: In the shell, sometimes you will enter a long command, you can use !xxx to repeat the most recent command, for example, you have previously entered, vi /where/the/file/Is, next time you can use !vi to regain the last vi command. 】
3, cd – back to the previous directory.
Scenario example: The current directory is /home/a, use cd ../b to switch to /home/b. At this time, you can easily switch back and forth between /home/a and /home/b by repeatedly executing the cd – command.
(Note: cd ~ is back to your home directory, cd ~user, is to enter a user's home directory)
4,‘ALT+.’ or ‘< ;ESC> .’Hot build alt+. or esc+. You can repeat the parameters of the last command line.
5, ^old^new replaces some of the strings in the previous command.
Scene: echo "wanderful", actually wants to output echo "wonderful". It only needs ^a^o, which is very helpful for the mis-spelling of long commands. (Note: You can also use !!:gs/old/new)
6, du -s *
1. Wait queue data structureThe wait queue is implemented by a doubly linked list whose elements inc
>> load heart_scale error using the loadASCII file The number of columns in the third row of h
For ease of use, we will save the Xshell session. How to transfer the session information saved on
First, temporarily enable the network card and configure the IP: # ifconfig -a /* View all network a
XenServer multi-NIC binding implementation tutorial
Novice to see: Linux system startup time limit optimization
Linux port listener implementation tutorial
Linux text processing commands (sort and uniq)
Linux shutdown command shutdown
Loading a simple module on the Linux 2.6.12 kernel
Linux dual network card dual gateway settings for different IP segments
How to better hide the virtual hard disk
Why is there no response to playing AVI files in XP
How does Win10 turn off the positioning function? Win10 method of closing location service
How to keep the Win10 system running at the latest state
How WinXP exports cookie information
How to uninstall installed updates in Windows 8
Win10 method of hiding empty CD, floppy disk and other drive icons