Q1. Eu tenho um comando e estou confuso porque está classificando os arquivos por Kilobytes e Megabytes?
$ find ~ -maxdepth 1 -size + 1024c -tipo f -exec du -h {} \; | sort -nr
80K /home/sl6/S3401636/Lab 4- Reporting Overview in IBM RQM(2).pdf
20K /home/sl6/S3401636/.bash_history
8.5M /home/sl6/S3401636/Software-Testing-Chapter-4-Test Design Techniques.pdf
7.7M /home/sl6/S3401636/Software-Testing-Chapter-2 Software Lifecycle.pdf
6.2M /home/sl6/S3401636/Week5b.ppt
5.1M /home/sl6/S3401636/Software-Testing-Chapter-5-Test Management.pdf
4.7M /home/sl6/S3401636/Week 9 - Mobile devices.ppt
4.0K /home/sl6/S3401636/.viminfo
3.4M /home/sl6/S3401636/Software-Testing-Chapter-3-Static Techniques.pdf
3.2M /home/sl6/S3401636/Software-Testing-Chapter-6.pdf
1.9M /home/sl6/S3401636/Week5a.ppt
1.8M /home/sl6/S3401636/Lab 8 - Results and Report Analysis(2).pdf
1.6M /home/sl6/S3401636/Lab 7 - Running a Schedule in IBM's RPT(2).pdf
1.4M /home/sl6/S3401636/lab01(3).pdf
1.3M /home/sl6/S3401636/Week 10 Human Capabilities.pdf
1.2M /home/sl6/S3401636/week05.pdf
Se eu canalizar o comando "head" para o final
$ find ~ -maxdepth 1 -size + 1024c -tipo f -exec du -h {} \; | sort -nr | cabeça -14
1.2M /home/sl6/S3401636/week05.pdf
1.3M /home/sl6/S3401636/Week 10 Human Capabilities.pdf
1.4M /home/sl6/S3401636/lab01(3).pdf
1.6M /home/sl6/S3401636/Lab 7 - Running a Schedule in IBM's RPT(2).pdf
1.8M /home/sl6/S3401636/Lab 8 - Results and Report Analysis(2).pdf
1.9M /home/sl6/S3401636/Week5a.ppt
3.2M /home/sl6/S3401636/Software-Testing-Chapter-6.pdf
3.4M /home/sl6/S3401636/Software-Testing-Chapter-3-Static Techniques.pdf
4.0K /home/sl6/S3401636/.viminfo
4.7M /home/sl6/S3401636/Week 9 - Mobile devices.ppt
5.1M /home/sl6/S3401636/Software-Testing-Chapter-5-Test Management.pdf
6.2M /home/sl6/S3401636/Week5b.ppt
7.7M /home/sl6/S3401636/Software-Testing-Chapter-2 Software Lifecycle.pdf
8.5M /home/sl6/S3401636/Software-Testing-Chapter-4-Test Design Techniques.pdf
Q2.Estou imaginando como posso obter apenas os nomes dos arquivos sem o caminho completo. Eu tentei awk com basename mas não consegui fazê-lo funcionar.
Q3.Also como faço para listar os arquivos mais altos (do maior para o menor E do menor para o maior)
por exemplo, 8,5M, 7,7M, 6,2M, 5,1M (do maior para o menor)
5,1 M, 6,2 M, 7,7 M, 8,5 M
em vez de partir do arquivo de tamanho mais baixo 1.2M.
Eu acho que posso usar "tail" para essa situação
Q4.Finally, se eu remover a opção -h para "du" nos comandos acima, listarei um conjunto diferente de resultados. Por quê?
4 /home/sl6/S3401636/.viminfo
20 /home/sl6/S3401636/.bash_history
80 /home/sl6/S3401636/Lab 4- Reporting Overview in IBM RQM(2).pdf
1132 /home/sl6/S3401636/week05.pdf
1300 /home/sl6/S3401636/Week 10 Human Capabilities.pdf
1424 /home/sl6/S3401636/lab01(3).pdf
1628 /home/sl6/S3401636/Lab 7 - Running a Schedule in IBM's RPT(2).pdf
1812 /home/sl6/S3401636/Lab 8 - Results and Report Analysis(2).pdf
1924 /home/sl6/S3401636/Week5a.ppt
3208 /home/sl6/S3401636/Software-Testing-Chapter-6.pdf