Let's Learn Bash Scripting From Zero...

Now we are going to see only "ls" command and its usages of different aspects

Certainly! The ls command in Linux is used to list the contents of directories and files. It provides valuable information about files, directories, and their attributes. Let’s explore some commonly used options with practical examples:

  1. Basic Usage:To display the contents of the current directory:ls
  2. Long Format (-l):Displays detailed information about files and directories, including permissions, owner, group, size, and modification time:ls -l
  3. Include Hidden Files (-a):Lists all files, including hidden ones (those starting with a dot):ls -a
  4. Sort by Modification Time (-t):Sorts files and directories by their last modification time, showing the most recently modified ones first:ls -t
  5. Reverse Order (-r):Reverses the default order of listing:ls -r
  6. Sort by Size (-S):Lists files and directories by their sizes, with the largest ones first:ls -S
  7. List Recursively (-R):Lists files and directories recursively, including subdirectories:ls -R
  8. Display Inode Numbers (-i):Displays the index number (inode) of each file and directory:ls -i
  9. Human-Readable File Sizes (-h):Prints file sizes in a human-readable format (e.g., 1K, 234M, 2G):ls -lh
  10. List Directories Themselves (-d):Lists directories themselves, rather than their contents:ls -d

要查看或添加评论,请登录

VIGNESH MIC P的更多文章

  • CYBER SECURITY

    CYBER SECURITY

    IS CYBER SECURITY WORTHABLE ? Since data breaches and data hacking exist in this world, In order to prevent those kinds…

社区洞察

其他会员也浏览了