Today we will talk about daily use commands in Linux and we will surely try to cover all the commands that are used by daily users.
Some of the commands our users must have known already from “Basic commands for CentOS 9” post. Let’s start with our first Category in daily use commands.
1. File and Directory Management
- ls: ls stands for ‘List‘ and It helps in listing the directory contents in Linux. It is one of the most daily use commands.
Format and Example: ls command works with ‘ls‘.
- cd: cd stands for “Change Directory” and it is used for changing the current directory.
Format: cd (path name)
Example: cd /var/www/html
- pwd: pwd stands for “Print Working Directory” and it is used for knowing/printing the working directory of the user.
Format and Example: pwd command works with ‘pwd‘.
- cp: cp stands for ‘Copy‘ and it is used for copying the files and folder.
Format: cp (source file) (destination file)
Example: cp my.txt mycopy.txt
- mv: mv stands for ‘move‘ and it is used for moving the files and folder. It can be also used to rename the file.
Format: mv (source file) (destination file)
Example: mv my.txt my1.txt
2. File Viewing and Editing
- cat: cat stands for ‘Concatenate‘ that helps in displaying the content of the file that so many people use to consider in daily use commands.
Format: cat (filename)
Example: cat my1.txt
- vim: vim stands for “Visual Interface Improved” and it is used for creating or editing the text file. In vim to write in the file we have to press ‘I’. After that we have to press ‘Esc’ key to come out of writing mode and type ‘:wq’ to save and quit vim editor.
Format: vim (file name)
Example: vim doc
3. Process Management
- top: top command is the mostly used command under process management as it helps in checking all the running processes.
Format and Example: top command works with ‘top‘.
- kill: kill command helps to terminate the process with the help of their PID (Process ID).
Format: kill (PID)
Example: kill 110954
4. Disk and Memory Management
- df: df stands for “Disk Free” and it helps us to know disk space usage of a system. We always use this command with ‘-h‘ option to read it in human way.
Format: df -h
Example: df -h
- du: du stands for “Disk Usage” and it helps in know how much space is used by files and directories. We always use this command with ‘-sh‘ option to read it in human way.
Format: du -sh (path name)
Example: du -sh /var/log, du-sh
- free: free command helps in knowing the usage of our RAM. We generally use the free command with ‘-m‘ option.
Format and Example: It works with “free -m“.
5. Networking
- ifconfig: It helps us to know the network cards and IP address of our system.
Format and Example: It works with “ifconfig“.
- ping: ping command helps in knowing our network connectivity. We have to press ctrl+c to come out of the ping command. It is surely comes under daily use commands.
Format: ping (network address)
Example: ping 8.8.8.8
- ssh: ssh stands for “secure shell” and it is used to access the server remotely. We have to enter the password of the remote user when asked.
Format: ssh (username@ip address)
Example: ssh root@82.112.226.32
6. User and Group Management
- who: who command helps to know who all are logged in at the same time.
Format and Example: It works with “who“.
- w: w command helps to know who all are logged in and what they are doing at the same time.
Format and Example: It works with “w“.
7. Package Management
- dnf: dnf helps in package management in Fedora based systems like CentOS, RedHat etc. We can update, remove, install packages with dnf command.
Format: dnf update
dnf install (package name)
dnf remove (package name)
Example: dnf install httpd, dnf remove php etc.
- apt-get: apt-get helps in package management in Debian based systems like Ubuntu. We can update, remove, install packages with apt-get command.
Format: apt-get update
apt-get install (package name)
apt-get remove (package name)
Example: apt-get install apache2, apt-get update etc.
8. System Services
- systemctl: systemctl command helps in control the system. It is used for managing the services, We can start, stop, restart, enable, disable and check the status of any service installed in our system.
Format: systemctl start (service name)
systemctl stop (service name)
systemctl restart (service name)
systemctl status (service name)
Example: systemctl start httpd, systemctl stop httpd etc.
That’s all for daily use commands in Linux. If you want to practice the commands then you can purchase the VPS in lowest price from here.
FAQ on Daily Use Commands in Linux
Q. How do I see the current directory?
A pwd
Q. How do I list files in a folder?
A. ls
Q. How do I navigate between directories?
A. cd (Directory Name)
Q. How do I create a new folder or file?
A. mkdir newfolder
touch newfile.txt
Discover more from Root Learning
Subscribe to get the latest posts sent to your email.