Skip to main content

Most Frequently Used Linux Commands


In this article we give you the most as often as possible used Linux Commands. Coming from the solace of a PC or Mac work area, the Linux Command Line looks not at all like what you regularly utilize.
For somebody to work in the Terminal they have to acquaint themselves with Linux commands. The Linux Command line is very helpful, fundamental to utilizing your Linux or VM and if done right, it furnishes you with more understanding and handy use than the Windows or Mac work area ever could.

System Linux Commands

CommandUses
unameDisplays linux system information
cat /etc/redhat_releaseDisplays which version of redhat installed
uptimeDisplay how long the system has been running
hostnameDisplay system host name
last rebootDisplay system reboot history
dateDisplay the current date and time
calDisplay the calendar of the current month
wDisplays who is logged on
whoamiDisplays current user id
finger userDisplays information about user
rebootReboots the system
shutdownShuts down the system

Hardware Linux Commands

CommandUses
dmesgDisplays all the messages from Kernel ring buffer
cat /proc/cpuinfoDisplays information about processes and CPUs of the system
cat /proc/meminfoDisplays details on hardware memory
cat /proc/interruptsLists the number of interrupts per CPU per I/O device
lshwDisplays information on hardware configuration of the system
lsblkDisplays block device related information of the machine
free -mDisplay used and free memory
dmidecodeDisplays hardware info from the BIOS
hdparm -i /dev/sdaDisplays info about disk sda
hdparm -tT /dev/sdaPerforms a read speed test on disk sda
badblocks -s /dev/sdaTests for unreadable blocks on disk sda
lspci -tvDisplay information on PCI buses devices

File Linux Commands

CommandUses
ls -alDisplays all information about files/directories.
pwdShows current directory path
mkdir directory-nameCreates a directory
cp file1 file2Copies linux files, here file1 to file2
cp -r dir1 dir2Copies dir1 to dir2, creates dir2 if it doesn’t exist
mv file1 file2Moves files from one place to another/renames file1 to file2
rm file-nameDeletes file
rm -r directory-nameDeletes directory recursively
rm -f file-nameForcefully removes file
rm -rf directory-nameForcefully removes directory recursively
ln -s /path/to/file-name link-nameCreates a symbolic link to file-name
tail -f fileOutputs the contents of file as it grows starting with the last 10 lines
gpg -c fileEncrypts file
gpg file.gpgDecrypts file
cksum fileView the checksum of the file
diff file1 file2View the differences between contents of file1 and file2
ln -s link fileCreate a soft link named link to the file
sortSorts files in alphabetical order
touch fileCreates empty file
cat filePrints the file content in terminal
more fileDisplay the contents of file
head fileDisplay the first 10 lines of file
tail fileOutputs the last 10 lines of file
uniqCompares adjacent lines in a file and removes/reports any duplicate lines
wcCounts number of words/lines
dirLists the content of the directory
teeCommand for chaining and redirection
trCommand for translating characters

File Permission & Network Linux Commands

CommandUses
chmod octal file-nameChanges the permissions of file to octal
chmod 777 /data/test.cSets rwx permission for owner , group and others
chmod 755 /data/test.cSets rwx permission for owner and rx for group and others
chown owner-user fileChanges owner of the file
chown owner-user:owner-group file-nameChanges owner and group owner of the file
chown owner-user:owner-group directoryChanges owner and group owner of the directory
chgrp group1 fileChanges the group ownership of the file to group1
ifconfig -aDisplays all network interface and set ip address
ifconfig eth0Displays eth0 ethernet port ip address and details
ip addr showDisplay all network interfaces and ip addresses
ip address add 192.168.0.1 dev eth078. ip address add 192.168.0.1 dev eth0 : Sets ip address of eth0 device
ethtool eth0Linux tool to show ethernet status
mii-tool eth0Linux tool to show eth0 status
ping hostSends echo requests to the host to test ipv4 connection
whois domainGets who is information for domain
dig domainGets DNS nameserver information for domain
dig -x hosReverse lookup host
host google.comLookup DNS ip address for the name
hostname -iLookup local ip address
wget fileDownloads file
netstat -tuplLists all active listening ports
nslookupResolves domain names to IP addresses

