1.

Define the ls command of LINUX.

Answer»

ls: This command is used to get a listing of the contents in the current directory in columns. The ls command can also give listings of other directories without having to go to those directories. This command can also handle wild characters such as the * and? e.g., ls b* will list all files starting with lower case b, ls b ? will list all twocharacter file names beginning with lower case b. Some of the more common switches are:

  • ⇒ ls -a: To view a hidden file including those beginning with the ‘..’
  • ⇒ ls -l: To view a long listing showing file attributes and file permissions.
  • ⇒ ls -s: To view the listing showing the size of each file rounded up to the nearest kilobyte.
  • ⇒ ls -S: To view the list of files according to file size.
  • ⇒ ls -r: Gives the listing in reverse order.
  • ⇒ ls -t: To view the directory according to time.
  • ⇒ ls -la: This will list all the files in a long format showing full file details.


Discussion

No Comment Found