Top 10 Linux Commands for File and Folder Management

CommandsAnil K3 min read
#linux#bash#file-management#cli#sysadmin#beginners#commands
Linux terminal showing ls -lah output in a monospaced font
On this page

Linux file management commands are essential for anyone working with the Linux operating system. These Linux command-line tools help you navigate, organise, and maintain your filesystem efficiently. Whether you're a beginner or a Linux system administrator, mastering these commands will make your workflow faster and more reliable.

1. ls — List Directory Contents#

Purpose: View files/folders inside a directory using the Linux CLI basics.

Common options:

  • -l: Long listing format (permissions, owner, size, datetime)
  • -a: Show hidden files (starting with dot)
  • -h: Human-readable sizes (e.g., KB, MB)
  • -R: Recursively list subdirectories

Example:

bash
ls -lah /var/log

Expected output sample:

text
drwxr-xr-x  5 root root 4.0K Nov 12 10:00 .
drwxr-xr-x 14 root root 4.0K Nov  1 15:22 ..
-rw-r--r--  1 root root 1.2M Nov 12 09:58 syslog
-rw-r--r--  1 root root    0 Nov 12 09:59 wtmp

2. cd — Change Directory#

Purpose: Navigate between directories in the Linux shell.

Common usage:

  • cd /path/to/directory: Change to a specific directory.
  • cd ..: Move up one level.
  • cd ~ or simply cd: Go to the home directory.
  • cd -: Go to the previous directory.

Example:

bash
cd /usr/local/bin

3. mkdir — Create Directory#

Purpose: Create one or multiple directories using Linux terminal tips.

Common options:

  • -p: Make parent directories as needed.

Example:

bash
mkdir -p projects/week1

4. rmdir — Remove Empty Directory#

Purpose: Delete empty directories only.

Common options:

  • -p: Remove parent directories if they become empty.

Example:

bash
rmdir old_folder

Note: for directories with contents, use rm -r.

5. rm — Remove Files and Directories#

Purpose: Delete files or directories in Linux command examples.

Common options:

  • -r: Recursive delete for directories.
  • -f: Force delete, no prompt.
  • -i: Interactive prompt before deletion.

Example:

bash
rm -rf temp_folder
rm file.txt

6. cp — Copy Files and Directories#

Purpose: Duplicate files or directories in Linux tutorials.

Common options:

  • -r or -R: Recursively copy directories.
  • -i: Prompt before overwrite.
  • -v: Verbose output during copying.

Example:

bash
cp -rv source_dir backup_dir
cp file1.txt file2.txt /home/user/documents/

7. mv — Move or Rename Files and Directories#

Purpose: Move files/directories or rename them using Linux shell commands.

Common options:

  • -i: Interactively prompt before overwriting.
  • -v: Verbose output.

Example:

bash
mv oldname.txt newname.txt
mv file.txt /tmp/

8. touch — Create or Update Files#

Purpose: Create empty files or update timestamps.

Common options:

  • -c: Do not create file, only update timestamp if it exists.
  • -a: Change only access time.
  • -m: Change only modification time.

Example:

bash
touch newfile.txt
touch -c existingfile.txt

9. stat — Display File or Directory Status#

Purpose: Detailed information about a file/directory (size, permissions, times).

Example:

bash
stat filename.txt

Expected output sample:

text
File: filename.txt
Size: 1024       Blocks: 8          IO Block: 4096   regular file
Device: 802h/2050d Inode: 524292      Links: 1
Access: 2025-11-13 09:00:00.000000000 +0530
Modify: 2025-11-13 08:58:00.000000000 +0530
Change: 2025-11-13 08:59:30.000000000 +0530

10. find — Search for Files and Directories#

Purpose: Locate files/directories matching criteria using Linux command-line tools.

Common options:

  • -name [pattern]: Search by filename.
  • -type [f/d]: Files or directories.
  • -mtime [+-n]: Modified time in days.
  • -exec: Execute command on results.

Example:

bash
find /home/user -type f -name "*.log" -mtime -7

For the authoritative reference on any of these, the GNU coreutils manual and man pages (e.g., man find) are the right next stop. Once these ten are in your muscle memory, the rest of the shell opens up quickly.

Found this useful? Give it a like.

Where this fits

This article, its topic, and the closest related reading. See the full map →

Stay in the loop

New articles on AI, Cybersecurity, and PKI — delivered to your inbox.

No spam. Unsubscribe any time. By subscribing you agree to our Privacy Policy.