In the previous article we have discussed basic commands that almost every Linux user need in the regular work. These commands are common for all Linux distribution.
In this article, we will discuss about more commands that are not essentially required but it is good practice to use it. These commands may be hard for new Linux user but it is essential for daily Linux user. Here are the few commands that are helpful for regular day to day work for Linux users.
chmod command change the file or folder permission to read, write and execute. These permissiona are for owner user, group of users and for others.
There are two ways you can assign or check permissions for file or folder. In a numeric way you can assign permission:
These permission number in 3 numeric digit. Suppose a file has permission of 755, then below are this permisssion.
To change the file or permission, run the commands:
chmod 777 /path/to/dir
To recursively set read, write, and execute permissions, use
chmod -R 755 /path/to/file
You can easily check disk space with
df command. For human readable format, use
free command will return total physical memory and swap space. You can better manage about swap space.
-h option will allow to view in human readable format.
grep command is used to search for string or search for pattern in the file.
grep 'string' file.txt
To search with case insensitive, use
grep -i 'String' file.txt
You can also search from multiple files.
grep -i 'String' file.txt file2.txt file3.txt
Also search pattern can be used.
grep '^string' file.txt
cat command let you to view file content.
Sometimes you want to close the program, which you can not close from GUI. You can stop program by process id.
To forcefully close the program, use
kill -9 pid
To view the process id of program, run
To close all subprocess of the program. you can simply use
shutdown command used to halt and shutdown the computer. You can simply set time to shutdown computer.
or after minutes.
To stop shutdown use
Reboot the machine with
uname comman will print the system option.
print all information with
Or with specific information with below options.
print the kernel name
print the network node hostname
print the kernel release
print the kernel version
print the machine hardware name
print the processor type (non-portable)
print the operating system
w command displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes.
whoami command print the current logged user name.
Copyright 2024 ErrorGram