Want to know what files are open ?
lsof
Want to know what files are opened by a specific process ?
lsof -p <pid>
- as an example, I've identified that WebSphere Portal is running as process ID ( pid ) 7725 so I use lsof -p 7725 to see all the files opened by that process
Want to know how large a file is ?
ls -lh
Want to see a file listing in order of modification ?
ls -ltrc
- shows the most recently modified at the bottom of the list
Want to search a binary file ?
grep --text <pattern> <filename>
or
grep -a <pattern> <filename>
- this gets around the error Binary file /opt/IBM/WebSphere/AppServer/java/bin//java matches
- I needed this to search a couple of logs files that contained some binary characters
Want to see files by type e.g. executable ?
ls -lF <filename>
- for example, this adds an asterisk to the listing to mark executable files
Want to list files without typing ls -alF ?
ll <filename>
- this is a useful little alias, as defined in ~/.bashrc
Want to know more about a process ?
Using the above example of WebSphere Portal running as process ID (pid) 7725, there are a bunch of files under the directory /proc/7725/ including: -
cat /proc/7725/status - shows memory utilisation etc.
cat /proc/7725/limits - shows various ulimits including open files etc.
- the first one was useful in confirming that my addition of ulimits -f 40000 to /opt/IBM/WebSphere/wp_profile/bin/setupCmdLine.sh had "taken" - this helped me overcome a "Too many open files" exception
Geeking in technology since 1985, with IBM Development, focused upon Docker and Kubernetes on the IBM Z LinuxONE platform In the words of Dr Cathy Ryan, "If you don't write it down, it never happened". To paraphrase one of my clients, "Every day is a school day". I do, I learn, I share. The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions. Remember, YMMV https://infosec.exchange/@davehay
Subscribe to:
Post Comments (Atom)
Reminder - installing podman and skopeo on Ubuntu 22.04
This follows on from: - Lest I forget - how to install pip on Ubuntu I had reason to install podman and skopeo on an Ubuntu box: - lsb_rel...
-
Why oh why do I forget this ? Running this command : - ldapsearch -h ad2012.uk.ibm.com -p 389 -D CN=bpmbind,CN=Users,DC=uk,DC=ibm,DC=com -w...
-
Error "ldap_sasl_interactive_bind_s: Unknown authentication method (-6)" on a LDAPSearch command ...Whilst building my mega Connections / Domino / Portal / Quickr / Sametime / WCM environment recently, I was using the LDAPSearch command tha...
-
Whilst building a new "vanilla" Kubernetes 1.25.4 cluster, I'd started the kubelet service via: - systemctl start kubelet.se...
No comments:
Post a Comment