Unix Utilities Programs Commands: Which, Man, Find Su, Sudo (Part D)


In this tutorial, we will cover the other available Unix utilities programs.

This includes commands like which, man, find su, and sudo. 

=> Click here for Complete Unix Tutorial series

Unix Utilities Programs Commands

Unix Video #5:

Unix Commands

#1) ls: List directory contents

  • Syntax: ls [OPTION] [FILE]
  • Example: list all (including hidden files) directory contents, in long format, sorted by time,
    • $ ls -alt

#2) which: Locate a command

  • Syntax: which [-a] filename
  • Example: List all paths from where ‘cat’ can run
    • $ which -a cat

#3) man: Interface for working with the online reference manuals.

  • Syntax: man [-s section] item
  • Example: Show the manual page for the ‘cat’ command
    • $ man cat

#4) su: Change user-id or become super-user.

  • Syntax: su [options] [username]
  • Example: Change user-id to ‘user1’ (if it exists)
    • $ su user1

#5) sudo: Execute a command as some other user or super-user

  • Syntax: sudo [options] [command]
  • Example: Get a file listing of an unlisted directory
    • $ sudo ls /usr/local/protected

#6) find: Used to search for files and directories as mentioned in the ‘expression’

  • Syntax: find [starting-point] [expression]
  • Example: In ‘/usr’ folder, find character device files, of the name ‘backup’
    • $ find /usr -type c -name backup

#7) du: Estimate disk usage is blocks

  • Syntax: du [options] [file]
  • Example: Show the number of blocks occupied by files in the current directory
    • $ du

#8) df: Show the number of free blocks for the mounted file system

  • Syntax: df [options] [file]
  • Example: Show the number of free blocks in local file systems
    • $ df -l

Watch out for our upcoming tutorial to know more about File Manipulations in Unix!!

=> Click here for Complete Unix Tutorial series

PREV Tutorial | NEXT Tutorial