1. Instructions for displaying dates: date
2. [Tab] button---with "command completion" not "file full" function
3:su and Sudo
Su is used for switching between users. Su does not add any parameters, the default is to switch to the root user; Su plus parameter-, which means to switch to the root user by default, and change to the root user's environment;
sudo is used by a normal user to execute a specified command using root privileges.
sudo: temporarily switch to Superuser mode to perform superuser privileges, prompting for a password that is the current user's password, not the password for the super account. However there is a time limit, Ubuntu defaults to 15 minutes for one time.
SU: Switch to a certain user mode, prompted to enter the password when the password is Switched account password, the use of "SU account name." If the system defaults to the root account when no account is added, the password is also the password for the super account. There is no time limit.
Sudo-i: You can use this command to frequently perform certain permissions that only the superuser can perform, without having to enter the password each time. When prompted for a password, the password is the password for the current account. There is no time limit. After executing the command, the prompt changes to "#" instead of "$".
You can perform "exit" or "logout" when you want to return a regular account.
4:mkdir-p parent/child/xxxx Create directory, if no parent directory, create p (parent)
5:echo create a file with content.
echo content > filename (Note that unlike touch, touch creates an empty file)
6:find finds files in the current directory, supports regular.
Find *.txt
7:grep finding a string in a text file
grep word filename
8:ln creating a linked file
This is a very important command in Linux, please be familiar with it. Its function is to create a synchronized link to a file or directory in another location, similar to a hyperlink under Windows.
ln command
This command creates a link between the files. This kind of operation is actually to give a file that already exists in the system to specify another name that can be used to access it. For this new file name, we can specify different access rights to control the sharing and security of the information. If the link is to a directory, the user can use the link to go directly to the linked directory without having to hit a lot of path names. Moreover, even if we delete this link, it will not destroy the original directory.
There are two types of links, one called hard links, and the other called Symbolic links (symbolic link). When a hard link is established, the linked file and the linked file must be in the same file system, and a hard link to the directory cannot be established. For symbolic links, there is no such problem. By default, LN produces a hard link.
A soft connection (symbolic link) is also called a symbolic connection, connected with a soft connection and a hard link. Symbolic connections are equivalent to shortcuts under Windows.
It is not possible to make hard connections to folders/directories, we usually use more soft connections.
Ln-s Source Dist # establishing a soft connection
ln Source Dist # to establish a hard connection
Linux Learning 2 Common commands