AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / ubuntu / Perguntas / 1497056
Accepted
Chan Kim
Chan Kim
Asked: 2023-12-15 12:21:06 +0800 CST2023-12-15 12:21:06 +0800 CST 2023-12-15 12:21:06 +0800 CST

listando arquivos em um arquivo de lista na ordem 'últimos arquivos modificados por último'

  • 772

Se eu fizer isso, ls -ltrd *posso listar os arquivos ou diretórios classificados na ordem temporal modificada (os mais recentes no final, por causa da ropção). Agora eu tenho um arquivo contendo uma lista desses arquivos ou diretórios como este (a propósito, esta lista contém apenas arquivos). Suponha que este seja o arquivo list.txt.

simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/aa
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/ab_file_o.dat
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/bpad_40930.err
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/cds.lib
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/doctags
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/doctags_sw
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/env1
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/hdl.var
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/inc_list.txt
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/logx
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/makefileslist
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/scp_fw/abts.bin
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/sim_cmd.txt
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/sim_cmd/sim_cmd_defines.tcl
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/sim_cmd/sim_cmd_gui_fpga.tcl
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/src_list.txt
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/tags_sw
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/xemis_inc_list.txt
simab21m/sim_rtl_xmm_gemm_f32_spm_test_fpga/xemis_src_list.txt

Quero listar esses arquivos em ordem de tempo modificada inversa. Como devo fazer isso? eu tentei

ls -ltrd < cat list

mas isso me dá

bash: cat: No such file or directory

ou quando eu tentei

ls -ltrd < `cat list.txt`

isso me dá

bash: `cat list.txt`: ambiguous redirect

Como devo fazer isso?

command-line
  • 1 1 respostas
  • 54 Views

1 respostas

  • Voted
  1. Best Answer
    Chan Kim
    2023-12-15T12:41:11+08:002023-12-15T12:41:11+08:00

    Encontrei este canalizando o conteúdo de um arquivo para ls e aqui está minha resposta:

    xargs ls -ltrd < list.txt

    • 1

relate perguntas

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Existe um comando para listar todos os usuários? Também para adicionar, excluir, modificar usuários, no terminal?

    • 9 respostas
  • Marko Smith

    Como excluir um diretório não vazio no Terminal?

    • 4 respostas
  • Marko Smith

    Como descompactar um arquivo zip do Terminal?

    • 9 respostas
  • Marko Smith

    Como instalo um arquivo .deb por meio da linha de comando?

    • 11 respostas
  • Marko Smith

    Como instalo um arquivo .tar.gz (ou .tar.bz2)?

    • 14 respostas
  • Marko Smith

    Como listar todos os pacotes instalados

    • 24 respostas
  • Martin Hope
    Flimm Como posso usar o docker sem sudo? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    led-Zepp Como faço para salvar a saída do terminal em um arquivo? 2014-02-15 11:49:07 +0800 CST
  • Martin Hope
    ubuntu-nerd Como descompactar um arquivo zip do Terminal? 2011-12-11 20:37:54 +0800 CST
  • Martin Hope
    TheXed Como instalo um arquivo .deb por meio da linha de comando? 2011-05-07 09:40:28 +0800 CST
  • Martin Hope
    Ivan Como listar todos os pacotes instalados 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    David Barry Como determino o tamanho total de um diretório (pasta) na linha de comando? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher "Os seguintes pacotes foram retidos:" Por que e como resolvo isso? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford Como os PPAs podem ser removidos? 2010-07-30 01:09:42 +0800 CST

Hot tag

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve