Recently, when I was doing that test framework, I found another Python class that obtained the return value and output of the system execution command.At the very beginning, Os.system () was used in Python to learn that the method is similar in many
1.mysql use a MySQL plugin from mysqludf to implement calling external programs and system commandsDownload Lib_mysqludf_sys Program: Https://github.com/mysqludf/lib_mysqludf_sys2. Installation instructions: 2.1 Query MySQL plugin path:In MySQL,
1. Display the name of the current login WhoAmI or who am I2. Switch User suSU user name or Su-user name Su-rootsu after add-and no-add-what is the difference? add-After, not only to switch to other users, but also the environment variables
01. chattr format = chattr [+-=][option] File or directory name+: Increase Permissions-: Delete Permissions=: equals permissionLsattr: View chattr permissionsOptions:I: If the file is set I property, then the file is not allowed to delete, rename,
Command name: grepCommand function:Text Lookup or search toolDetailed Description:You can also search for text with regular expressions and print out the matching rowscan also be used to filter and search specific strings, using very flexibleCommon
The 1.echo output character, or the value of the output variable. 2.date%y: Year;%m: month;%d: day;%H: Hour, 24-hour system,%I: Hour, 12-hour system,%m: minutes,%s: seconds,%F: year-month-day,%T: hour-minute-second;-S: set date and time; 3.reboot
System InformationThe processor architecture of the Arch Display machine (1)UNAME-M Display the processor architecture of the machine (2)Uname-r displaying the kernel version in useDMIDECODE-Q Display hardware system components –
1. Files and directories 1.1, File/folder permissionsUsage:(1) chgrp group_name Dir_name/file_name,(2) Chown User_name:group_name dir_name/file_name(3) chmod 777 Dir_name/file_name,-R can be recursiveNote: "1" in 4 is r,2 to w,1 X, the end of the +_
Common commands for linux system I. common commands for linux systems 1. command date is used to view and set the time of the current system: format the display time: date + % Y -- % m -- % d2. command hwclock (clock) is used to display the clock
The newly installed Linux cannot run the ifconfig command:Bash: ifconfig command not foundIn fact, the ifconfig directory is no longer configured in environment variables. This program is actually in the/sbin directory. In fact, sbin contains some
To run the centos command in PHP, follow these steps:
Vi/etc/sudoers
Add apache ALL = (ALL) NOPASSWD: ALL
Then add sudo to php to execute any command.
Exec ("sudo reboot ");
?>
If the system runs sudo, the response speed is very
When we use a Linux system at ordinary times, there are some quick commands and operation skills in both the terminal and on the graphic desktop. This article will briefly introduce the following common methods to beginners: 1. processing
When we
If you are using Linux, remember not to let the dumb enter the following commands, although these commands seem quite complex, but it will still have a serious impact on your system.
If you are using Linux, remember not to let the dumb enter the
Using phpsystem to execute a PHP file is different from running the file directly in windowscmd. Who knows the difference? Use php system to execute a php File
Different from running the command in windows cmd, who knows the difference?
Reply
Here we will introduce a little-known command in WINXP and win2000: syskey
This command can effectively enhance your system security. Maybe you have to enter your account and password when entering XP or 2000. Isn't this safe? You should have
The code is as follows:
Copy CodeThe code is as follows:
#include
#include
#include
#include
#include
int main (int argc,char * argv[])
{
uid_t Uid,euid;
Char cmd[1024]= "Chmod-r 777";
Python calls Shell scripts in two ways: OS. system (cmd) or OS. popen (cmd), the former returns the exit code of the script, and the latter returns the output content during script execution. So we generally think popen is more powerful.
OS. system
1. Publish messagesCommand: net send
Function: You can use this command to send messages to users in the LAN, such as notifying meetings and notifying tasks.
Format: net send IP address (computer name) "message content"
Application instance:
If you
ZZ: http://blog.csdn.net/ilittlesheep/article/details/7539192
Common scutil -- set (SUDO), networksetup (SUDO), NSLookup
1. List all Network Services$ Sudo networksetup-listallnetworkservicesAn asterisk (*) denotes that a network services is
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.