file management

All posts tagged file management by Linux Bash
  • Posted on
    Featured Image
    In the Unix-like command-line interface, mastering file management is crucial, and mv is one of the indispensable tools any user, novice or advanced, should be familiar with. The mv command, which stands for "move", is used for moving files from one location to another and renaming files and directories. This versatility makes mv a powerful tool that streamlines tasks and enhances productivity. Let's dive deep into how to use mv effectively for moving and renaming files. Understanding the syntax is the first step to using mv command effectively: mv [options] source destination source: The file or directory you want to move or rename. destination: Where you want the file or directory to go, or what you want to rename it.
  • Posted on
    Featured Image
    When working with Linux, mastering the commands for file management isn't just useful, it's essential. Today, we'll delve into one of the most commonly used Linux commands: cp. This command is used to copy files or directories from one place to another, a fundamental task for anyone navigating the operating system. Let's break down how cp works, explore its options, and understand its syntax. The cp command requires at least two arguments. The first argument is the source, or what you want to copy. The second argument is the destination, where you want the copy to be placed.
  • Posted on
    Featured Image
    When it happens that your VPS is eating data by the second and there is disk read/write issues one port of call you are bound to visit is searching and identifying large files on your system. Now, you would have been forgiven for thinking this is a complicated procedure considering some Linux Bash solutions for fairly simple things, but no. Linux Bash wins again! du -sh /path/to/folder/* | sort -rh Here, du is getting the sizes and sort is organising them, -h is telling du to display human-readable format. The output should be something like this: 2.3T /path/to/directory 1.8T /path/to/other It does take a while to organise as it is being done recursively however given 3-5mins and most scenarios will be fine.