-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexa_demo.sh
76 lines (54 loc) · 1.52 KB
/
exa_demo.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/bash
# Create a directory for demonstration
mkdir -p exa_demo
cd exa_demo
# Create some sample files and directories
mkdir dir1 dir2
touch file1.txt file2.txt hidden_file1.txt hidden_file2.txt
touch .dotfile1 .dotfile2
ln -s file1.txt link_to_file1
# Populate files with random data for size demonstration
echo "Hello, World!" > file1.txt
dd if=/dev/urandom of=file2.txt bs=1024 count=10 2>/dev/null
echo "This is a hidden file." > hidden_file1.txt
echo "This is another hidden file." > hidden_file2.txt
# Display various exa options
echo "Displaying files one per line:"
exa -1
echo "Displaying files in grid (default):"
exa -G
echo "Displaying extended details:"
exa -l
echo "Recursing into directories:"
exa -R
echo "Displaying directories as a tree:"
exa -T
echo "Sorting the grid across:"
exa -x
echo "Displaying type indicators by file names:"
exa -F
echo "Using colors:"
exa --colour=always
echo "Using colour scale for file sizes:"
exa --colour-scale
echo "Displaying icons:"
exa --icons
echo "Displaying all files, including hidden:"
exa -a
echo "Listing directories like regular files:"
exa -d
echo "Limiting recursion depth to 1:"
exa -L 1
echo "Reversing sort order:"
exa -r
echo "Sorting by file size:"
exa -s=size
echo "Listing only directories:"
exa -D
echo "Ignoring files as per .gitignore:"
exa --git-ignore
echo "Ignoring files matching glob patterns:"
exa -I '*.txt'
# Return to original directory and clean up if necessary
cd ..
echo "Demo complete. You can delete the 'exa_demo' directory if not needed."