lsof
:The
lsof
command (List Open Files) is used to list information about files opened by processes.Options:
-u user
: Lists files opened by a specific user.-i 4
: Displays IPv4 network files.-u root
: Lists files opened by the root user.-p 1
: Displays files opened by process ID 1 (init process).
top
:The
top
command provides a dynamic, real-time view of system processes, their resource usage, and other system information.
kill -9 pid
/kill -9 lsof -t -u cloudzone
:kill -9 pid
: Forcefully terminates a process by sending theSIGKILL
signal to the specified Process ID (pid
).kill -9 lsof -t -u goku;
: Useslsof
to find processes owned by the usergokul
and forcefully terminates them.
find
:The
find
command is used to search for files and directories based on various criteria, such as name, size, or permissions.Below command will list all the directories having '.txt' extension
locate
- needs updatedb:The
locate
command quickly finds the location of files by searching a pre-built database. However, it requires periodic updates using theupdatedb
command.
wc -l
,wc -w
,wc -c
orwc -m
:The
wc
command is used to count lines, words, and bytes in a file.-l
: Counts the number of lines.-w
: Counts the number of words.-c
or-m
: Counts the number of bytes.