![](/img/trans.png)
[英]Listing directories with tab as delimiter
當我們使用ls -l命令列出 unix 中的文件時,output 是一個以空格作為分隔符的表,例如以下 我想轉換為制表符分隔文件( .tsv ),只需將空格更改為\t ,例如ls -l | sed -E 's/ +/\t/g' ls -l | sed -E 's/ +/\t/g'不起作用,因為文件 ...
[英]Listing directories with tab as delimiter
當我們使用ls -l命令列出 unix 中的文件時,output 是一個以空格作為分隔符的表,例如以下 我想轉換為制表符分隔文件( .tsv ),只需將空格更改為\t ,例如ls -l | sed -E 's/ +/\t/g' ls -l | sed -E 's/ +/\t/g'不起作用,因為文件 ...
[英]Get an array of all files in a remote folder using SSH in BASH
我正在嘗試使用 bash 和 SSH 獲取遠程文件夾中所有文件的數組:declare -a existing_files=$(ssh -q -i $SSH_KEY_PATH -t $PROXY_SERVER \ ssh -q -i ubuntu_vm $REMOTE_SERVER "ls $RAW_ ...
[英]realloc fails when printf is in code / weird chars
我嘗試為學校編寫一個簡單的 ls 實現 它有一些錯誤: 當上面標記的printf行沒有被注釋掉時,程序會告訴realloc(): invalid old size 當這一行被注釋掉時,只有當程序在沒有任何參數的情況下執行時才會發生這種情況 /bin/ 和 /sbin/ 打印出奇怪的字符我認為這是某種 ...
[英]Bash list files as {path + file}
我想搜索一個大小為 1033 字節的文件。 因此,我編寫ls -lRA ,它在大約 20 個文件夾中輸出大約 200 個文件。 當我用ls -lRA | grep 1033為文件 grep ls -lRA | grep 1033我只得到一個元素, -rw-r----- 1 root bandit ...
[英]Why does the ls instruction in gitbash not show me my c drive?
iamth@DESKTOP-TQE8AEJ MINGQ64 ~ (master) $ cd .. iamth@DESKTOP-TQE8AEJ MINGQ64 /c/Users $ cd ../.. iamth@DESKTOP-TQE8AEJ MINGQ64 / $ ls LICENSE.txt ...
[英]Why does ls not subset by filetype recursively (with -R)?
我想使用ls所有子目錄中的 all.jpg 文件。 對於同一目錄,這工作正常: ls *.jpg 但是,當使用-R進行遞歸時: ls -R *.jpg 我得到: zsh:no matches found: *.jpg 為什么這不起作用? 注意:我知道可以使用find或grep來完成,但我想知道為什 ...
[英]Linux bash - Regular Expression to find a string included between a static string and the first number
我需要在 linux bash 從字符串中提取一組字符,這些字符包含在 static 字符串和第一個數字之間。 一個簡單的例子應該會有所幫助: 基本字符串:hello-world-my_name-1.0.jar Static 字符串:hello-world- 目標:我的名字我正在嘗試 但不幸的是我 ...
[英]bash: /usr/bin/ls: cannot execute binary file: Exec format error
我正在使用 web 終端 ubuntu 20.04 來學習 shell,一切正常。 突然,當我嘗試列出當前目錄時調用 ls 命令時,我開始收到此錯誤消息,它出現了以下錯誤消息 bash:/usr/bin/ls:無法執行二進制文件:執行格式錯誤 ...
[英]for half command I need some help to complete, is this possible in this command to cd into the directory thats printed in output
當我做ls | grep -e *-folder1 ls | grep -e *-folder1它打印my-folder1即當前目錄中命令中匹配的文件夾的名稱。 有沒有辦法可以在這個目錄中添加類似 cd 的東西。 這更多的是嘗試學習 bash 或 linux 上的命令。 因為它是關於做我想要完成的 ...
[英]Command ls - A $path doesn't see desktop directory as empty. How come?
if [ "$(ls -A $path)" ];then echo $path dirpath = "$mainPath/$path" fi ...
[英]ls: cannot access '<DIR PATH passed by pipe>': No such file or directory
我有一組我感興趣的目錄,我想對這些目錄下的文件執行 sed 和 grep 。 我所做的是將所有路徑放在txt文件中,所有路徑都放在“”之間,因為它們包含變量, 例如 filelist.txt 包含: 現在我想在這些目錄下與我的模式匹配的所有文件上遞歸 grep 並將 XYZ 更改為 ABC 並打印出 ...
[英]In termux android ls: cannot open directory '.': Permission denied?
在此處輸入圖像描述 '''ls: 無法打開目錄'.': 權限被拒絕''' ...
[英]I get an error when I am try using -ls with different directory. And I don't know why
我正在使用-ls檢查我的文件是否存在。 問題是當我運行這個時: 我得到了我想要的: 但是當我在不同的目錄上運行相同的命令時: 我收到一個錯誤: 為什么是這樣? 我該如何解決? ...
[英]Stat function not working when passing file names of different directories
我正在嘗試實現ls命令,並且使用stat() function 來列出 inode 編號,我被困在-i選項中。 格式為./myls [options] [list of files] 如果我運行./myls -i. 我得到正確的 output (這會在當前目錄中打印文件) 如果我運行./myls.. ...
[英]What's the cmd line equivalent of "ls -a" in Powershell on Windows Vscode?
我想要在 Windows VsCode 中打開的 Powershell 中的目錄上顯示所有文件(包括隱藏文件)。 我想要等效於“ls -a”的 Powershell。 我怎么做? 我試過了: ...以及這些的許多變體。 有什么幫助嗎? 謝謝 ...
[英]LSD (LSDeluxe) in Git Bash
我曾嘗試使用 LSD,但在 CMD 中使用它時出現了一個小問題,它看起來非常好。 CMD 中的 LSD 但是當我在 Git Bash 中輸入 LSD 時,colors 不存在,而只是 Z0BCC70105AD247FEB63 中的一些文本LSD 有誰知道如何修理它? ...
[英]powershell ls errors certain folders / files
我正在考慮執行遞歸 Get-ChildItem -r 以通過擴展獲取 lastWriteTime、長度和組以進行計數。 我收到一堆錯誤,例如“Get-ChildItem:找不到項目 C:\Pics & Videos\Thumbs.db”。 我在想某些文件夾或文件名在文件夾或文件的名稱中有特殊 ...
[英]bash removing slashes in front of directory names
我試圖重新獲得 c-shell 和 tcsh 的一些簡單性。 我有一個簡單的別名,可以讓我列出目錄( alias lsdd 'ls | grep /' )。 我找到了一個帖子,里面有幾個解決方案,但沒有一個特別令人滿意。 例如, 除非沒有子目錄,否則效果很好,在這種情況下,您會收到一條錯誤消息— ...
[英]Cding into directory hangs terminal
嘗試沿路徑“cd”到特定目錄(例如 directory_A)時,我遇到了一個非常奇怪的問題。 每當我嘗試“cd”時,我的 linux 終端立即掛起至少 1 小時。 成功進入后,終端完全凍結,我無法在 shell 中運行任何命令。 此外,雖然在執行期間通過“ctrl-c”退出“cd”命令確實會殺死“ ...
[英]printing output of ls | wc -l in a txt file with two columns
我有很多目錄,每個目錄中都有不同數量的 CSV 個文件。 我有興趣獲取這些目錄的列表,它們各自包含 CSV 個文件。 所以我有這個 bash 循環。問題是,我如何獲得一個像這樣的 output 的 txt 文件? 其中第一列對應每個目錄的名稱,第二列對應每個目錄中CSV個文件的數量。 ...