Linux_ Common Commands _ (ls, lsof,nslookup) _ View files sorted by time

Source: Internet
Author: User
Tags ftp connection tmp folder nslookup

Usually collect some commands for easy use.

1:LS-LRT Sort by Time show

2:nslookup View DNS resolution

3:lsof-p Process Number

Lsof ' which httpd '//That process is using Apache executable file
LSOF/ETC/PASSWD//The process is taking up/etc/passwd
LSOF/DEV/HDA6//The process is taking up Hda6
Lsof/dev/cdrom//The process is occupying the optical drive
Lsof-c sendmail//view file usage for SendMail process
Lsof-c courier-u ^zahn//shows that those files are opened with a process that starts with courier, but does not belong to the user Zahn
Lsof-p 30297//show those files are turned on by PID 30297 process
LSOF-D/TMP Displays all the processes that are open in the/tmp folder for instance and files. But the symbol file is not listed

lsof-u1000//View UID is 100 user's process file usage
Lsof-utony//View user Tony's process file usage
Lsof-u^tony//view file Usage for processes that are not user Tony (^
Lsof-i//Show all open ports
lsof-i:80//Show all open port 80 processes
Lsof-i-u//Show all open ports and UNIX domain files
lsof-i [email& Nbsp;protected][url]www.akadia.com:123//shows those processes that have opened a link to www.akadia.com UDP 123 (NTP) port
Lsof-i [email  Protected]:ftp-r//Constantly check the current FTP connection situation (-r,lsof will continue to execute forever until the interrupt signal is received, +R,LSOF will continue to execute until no file is displayed, default is 15s refresh)
Lsof-i [email  protected]:ftp-n//lsof-n does not convert IP to hostname, the default is not to add the-n parameter

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.