command first creates a Test.txt file, creates a Mytestfile file, and copies the Test.txt file to the Mytestfile directory via the CP command.File copy:File directory replication:We copy the previous test1 directory to the Test2 directory and need to append-R to the CP.Note: The CP copies the file (test.txt) Separately, cannot copy the directory, the CP and the-R can copy all directories and directories to another directory.3. Move filesDrag files on Windows with your mouse, put them in any dir
1. obtain the current system time and save the result in the file. 2. find all the hidden files in the root directory.
1. obtain the current system time and save the result in the file.
2. find all the hidden files in the/root directory (the hidden files are only invisible, and the file name starts with ".") and save the results in the hidefile file.
3. the list displays information about all files in t
Linux CD commands can be said to be the most basic Linux command statements, the other command statements to operate, are based on the use of the CD command. Therefore, to learn the common Linux commands, the first step is to learn how to use the CD command skills. 1. Command format: CD [directory name]2. Command function: Switch current directory to dirname3. C
the fifth column-C take character \ (text letter \)[[emailprotected] oldboy]# cut -d " " -f3,5 oldboy.txt |sed ‘s#,myqq #,#g‘24. How many lines does the WC statistic file have?How many rows are in the-l statistics file[[emailprotected] oldboy]# wc -l /etc/services10774 /etc/services25, DUMPE2FS display the file system (partition) informationinode sizeblock sizedumpe2fs /dev/sda3|egrep -i "block size|inode count"[[emailprotected] ~]# dumpe2fs /dev/sda3 |grep -i "inode size"dumpe2fs 1.41.12
Tags: filename logs style shell Shel highlight input Use ExecuteVIM commands are divided into two kinds, one is vim own, the other is ex, the ex command needs to enter a colon, the last return to execute, compared to the VIM command, the scope of the ex command more extensive, but also more powerful, the following list some of the commonly used ex command command function: W Save file: Q exit: X Save and exit, quite with: wq:e Edi
its next n rows to the register?" , where? is a letter, n is a number"? NYW: Saves the current line and its next n characters to the register?" , where? is a letter, n is a number"? Nyl: Saves the current line and its next n characters to a register?" , where? is a letter, n is a number"? P: Remove the Register?" and place it at the cursor position. Over here? Can be a letter, or it can be a numberNDD: Deletes the current line and its total n lines of text, and places the deleted content in the
1. General Form of the find command:Find pathname-options [-print-Exec-OK]Pathname find command to find the directory path
2. Use the name option:Find/etc-name "Host *"-print find the file name starting with host in the/etc directoryFind.-Name "[A-Z] *"-print find a file in the current directory with a file name starting with an uppercase letter
3. Use the perm option:Find.-Perm 755-print: Find Files in the current directory with 755 permission
4. Use
Common DB2 commands (2)Catalog Database:Catalog indirect: db2 catalog database on/db2sys [dir_name]Catalog remote: db2 catalog database as at node example: db2 catalog tcpip node NODESUN remote 192.168.1.1 server 50000 ostype aix db2 catalog db SUNDB as SUN at node NODESUNUncatalog database:Db2 uncatalog databaseThe best way to view the local database:Db2 list db directory on/db2sys [dir_name]Change the DB2
Lsof
lsof, which corresponds to "List open files" (list opened file)
Fuser
The fuser command lists the process number of the local process, which local processes use the local or remote files specified by the file parameter. For blocking special devices, this command lists the processes that use any file on the device.To view a process using a port number:sudo lsof-i:grep LISTEN # View the occupied process of Port 80 sudogrep : a different wayKill the process that consumes TCP acco
Echo Output command
echo [options] [Output CONTENT]
-E: Character conversions that support backslash control
Echo Write script
Do not assign execute permissions with bash Shellshname
Assigning execute permissions requires changing execution permissions chmod 755 shellshname execution: Path/shellshname
Alias: Alias ls= "ls--Color=auto" is alias aliases = formerly #临时生效
You can also view the aliases that are in effec
Shutdown commandShutdown?h now to shut down the machine.Shutdown?r Now it's time to start the computer again.-T sec:-T followed by seconds, i.e. "shutdown after a few seconds"-K: not to really shut down, just send a warning message-R: Start again after the service of the system is stopped-H: Shut down the system service immediately after shutting down-N: Shutdown without init program directly with shutdown-F: A disk check that forces a bypass of fsck after shutting down and starting-F: Force a d
Example one:The contents of the A.log file are as follows:
Extract rows from the A.log file that contain "WARNING" or "FATAL" and do not contain "Ignor"
Grep-e ' Warning| FATAL ' A.log | Grep-v ' Ignor 'result output:CCCCCCC FATAL DDDDBBBBAAA BBB DDD adfd:warning FFFF eeeeExample two:The contents of the A.log file are as follows:[email protected] home]# cat A.logAaaaaaaaaaaaABBBB WARNING oooo IgnorCCCCCCC FATAL DDDDBBBBDuuuuuuuuu Ignor PPPPPPPPAAA BBB DDD adfd:warning FFFF eeee
Ext
Date Linux time management, displaying and configuring system time. RTC Real time, motherboard crystal hardware time, Linux system boot is read hardware time as system time, after startup kernel use CPU to simulate hardware time as system time.Example: #date + "This was%Y%ntoday is%d"#date +%s Linux for e-commerce.clock Display hardware timehwclock #hwclock-W: Synchronizing system time to hardware time#hwclock-S: Synchronizing hardware time to System timeGet help with the use of commandsInternal
background pending process6.12.1 jobs-lShow background process, more than jobs show a PID6.13 FGBack up the backstage process to the front desk6.14 Killall Process NameKill a Process6.15 LnCreate a hard link that can only be created for files of the same partition6.15.1 ln-sCreate soft links that can be created for different partition files and directories6.16 MansMan 1 passwd#1 represents execution program or shell commandMan 2 sethostname#
source targetExample: Move 1.txt under Uzz to the Uzz/xk folder[Email protected] uzz]# mv 1.txt XK [[email protected] uzz]# ls xk 1.txt 2.txt wlgc [[email protected] uzz]#4. editing files using VIVI File nameThen press A or I into edit mode, edit the text, press ESC when finished editing, and press shift+: Enter WQ to save and exitFor example: Edit Uzz under 2.txt, Input: 1
...
Remote login users: pts/1, pts/2...
Chage [Option] [username] # managing passwords
-L view user password settings
-M: minimum number of days for password Modification
-Maximum number of days for M password Modification
-D Date of last password Modification
-I. the number of days the account is locked after the password expires
-E: Set the password expiration date. If it is 0, the password will expire immediately. If it is-1, the password will n
Shutdown and restart commands 1)shutdown-h now No special case, use this command- H turn off the machine- R Restart shutdown-r now command name:shutdownCommand path: /sbin/shutdownExecute Permissions: Root 2)rebootCommand name: rebootCommand path: /sbin/rebootExecute Permissions: RootEight mount Command all linux storage devices must be mounted for use, including hard drivesCommand name: MountCommand pa
temporary variable, and the others will be invalid.Bash produces child processes in child processes the parent process is declared to be useful with exportunset name cancels name the contents of this variable are valid only for the current bash or child bash. Invalid for newly launched bashenv | grep $PATH ViewAlias usage aliasesAliaswwff= ' ls-l/home ' temporarily in forceWWFF will be executed as an alias command.Wildcard characters (must be mastered)* Multiple letters or numbers? 1 letters or
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.