Basic Linux Commands For Daily Usage

December 13, 2020
()

A Handy Guide for Basic Linux Commands


Linux, an open-source Operating System is one of the most popular operating systems which takes inputs in the form of commands to direct a computer program to perform a specific task. To use this Operating System we need to get familiar with the commands to navigate between directories, manipulate files, change permissions, display disk information, and many more other tasks.

In the article, we will walk you through some of the most common Linux Commands that will make your life easier no matter whether you are new to the Linux interface or an experienced user.


Find the most common Linux Commands in this table :


FILES & NAVIGATING

lsdirectory listing
ls -lformatted listing
ls -laformatting listing including hidden files
touch file_namecreates a new file
pwdshow current working directory
mkdir dircreate a directory(dir -> directory name)
mkdir -pIt will create the parent directory first if it doesn’t exist. But if it already exists, then it will not print an error message and will move further to create sub-directories.
rm filedelete file
rm -rf dirremove directory(dir -> directory name)
cp file1 file2copy file1 to file2
cat fileshow the output for the contents of a file
mv file1 /home/oracle/file2used to move and rename files
grepused to search a given pattern in a file

PROCESSES

psdisplays currently active process
topdisplays all running processes
kill pidTerminates processes with a given pid
kill all prockill/terminates all processes named proc
bgResumes suspended jobs in the background
fgBrings suspended jobs to the foreground

SYSTEM INFO

datedisplays current date and time of the system
uptimedisplays how long the system is running including load average
uname -adisplays Linux kernel system information
hostnameshows the system hostname
last rebootshows system reboot history
caldisplays current calendar month and day
whoamidisplays who you are logged in as
historyused to review commands entered before
manmanual for Linux commands
locateused to locate a file
findsearches for files within a given directory

PERMISSIONS

chmod octal filenamechange file permissions to octal
chmod 777set read/write/execute permission to owner,group, and everyone having access to the server
chmod 755set read/write/execute permission to owner and r_x to group and everyone
chmod -R 777The -R argument also means that it is recursive so the permission change applies to every file in that directory.
chown -rchange ownership of a file recursively
chown owner-user:owner-group filenamechange owner and group owner of the file

DIRECTORY TRAVERSE

cdchange directory to $HOME directory
cd ..Move up one level in the directory tree structure
cd /testchange directory to /test

DISK USAGE

df -kh displays free space on mounted system in KB
du -sh displays disk usage in the current directory in a human-readable format
df -idisplays free inodes on file systems

 

This document is just for learning purpose and always validate in the LAB environment first before applying in the LIVE environment.


Hope so you like this article
!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the most recent update. Click here to know more about our pursuit.

Related Articles


Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Hello and welcome to DBsGuru, I am Sruti Banerjee, having experience of 3 years as an Oracle DBA, I have good interpersonal skills that can help in attaining the desired level of team coordination, self-starter & quick learner. I am having rich experience in Oracle database management, Backup and Recovery, Security, Installation, Up-gradation, Patching, Migration, Cloning of databases, Dataguard (Physical), and a wide range of other database administration activities.Thanks for the visits!Share Learn Grow!

4 Comments

Leave a Reply

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