shutdown operation
Shutdown-R now // restart immediately
5. Clear, date command
Clear: clear screen, equivalent to CLS in DOS; date: displays the current time
6. whoami, whereis, Which, ID
Whoami: confirm your identity
Whereis: query the command directory and help document directory
Which: query the directory where the command is located (similar to whereis)
ID: print your UID and GID. (UID: the unique I
, equivalent to CLS under DOS; date: display the current time.
10. mount a hardware device. Usage: Mount [parameter] device loading point: eg: Mount/dev/cdromcd/mnt/CDROM // enter the disk directory.
11. when Su does not log out, switch to another user's identity usage: su-l user name (if the user name is default, switch to the root state) eg: su-l netseek (switch to the netseek user and the user will be prompted to enter the password)
12. whoami, whe
Linux: The history Command records the operation time, Operation user, Operation IP, and linuxhistory.
[STEP]
1. Add the following content to the/etc/profile file:
2. Run: source/etc/profile
[Effect]
1 export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " 2 echo 'export HISTTIMEFORMAT="%F %T `whoami` "' 3 USER_IP=`who -u am i 2>/dev/null| awk '{print $NF}'|sed -e 's/[()]//g'` 4 xport HISTTIMEFORMAT="[%F %T][`whoami
This installation/uninstall method is applicable to various Mac OS versions, such as mavericks and lion.
Installation:
Only two steps are required: the first line command installs the tool homebrew, and the second line uses homebrew to install mysql. Homebrew is an extremely powerful tool that may be used in the future. For more information, see the official website: http://brew.sh/
Ruby-e "$ (curl-fsSL https://raw.github.com/Homebrew/homebrew/go/install )"
Brew install mysql
After installation
execution through the shell-c parameter. If no command is specified, an interactive shell is executed.
Therefore, basically the command parameters are as follows:
Start a new shell. If $ SHELL is empty, the shell defined in/etc/passwd will be used.If you use the-s parameter to pass a command name (such as sudo-s whoami), sudo/bin/bash-c whoami is actually executed.If you have not tried other commands (that
executed.Therefore, basically the command parameters are as follows:Start a new shell. If $ SHELL is empty, the shell defined in/etc/passwd will be used.If you use the-s parameter to pass a command name (such as sudo-s whoami), sudo/bin/bash-c whoami is actually executed.If you have not tried other commands (that is, you just want to run sudo-s), you will get an interactive shell with root permissions.Reme
writable, x table can runChmod g + x filename // the same group of people to execute9. clear, date commandClear: clear screen, equivalent to cls in DOS; date: displays the current time.10. mount a hardware deviceUsage: mount [parameter] device load point to be loadedEg: mount/dev/cdromCd/mnt/cdrom // enter the cd directory11. su switches to another person's identity without logging out.Usage: su-l user name (if the user name defaults, the user name is switched to the root state)Eg: su-l netseek
indicates the file owner. g indicates the group of the file. O indicates others; r table readable; w table writable; x table can run
Chmod g + x filename // the same group of people to execute
9. clear, date command
Clear: clear screen, equivalent to cls in DOS; date: displays the current time.
10. mount a hardware device
Usage: mount [parameter] device load point to be loaded
Eg: mount/dev/cdrom
Cd/mnt/cdrom // enter the cd directory
11. su switches to another person's identity without logging
Linux deployment Symfoy2 permissions settings for App/cache and app/logs directories, symfoy2logs
After deploying the Symfony2 under Linux, it is possible to report app/logs or App/cache directories without write permission when accessing the directory. Under Linux, if the user we landed at the command line is different from the user of the Web application server (Apache, Nginx, etc.),
You can use the following four methods to solve this problem.
1. Use ACLs on systems that support chmod +a
Several simple shell programs were written these days, and then all appeared syntax error near unexpected token ' ('Error, and then it is not possible to check the error, the reason behind Baidu was found:The previous error program fragment is as follows:usr=$ (WhoAmI)dr=$ (PWD)The following errors are indicated:Syntax error near unexpected token ' ('Later only to know that the original is a space between the $ and the left parenthesis, correct the pr
meaning is to trace all system calls (-e Trace=all) of the 28979 process, and to count the time spent on the system call, as well as the start time (and display in the visual hour-in-seconds format), and finally the recorded result exists in the Output.txt file.2. In the Umount mount directory, directly stuck, and finally with strace df-th analysis results mount problemsStrace df-th3. Trace the output of the WhoAmI with Strace:Strace-o
User version Information view1. View current system User login information: whoCommand name: Who command path:/usr/bin/who Execute permissions: All user syntax: Who function Description: View current system User login information supplement: W command provides more powerful features than the WHO command2. View Current user identity: WhoAmICommand name: WhoAmI command path:/usr/bin/whoami Execute permissions
I. Description of the procedureThe SSH client implementation mainly has the following four issues:The first question is which package implementation is used by the SSH client in python----we're using Paramiko.The second question is how to connect the server----connect to the server directly using the Connect () function, there is a pit is not in the known_hosts file of the machine by default does not allow the connection need to deal withThe third question is how to execute a command after a con
At work, we need to record every command executed by the user and send it to the log server, so I have made a simple solution. This scheme sends every command executed by the user to the log daemon rsyslogd when each user exits the login, and you can further send the log to the log server by configuring "Etcrsyslog.conf"The first of these methods# VI Etcprofile#设置history格式Export histtimeformat=[%y-%m-%d%h%m%s] [' Who Am I 2devnullawk ' {print $NF} ' sed-e ' s[()]g ']#记录shell执行的每一条命令Export prompt
At work, we need to record every command that the user executes and send it to the log server, and I have done a simple solution. This scheme sends every command executed by the user to the log daemon rsyslogd every time the user exits the login, and you can further send the log to the log server by configuring "/etc/rsyslog.conf"
The first of these methods
The code is as follows:
# Vi/etc/profile
#设置history格式
Export histtimeformat= "[%y-%m-%d%h:%m:%s] [' Who am I 2>/dev/null| \
a
Daemon implementation has the default mentality fork parent-child process, shut down the parent process, the child process with the console out of the operation, my side of the Daemon demo implementation is through the signal to control the output of the daemon process. First look at the code:
#include
Then we enter another console's device path in the pipe file, and the subprocess is the daemon shuts down the standard output and then receives the signal to read the device path in the pipe
;
Although it is OK to do so, but I suggest you do not do so, it is best to define only one namespace in each file, lest you get confused.
Child namespaces
PHP allows you to define a hierarchy of namespaces so that the libraries can be subdivided, and the child namespaces are separated by a backslash character (\), such as:
Myproject\subname
Myproject\database\mysql
Companyname\myproject\library\common\widget1
Calling namespace code
In the lib1.php file we define a constant, a functi
optional-that is, you can use the WHO command without any options when the WHO command will display the following three items loginname login user name Terminalline use end device Logintime log on to the system if you give two non-option parameters then the WHO command will only show the shipped User name of the WHO program logon terminal and logon time usually these two parameters are ami that is, the command format for whoami under the common param
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.