Linux CLI Commands

back  
 next

Linux CLI Commands

Various Linux CLI (Command Line Interface) Commands with examples and grouped by type

File System

Find specific file types

  • Using ls:
    • ls -lhaF | grep ^l # list links
    • ls -lhaF | grep ^d # list directories
    • ls -lhaF | grep ^- # list files
  • using find:
    • find . -type l -ls
    • find . -maxdepth 1 -type l -ls to process the current directory only, i.e. not recurse.

References:

check file system size

du

Estimate file space usage

  • du -hd1 /file_path lists and summaries directories sizes under /file_path 1 directory deep, where:
    • -d set the reporting depth flag
    • -h set human readable format
  • du -s /tmp /var lists the summary of directories /var and /tmp only, where:
    • -s set summaries
  • sudo du -hd1 --exclude={/mnt,/run,/proc} / to check root (/).
    • It is important to exclude the noted directories as they are temporary or external drives. Note I mount my external drives within /mnt. This speed up performance and remove errors and associated messages, decluttering the output.

ncdu

ncdu is a 'smart' version of du. It needs to be specifically installed, e.g. sudo apt install ncdu.

  • ncdu on the current directory
  • ncdu --exclude-kernfs --exclude /mnt / to check root (/) directory excluding system and mounts

df

df - report file system space usage

  • df -h prints file system and spage usage in human readable format

duf

duf - disk usage / Free utility, an updated version of df utility. It needs to be specifically installed, e.g. sudo apt install duf.

  • duf

Devices

lshw

Command to list hardware configuration parameters.

  • sudo lshw -short list hardware in short form.
  • sudo lshw -c cpu lists the cpu hardware, the following device types can be listed
    • system
    • bridge
    • memory
    • processor
    • address
    • storage
    • disk
    • tape
    • bus
    • network
    • display
    • input
    • printer
    • multimedia
    • communication
    • power
    • volume
    • generic

man

  • apropos
  • man 5 crontab or man 'crontab(5)' will specifically list the man for contab(5)

crontab

sudo crontab -e can be used to safely

Networking Specific

back  
 next
/app/www/public/data/pages/tech_notes/linux_commands.txt · Last modified: 2026-03-22 Sun wk12 09:59
CC Attribution-Share Alike 4.0 International Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International