Package Installation & Search Linux Commands

CommandUses
rpm -i pkgname.rpmInstalls rpm based package
rpm -e pkgnameRemoves package
makeInstall from source file
grep pattern filesSearches for pattern in files
grep -r pattern dirSearches recursively for pattern in dir
locate fileFinds all instances of file
find /home/tom -name ‘index*’Finds file names that start with “index” inside /home/tom directory
find /home -size +10000kFinds files larger than 10000k in /home

Login, File Transfer & Disk Usage Commands

CommandUses
ssh user@hostSecurely connect to a host as user
ssh -p port $ user@hostConnects to host using specific port
telnet hostConnects to the system using telnet port
scp file.txt server2:/tmpSecure copy file.txt to remote host /tmp folder
scp user@server2:/www/*.html /www/tmpCopies *.html files from remote host to current host /www/tmp folder
scp -r user@server2:/www /www/tmpCopies all files and folders recursively from remote server to the current system /www/tmp folder
rsync -a /home/apps /backup/Synchronizes source to destination
rsync -avz /home/apps $ linoxide@192.X.X.X:/backupSynchronize files/directories between the local and remote system with compression enabled
df -hDisplays free space on mounted filesystems
df -iDisplays free inodes on mounted filesystems
fdisk -lDisplays disks partitions sizes and types
du -ahDisplays disk usage in human readable form
du -shDisplays total disk usage on the current directory
findmntDisplays target mount point for all filesystems
mount device-path mount-pointMounts a device to the device-path

Reference : Internet

Comments

Popular posts from this blog

What is Internet of Things ?

What is the Internet of Things? In a nutshell, the Internet of Things is the concept of connecting any device (so long as it has an on/off switch) to the Internet and to other connected devices. The IoT is a giant network of connected things and people – all of which collect and share data about the way they are used and about the environment around them. That includes an extraordinary number of objects of all shapes and sizes – from smart microwaves, which automatically cook your food for the right length of time, to self-driving cars, whose complex sensors detect objects in their path, to wearable fitness devices that measure your heart rate and the number of steps you’ve taken that day, then use that information to suggest exercise plans tailored to you. There are even connected footballs that can track how far and fast they are thrown and record those statistics via an app for future training purposes. How does it work? Devices and objects ...

NMAP - Network Mapper

Introduction : Nmap ("Network Mapper") is a free and open source ( license ) utility for network discovery and security auditing. Many systems and network administrators also find it useful for tasks such as network inventory, managing service upgrade schedules, and monitoring host or service uptime. Nmap uses raw IP packets in novel ways to determine what hosts are available on the network, what services (application name and version) those hosts are offering, what operating systems (and OS versions) they are running, what type of packet filters/firewalls are in use, and dozens of other characteristics. It was designed to rapidly scan large networks, but works fine against single hosts. Nmap runs on all major computer operating systems, and official binary packages are available for Linux, Windows, and Mac OS X.

Do’s and Don’ts of ATM transactions

Do’s and Don’ts of ATM transactions Do’s Conduct your ATM transactions in complete privacy, never let anyone see you entering your Personal Identification Number (ATM Password) After completion of transaction ensure that welcome screen is displayed on ATM screen Ensure your current mobile number is registered with the bank so that you can get alerts for all your transactions Beware of suspicious movements of people around the ATM or strangers trying to engage you in conversation Look for extra devices attached to the ATMs that looks suspicious Inform the bank if the ATM/Debit card is lost or stolen, immediately, report if any unauthorised transaction Check the transaction alert SMSs and bank statements regularly If cash is not dispensed the ATM does not display “cash out” please report to the Bank on the number mentioned in the Notice Board Immediately check your phone for SMS for debit amount Don’ts Do not write your PIN on the card, memorise your PIN number D...