From c4313277e853b7edf9c56063fe8ce01dd59c617d Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Wed, 27 Sep 2023 02:18:31 +0200 Subject: [PATCH] write ls --- basics/ls.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 basics/ls.md diff --git a/basics/ls.md b/basics/ls.md new file mode 100644 index 0000000..5974eb2 --- /dev/null +++ b/basics/ls.md @@ -0,0 +1,46 @@ +--- +title: "ls" +tags: [ "basics" ] +--- + +Firstly, your `ls` is probably aliased to something. + +Check it with: + + +```bash +alias ls +``` +If the prompt shows some alias, then start by removing it: + + +```bash +unalias ls +``` + +Now we can begin. + +Check the most recently modified file: + + +```bash +ls -t +``` + +Reverse this with `tac` to see the file which has been unmodified the longest: + + +```bash +ls -t | tac +``` +Group files by extension: + +```bash +ls -X +``` +Sort largest files first: + +```bash +ls -X +``` +