The rm command removes files and directories. You must use the -R option to recursively remove files, subdirectories, and the parent directory itself. Syntax The syntax of the rm command is: # rm [options] {file/directory names} For example, to remove the ~/myfiles directory and its contents: # rm -R ~/myfiles rm Command Examples 1. To […]
Archives for September 2021
find Command Examples in Linux
The find command enables you to search a specific location for files and directories that adhere to some search criteria. It recursively searches the directory structure, including any subdirectories and their contents, beginning with the search location you enter. You can perform one or more actions on the files found. The -type option enables you […]
locate Command Examples in Linux
There will be times that you create a file and forget wherein the directory structure you put it. There will also be times when you don’t know the exact location of files created by the system, applications, or other users. In Linux, you have several powerful tools for finding the files you’re looking for. The […]
Basic nano Commands (Cheat Sheet)
GNU nano is a small, user-friendly text editor that evolved from the Pico text editor created for Unix-like systems. It was added to the GNU Project shortly after its initial release. While Vim is a powerful text editor, it is not the most user-friendly, as evidenced by its multiple modes, bare interface, and many keystroke […]
Basic vim commands (cheat sheet)
The vim command invokes the Vim editor. However, the vi command may also be used for this purpose because it automatically redirects the user to Vim. When entered without a file name as an argument, the vim command opens a welcome screen by default. Use the syntax vim {file name} to open a file. If […]
iostat Command Examples in Linux
The iostat utility generates reports on CPU and device usage. For storage, it provides input and output statistics for block devices and partitions. Using the -d option to specify device information only, the iostat command lists the following statistics for each storage device: Transfers (I/O requests) per second (tps). Number of blocks read per second […]
dumpe2fs Command Examples in Linux
The dumpe2fs command is used to dump ext2, ext3, and ext4 file system information. It prints the superblock and block group information for the selected device. This can be useful when troubleshooting a faulty file system. Syntax The syntax of the dumpe2fs command is: # dumpe2fs [options] {device/ file system name} dumpe2fs Command Options The […]
resize2fs Command Examples in Linux
The resize2fs command is used to enlarge or shrink an ext2/3/4 file system on a device. You can enlarge a mounted file system, but you must unmount the file system before you can shrink it. You can specify the desired size of the file system in order to either enlarge or shrink it. If you […]
fsck Command Examples in Linux
The fsck command is used to check the integrity of a file system. File system integrity refers to the correctness and validity of a file system. Most systems automatically run the fsck command at boot time so that errors, if any, are detected and corrected before the system is used. File system errors are usually […]
Understanding the /proc/mounts, /etc/mtab and /proc/partitions files
Linux provides you with many tools for modifying file systems after applying them to storage devices. In this post, we will learn about many OS configurations file which holds the mount point information. The /proc/mounts file The /proc/mounts file lists the status of all currently mounted file systems in a format similar to fstab: the […]