Skip to content

Latest commit

 

History

History
232 lines (193 loc) · 4.59 KB

server.MD

File metadata and controls

232 lines (193 loc) · 4.59 KB

Linux Server Command Pallette🌸:

command description
reference
uname -a Show system information via uname command
$ uname -r (system information)
$ uname -s (kernel release)
$ uname -m (architecture)
$ uname -o (operating system)
uptime Display how long the system has been running, including load average
$ uptime
hostname See system hostname
$ hostname
$ hostname -i (Show the IP address of the system)
last reboot List system reboot history
$ last reboot
scp Copy a file to a server directory securely
$ scp [file_name.txt] [server/tmp]
ulimit View or limit system resource amounts
$ ulimit [flags] [limit]
last Show last system logins:
$ last
who Display who is currently logged into the system
$ who
w Show which users are logged in and their activity
$ w
pstree Process in a tree like diagram
$ pstree
pmap Display a memory usage map of processes
$ pmap
pidof Gives the Process ID (PID) of a process
$ pidof
nice Starts a process with a given priority
$ nice
renice Changes priority of an already running process
$ renice
sudo passwd -l 'username' To change the password of a user
$ sudo passwd -l 'username'
sudo userdel -r 'username' To remove a newly created user
$ sudo userdel -r 'username'
sudo usermod -a -G GROUPNAME USERNAME To add a user to a group
$ sudo usermod -a -G GROUPNAME USERNAME
dmesg Display messages in kernel ring buffer
$ dmesg
cat /proc/cpuinfo Display CPU information
$ cat /proc/cpuinfo
cat /proc/meminfo Display memory information
$ cat /proc/meminfo
mpstat 1 / vmstat 1 / iostat 1 Display processor, virtual memory and I/O related statistics
-
tcpdump -i eth0 Capture and display all packets on interface eth0
$ tcpdump -i eth0
tcpdump -i eth0 'port 80' Monitor all traffic on port 80 ( HTTP )
$ tcpdump -i eth0 'port 80'
lsof List all open files on the system
$ lsof -u user (List files opened by user)
last Display the last users who have logged onto the system.
$ last
netstat -pnltu See active (listening) ports with the netstat command
$ netstat -pnltu
netstat -nutlp Show tcp and udp ports and their programs
$ netstat -nutlp
dig [domain] Show DNS information about a domain using the dig command
$ dig [domain]
dig -x [ip_address] Do reverse lookup of an IP address
$ dig -x [ip_address]
lastlog The lastlog command is used to find the details of a recent login of all users or of a given user.
$ lastlog
rsync Synchronize /home to /backups/home
$ rsync -a /home /backups/
visudo Edit the sudoers configuration file.
$ visudo
sudo -i Switch to the root account with root's environment. (Login shell.)
$ sudo -i
sudo -s Execute your current shell as root. (Non-login shell.)
$ sudo -s
sudo -l List sudo privileges for the current user.
$ sudo -l
sar check server memory and swap usage.
$ sar