- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinuxCommands.py
More file actions
Latest commit
27 lines (18 loc) · 529 Bytes
/
Copy pathlinuxCommands.py
File metadata and controls
27 lines (18 loc) · 529 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env python
importos
#Capture the disk free space
os.system("df -h > diskSpace.txt")
#display the free memory usage
os.system("free > memoryUsage.txt")
#all TCP sockets
os.system("ss -t -a > allTCPSock.txt")
#all UDP Sockets
os.system("ss -u -a > allUDPSock.txt")
#display all sockets
os.system("ss -a > allSockets.txt")
#display all processes
os.system("ps -aux > processes.txt")
#Display all available commands
os.system("compgen -c > allCMDs.txt")
#List linux namespaces
os.system("lsns">namespaces.txt)