in

Linux commands

linux-commands
Useful Linux commands that help developers and networkers to master the Linux terminal. Finding the solution and correcting it.
unameDisplays Linux system information
uname -rDisplays kernel release information
uptimeDisplays how long the system has been running including, load average
hostnameShows the system hostname
hostname -iDisplays the IP address of the system
last rebootShows system reboot history
dateDisplays current system date and time
timedatectlQuery and change the System clock
calDisplays the current calendar month and day
wDisplays currently logged in users in the system
whoamiDisplays who you are logged in as
finger usernameDisplays information about the user

File permission

chmod octal filename => Change file permissions of the file to octal

Example

chmod 777 /data/test.cSet rwx permissions to owner, group and everyone (everyone else who has access to the server)
chmod 755 /data/test.cSet rwx to the owner and r_x to group and everyone
chmod 766 /data/test.c Sets rwx for owner, rw for group and everyone
chown owner user-fileChange ownership of the file
chown owner-user: owner-group Change owner and group owner of the file 
file_name
chown owner-user:owner-group-Change owner and group owner of the directory directory

Network

ip addr show
Displays IP addresses and all the network interfaces
ip address add 192.168.0.1/24 dev ethoAssigns IP address 192.168.0.1 to interface etho
ifconfigDisplays IP addresses of all network interfaces
ping hostping command sends an ICMP echo request to establish a connection to server / PC
whois domainRetrieves more information about a domain name
dig domainRetrieves DNS information about the domain
dig -x hostPerforms reverse lookup on a domain
host google.comPerforms an IP lookup for the domain name
hostname -iDisplays local IP address
wget file_nameDownloads a file from an online source
netstat -pnltuDisplays all active listening ports

Hardware

dmesgDisplays bootup messages
cat /proc/cpuinfoDisplays more information about CPU e.g model, model name, cores, vendor id
cat/proc/meminfoDisplays more information about hardware memory e.g Total and Free memory
IshwDisplays information about system’s hardware configuration
IsblkDisplays block devices related information
free -mDisplays free and used memory in the system (-m flag indicates memory in MB)
Ispci -tyDisplays PCI devices in a tree-like diagram
Isusb -tyDisplays USB devices in a tree-like diagram
dmidecodeDisplays hardware information from the BIOS
hdparm -i /dev/xdaDisplays information about disk data
hdparm -tT /dev/xdaConducts a read speed test on device xda
badblocks -s /dev/xdaTests for unreadable blocks on disk

Process related

psDisplay currently active processes
ps aux | grep ‘telnetSearches for the id of the process ‘telnet
pmapDisplays memory map of processes
topDisplays all running processes
kill pidTerminates process with a given pid
killall procKills / Terminates all processes named proc
pkill process-nameSends a signal to a process with its name
bgResumes suspended jobs in the background
fgnBrings job n to the foreground
fgBrings suspended jobs to the foreground
IsofLists files that are open by processes
renice 19 PIDMakes a process run with very low priority
pgrep firefoxFind Firefox process ID
pstreeVisualizing processes in tree model

This post was created with our nice and easy submission form. Create your post!

What do you think?

681 Points
Upvote Downvote

Posted by comebuddy

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings

mental-health

Mental health

addiction-problems

Addiction problems