Page 155 - DCAP602_NETWORK_OPERATING_SYSTEMS_I
P. 155
Unit 8: Shell
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf : Now you can edit /etc/httpd.conf rather than notes
the original. changes will affect the orginal, however you can delete the link and it will not delete
the original.
last : shows who logged in and when
last -20 : shows only the last 20 logins
last -20 -a : shows last 20 logins, with the hostname in the last field
w : shows who is currently logged in and where they are logged in from.
who : This also shows who is on the server in an shell.
netstat : shows all current network connections.
netstat -an : shows all connections to the server, the source and destination ips and ports.
netstat -rn : shows routing table for all ips bound to the server.
top : shows live system processes in a nice table, memory information, uptime and other useful
info. top then type Shift + M to sort by memory usage or Shift + P to sort by CPU usage
ps: ps is short for process status, which is similar to the top command. t’s used to show currently
running processes and their PID.
A process ID is a unique number that identifies a process, with that you can kill or terminate a
running program on your server (see kill command).
ps U username : shows processes for a certain user
ps aux : shows all system processes
ps aux --forest : shows all system processes like the above but organizes in a hierarchy that’s very
useful!
touch : create an empty file
touch /home/burst/public_html/404.html : create an empty file called 404.html in the directory /
home/burst/public_html/
file : attempts to guess what type of file a file is by looking at it’s content.
file * : prints out a list of all files/directories in a directory
du : shows disk usage.
du -sh : shows a summary, in human-readble form, of total disk space used in the current directory,
including subdirectories.
du -sh * : same thing, but for each file and directory. helpful when finding large files taking up
space.
LoveLy professionaL university 149