Linux Stat Command Examples
This article covers how to use the Linux stat command. Basically, The stat command gives important information about filesystems. stat command is a useful utility for viewing file or file system status. It retrieves information such as file type; access rights in octal and human-readable; SELinux security context string; time of file birth, last access, last data modification, last status change in both human-readable and in seconds since Epoch, and much more. Also, It has an option to specify a custom format instead of the default, for displaying information.
Check CPU Temperature Using lm-Sensors and hddtemp
This article covers how you can monitor the temperature of your CPU cores, hard drive and other components attached to the motherboard.
When your PC is overheating, consider disassembling your PC and blowing it with a blower to get rid of all the dust which might be blocking the ventilation vents.
Also, ensure your laptop is placed on a hard surface and not on a cushy surface such as on a bed where the vents can easily get blocked.
Lastly, enable power saving mode and close any unnecessary applications.
Chmod Command in Ubuntu 20.04 - How it Works ?
This article covers both the symbolic and numeric mode of the chmod command. Control who can access files, search directories, and run scripts using the Linux's chmod command. This command helps modifies Linux file permissions.
In Linux, who can do what to a file or directory is controlled through sets of permissions. There are three sets of permissions. One set for the owner of the file, another set for the members of the file's group, and a final set for everyone else.
To change directory permissions in Linux, use the following:
- chmod +rwx filename to add permissions.
- chmod -rwx directoryname to remove permissions.
- chmod +x filename to allow executable permissions.
- chmod -wx filename to take out write and executable permissions.
We can use the -l (long format) option to have ls list the file permissions for files and directories.
$ ls -l
chmod Numerical Shorthand:
- 0: (000) No permission.
- 1: (001) Execute permission.
- 2: (010) Write permission.
- 3: (011) Write and execute permissions.
- 4: (100) Read permission.
- 5: (101) Read and execute permissions.
- 6: (110) Read and write permissions.
- 7: (111) Read, write, and execute permissions.
Install and Use Vim Editor in Linux - Best Method ?
This article covers how to install vim, followed by some basics on using vim and then uninstalling it. Vim (Vi IMproved) is a text editor that is upwards compatible to Vi. It can be used to edit all kinds of plain text. It is especially useful for editing config files and programs written in shell, python, perl, c/c++ and more.
Among the various text editors in the world of Linux, Vim (or Vi IMproved) stands out for its versatility and for the functions it offers. In fact, Vim is able to speed up code writing, providing some shortcuts to perform all the operations of modification, deletion or replacement of the text.
Vim Text Editor also allows you to install different plugins through which transforming this simple text editor into a real IDE for programming in different languages.
How to Install vim using apt on Linux ?
1. Open terminal application. You can also press CTRL+ALT+T keyboard shortcut.
2. Update package database by typing the sudo apt update command.
3. Search for vim packages run: sudo apt search vim.
4. Install vim on Ubuntu Linux, type: sudo apt install vim.
5. Verify vim installation by typing the vim --version command.
Modify User Password in Linux - Best method ?
This article covers how to change own and another user account passwords. It's recommended that to change your password frequently and use a unique password for each account for security purpose. Basically, you will learn how to change a password on any Linux distribution, including Ubuntu, Debian, and CentOs.
To change a password on behalf of a user, first sign on or "su" to the "root" account. Then type, ``passwd user'' (where user is the username for the password you are changing). The system will prompt you to enter a password. Passwords do not echo to the screen when you enter them.
You can also change your own password, by typing ``passwd'' (without specifying a username). You will be prompted to enter your old password for verification, and then a new password.
How to Change a Password in Linux?
To change the password in Linux you need to open the terminal and type the following command:
$ sudo passwd
After executing the command, you will be asked to enter the new password twice.
Remove Files and Directories Using Linux Command Line - The Right way ?
This article covers how to Remove Files and Directories Using Linux Command.
The procedure to remove all files from a directory:
- Open the terminal application.
- To delete everything in a directory run: rm /path/to/dir/* .
- To remove all sub-directories and files: rm -r /path/to/dir/* .