In this tutorial, we will cover the other available Unix utilities programs.
This includes commands like which, man, find su, and sudo.
Unix Video #5:
#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 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 name ‘backup’
- $ find /usr -type c -name backup
#7) du: Estimate disk usage is blocks
- Syntax: du [options] [file]
- Example: Show number of blocks occupied by files in the current directory
- $ du
#8) df: Show number of free blocks for mounted file system
- Syntax: df [options] [file]
- Example: Show number of free blocks in local file systems
- $ df -l
Watch out our upcoming tutorial to know more about File Manipulations in Unix!!